Lean Kernel Arena (Preview) / bugs/nat-shift-huge

Test "bugs/nat-shift-huge"

Expected: 👍 accept · Size: 313.7 KB · Lines: 5.9 k · lean4export: 3.2.0 · Lean: 4.38.0-nightly-2026-12-03 · 📄 Declaration · 🔗 Source

Nat.shiftRight and Nat.shiftLeft on literals with shift counts ≥ 2^64.

Both Nat.shiftRight 42 (2^64) and Nat.shiftLeft 0 (2^64) reduce to 0 in the kernel's Nat-literal extension. A checker that narrows the shift count to a 64-bit machine integer unconditionally overflows, and one that computes 2^shift explicitly OOMs or panics.

Covers both closed applications (rfl) and open applications in the major premise of Nat.rec (so closed-term evaluators cannot bypass the kernel's whnf Nat-literal path).

rpylean crashed with an uncaught OverflowError in nat_binop_value (v2.toint() on Nat.shiftRight and Nat.shiftLeft).

Checker Result ⏱️ 🧠
gruszka 👍 4.99 ms 138.1 MB
nano-lean 👍 3.12 ms 69.0 MB
pestka 👍 9.72 ms 26.9 MB
con-leche 👍 37.0 ms 33.2 MB
con-ron 👍 54.5 ms 51.7 MB
nucleus 🚫 86.8 ms 14.9 MB
official 👍 69.4 ms 115.2 MB