Lean Kernel Arena (Preview) / perf/beta-ladder

Test "perf/beta-ladder"

Expected: 👍 accept · Size: 450.9 KB · Lines: 10.4 k · lean4export: 3.2.0 · Lean: 4.38.0-nightly-2026-12-03 · Timeout: 40.0 s · 📄 Declaration · 🔗 Source

The declaration to check reduces

(fun x₁ => … (fun xₙ => x₁ + (x₂ + (… + (xₙ + 0)))) 0 …) 0

to 0, through n beta redexes over a body that reads every binder.

Reducing the ladder takes n beta steps whatever a checker does, so the test is what one step costs. Substituting into the body on entry to binder k copies the n − k redexes still below it, and those copies sum to Θ(n²). Carrying the substitution in an environment leaves the body untouched, for Θ(n).

N=2000 in the Lean source.

Checker Result ⏱️ 🧠
gruszka 👍 37.7 ms (÷21) 119.4 MB (÷4.6)
nano-lean 👍 3.36 ms (÷238) 46.5 MB (÷12)
pestka 👍 48.2 ms (÷17) 51.3 MB (÷11)
con-leche 👍 921 ms (+15%) 217.8 MB (÷2.5)
con-ron 👍 1.47 s (+85%) 493.1 MB (-10%)
nucleus 🚫 123 ms 16.6 MB
official 👍 799 ms 546.6 MB