Lean Kernel Arena (Preview) / perf/fueled-chain

Test "perf/fueled-chain"

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

Distilled from con-leche's fuel-bridge (_datF) lemmas, the declarations on which nanobruijn timed out on the con-leche test.

Fueled α packages a fuel-indexed family p : Nat → Except Unit α with a proof whose type mentions p twice under binders. A _datF lemma states that running a monadic function in Fueled and extracting at fuel F equals running it in Except Unit, proved by unfolding and rewriting with the atF lemmas for bind/pure/throw/ite. What is left for the kernel is a definitional equality between two monadic programs that differ only in the monad instance, under one binder per bind and a do-notation join point per unless … throw guard.

chainN (N = 6, 9, 12) has N binds, each followed by a guard. A checker that recognises the unfolded and the literal program as equal outright is fast (nanoda: 2 ms, 18 ms, 32 ms); one that compares them structurally unfolds bind to Subtype.mk p h and, through proof irrelevance on the hs, re-compares the rest of the program twice per guard (nanobruijn: 19 ms, 4.1 s, 256 s). Without the guards it is cheap for both.

Checker Result ⏱️ 🧠
gruszka 👍 14.6 ms (÷8.8) 150.3 MB (+22%)
nano-lean 👍 22.4 ms (÷5.7) 108.8 MB (-12%)
pestka 👍 21.0 ms (÷6.1) 41.1 MB (÷3.0)
con-leche 👍 59.0 ms (÷2.2) 37.5 MB (÷3.3)
con-ron 👍 59.3 ms (÷2.2) 65.8 MB (-47%)
nucleus 🚫 201 ms 26.8 MB
official 👍 128 ms 123.4 MB