Lean Kernel Arena / perf/discarded-argument-match

Test "perf/discarded-argument-match"

Expected: 👍 accept · Size: 28.6 KB · Lines: 596 · lean4export: 3.1.0 · Lean: 4.29.1 · 📄 Declaration · 🔗 Source

discarded-argument.lean with count and N.add written by structural recursion, so the declaration to check is the same

dropArg (count #n)      and      dropArg (count #(n+1))

over definitions that unfold through brecOn rather than through N.rec.

brecOn reduces via the course-of-values table N.below #k = m #(k-1) ×' (m #(k-2) ×' (… ×' PUnit)), a k-deep tuple holding the result at every predecessor. The compiled count reads only x.1, so the rest of the table is built and never read, and typing each projection forces N.below to the depth of that projection.

N=200 in the Lean source, matching its pair.

Checker Result ⏱️ 🧠
mathgraph 👍 2 ms (÷5618) 39.9 MB (-40%)
ind-models 👍 8.6 s (0%) 106.3 MB (+60%)
official-nightly 👍 125 ms (÷68) 68.6 MB (+3%)
evmlean 🚫 3.7 s 136.9 MB
nanoda 👍 99 ms (÷86) 4.5 MB (÷15)
mini 👍 41 ms (÷209) 74.2 MB (+12%)
lean4lean 👍 10.7 s (+25%) 96.5 MB (+45%)
sokonanoda 👍 2 ms (÷5600) 39.9 MB (-40%)
zignodamus 👍 32 ms (÷271) 30.1 MB (÷2.2)
nanoclo 👍 3 ms (÷3229) 53.6 MB (-19%)
nanobruijn 👍 60 ms (÷144) 15.2 MB (÷4.4)
kiota 👍 20 ms (÷433) 19.2 MB (÷3.5)
official 👍 8.6 s (0%) 66.3 MB (0%)
vow-lean-kernel 💥 1.3 m 401.8 MB
rpylean 👍 349 ms (÷25) 47.6 MB (-28%)
official-v4.28.0 👍 16.7 s (+95%) 74.1 MB (+12%)
still-nanoda 👍 93 ms (÷93) 4.6 MB (÷14)
nyaya 💥 1.8 m 16.7 MB
parse-only 👍 29 ms (÷299) 61.8 MB (-7%)