Lean Kernel Arena / perf/discarded-argument-match

Test "perf/discarded-argument-match"

Expected: 👍 accept · Size: 29.2 KB · Lines: 606 · lean4export: 3.1.0 · Lean: 4.36.0 · Timeout: 40.0 s · 📄 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 ⏱️ 🧠
nano-lean 👍 0.729 ms (÷200) 26.4 MB (÷3.6)
gruszka 👍 2.32 ms (÷63) 116.3 MB (+24%)
mathgraph 👍 1.20 ms (÷122) 29.9 MB (÷3.1)
sokonanoda 👍 1.04 ms (÷141) 29.7 MB (÷3.2)
pestka 👍 2.66 ms (÷55) 19.2 MB (÷4.9)
kefir 👍 1.35 ms (÷108) 6.5 MB (÷14)
kefir-wasm 👍 170 ms (+17%) 92.9 MB (-1%)
con-ron 👍 45.6 ms (÷3.2) 50.3 MB (-46%)
con-ron-stream 👍 46.2 ms (÷3.2) 51.8 MB (-45%)
con-agua 👍 40.6 ms (÷3.6) 19.8 MB (÷4.7)
nanobruijn 👍 32.7 ms (÷4.5) 15.5 MB (÷6.1)
nanoda 👍 32.3 ms (÷4.5) 4.4 MB (÷21)
con-leche 👍 34.0 ms (÷4.3) 27.0 MB (÷3.5)
pestka-wasm 👍 529 ms (×3.6) 321.3 MB (×3.4)
official-nightly 👍 145 ms (-1%) 99.0 MB (+6%)
eink0rn 👍 117 ms (-20%) 145.2 MB (+55%)
official 👍 146 ms 93.7 MB
ind-models 👍 220 ms (+50%) 109.9 MB (+17%)
kiota 👍 15.3 ms (÷9.5) 25.7 MB (÷3.7)
tenet 👍 199 ms (+36%) 57.6 MB (-39%)
tenet-hs 👍 27.3 ms (÷5.4) 56.4 MB (-40%)
logos-kernel 👍 0.630 ms (÷232) 4.4 MB (÷21)
evmlean 🚫 4.29 s 275.9 MB
mini 👍 41.4 ms (÷3.5) 65.4 MB (-30%)
overfull ⌛ — —
lean4lean 👍 11.5 s (×79) 93.6 MB (0%)
lean4cobol 👍 14.5 s (×99) 18.1 MB (÷5.2)
tenet-jvm 👍 329 ms (×2.3) 94.5 MB (+1%)
nanoclo 👍 2.49 ms (÷59) 45.4 MB (÷2.1)
vow-lean-kernel ⌛ — —
canonical-min 🚫 388 ms 1.0 GB
lazylean 👍 36.1 ms (÷4.0) 23.5 MB (÷4.0)
rpylean 👍 3.97 ms (÷37) 11.2 MB (÷8.4)
metalean-slow 👍 99.2 ms (-32%) 64.2 MB (-31%)
metalean-fast 👍 1.96 s (×13) 79.9 MB (-15%)
nanoclo-fortran 👍 4.50 ms (÷32) 4.9 MB (÷19)