Lean Kernel Arena (Preview) / perf/proj-stuck-struct

Test "perf/proj-stuck-struct"

Expected: 馃憤 accept 路 Size: 50.7鈥疜B 路 Lines: 916 路 lean4export: 3.2.0 路 Lean: 4.38.0-nightly-2026-12-03 路 Timeout: 40.0鈥痵 路 馃搫 Declaration 路 馃敆 Source

A definitional equality under a projection whose structure argument is stuck, distilled from a fuel-bridge lemma of con-leche's own proof library, on which con-leche ran out of memory.

step c n x : Nat 脳 Nat recurses structurally on the fuel n; for a variable x each level is stuck on match x, and each branch reads .1 of two recursive calls. stepN checks (step (id c) N x).1 = (step c N x).1 by rfl, the sides differing only in id c vs c.

A checker that leaves a stuck projection's structure argument alone (as the reference kernel's whnf_core did when reduce_proj failed) compares step (id c) N x =?= step c N x, tries the arguments first, and is done at once. A checker that replaces it by its weak head normal form has lost the step head and unrolls the recursion tree on both sides: exponential in N (con-leche before the fix: 0.2 s, 2 s, 17 s and 73 MB, 0.4 GB, 2.6 GB for N = 12, 16, 20; official, nanoda, lean4lean: ~0.02 s at every N).

Checker Result 鈴憋笍 馃
gruszka 馃憤 2.26鈥痬s (梅20) 104.2鈥疢B (-8%)
nano-lean 馃憤 0.842鈥痬s (梅54) 20.3鈥疢B (梅5.6)
pestka 馃憤 3.28鈥痬s (梅14) 18.9鈥疢B (梅6.0)
con-leche 馃憤 6.03鈥痬s (梅7.6) 25.4鈥疢B (梅4.4)
con-ron 馃憤 30.0鈥痬s (-35%) 41.8鈥疢B (梅2.7)
nucleus 馃憤 179鈥痬s (脳3.9) 13.8鈥疢B (梅8.1)
official 馃憤 45.8鈥痬s 112.7鈥疢B