Lean Kernel Arena (Preview) / perf/unfold-before-literal

Test "perf/unfold-before-literal"

Expected: 馃憤 accept 路 Size: 66.2鈥疜B 路 Lines: 1.2鈥痥 路 lean4export: 3.2.0 路 Lean: 4.38.0-nightly-2026-12-03 路 Timeout: 4.00鈥痬in 路 馃搫 Declaration 路 馃敆 Source

The declarations to check compare

[slowA, 1].sum      and      slowA + (1 + 0)

(and two variants: the sides swapped, and a longer list), where slowA is a closed Nat that evaluates in 2^19 unit steps.

List.sum is foldr (路 + 路) 0, so unfolding it three times makes the sides identical, for 螛(1). But both sides are closed Nat terms headed by +, and a checker that tries its Nat literal extension before unfolding evaluates slowA to a literal first, for 螛(2^19). The test asks whether literal arithmetic waits until unfolding has had its chance.

Official (v4.35.0) needed about 20 s and 1.4 GB here, nearly all of it evaluating slowA, slowB and slowC. Distilled from AxiomMath/CFSG's CertificateChecks.KernelJ2Cover.totalC, where the same shape cost it more than 100 GB.

Checker Result 鈴憋笍 馃
gruszka 馃憤 5.23鈥痬s (梅2123) 106.3鈥疢B (梅6.9)
nano-lean 馃憤 2.62鈥痵 (梅4.2) 3.2鈥疓B (脳4.4)
pestka 馃憤 3.82鈥痬s (梅2906) 20.9鈥疢B (梅35)
con-leche 馃憤 14.5鈥痵 (+31%) 3.1鈥疓B (脳4.4)
con-ron 馃憤 10.2鈥痵 (-8%) 2.5鈥疓B (脳3.5)
nucleus 馃憤 367鈥痬s (梅30) 14.0鈥疢B (梅52)
official 馃憤 11.1鈥痵 732.7鈥疢B