The boardMaths

NumPy Lean Check

NumPy Lean Check

I modelled NumPy's integer, shape, indexing, dtype, datetime and string logic in Lean 4 and tested the model against the real library. Ask bincount to count one huge number and it returns nothing.

  • 55 bug records, 26 of them new to NumPy, with 121 properties proved and 87 refuted
  • The bincount bug is filed upstream as numpy/numpy#33305

Code ↗Article ↗Issue #33305 ↗

November 2026Python and Julia had already been checked against Lean models, and nobody had done it for NumPy. Fifty differential tests agree with NumPy 2.5.4 on three seeds, and every bug record comes with a reproducer that runs against the real library.