Lean Kernel Arena (Preview) / perf/ite-taken-branch

Test "perf/ite-taken-branch"

Expected: 馃憤 accept 路 Size: 4.3鈥疢B 路 Lines: 88.9鈥痥 路 lean4export: 3.2.0 路 Lean: 4.38.0-nightly-2026-12-03 路 Timeout: 3.83鈥痬in 路 馃搫 Declaration 路 馃敆 Source

The declarations to check compare

(if true = true then piA else tA)      and      piA

(and two variants: the sides swapped, and a case split on a variable o as in the CFSG proof), where piA := invCand 300 tA is the inverse of a permutation table, computed by a for loop of Array.set!.

Unfolding ite and deciding true = true takes the then branch, and the sides are identical, for 螛(1). But piA is higher than ite, and a checker that unfolds the higher side first evaluates piA, for 螛(n虏) list steps, before ite gets its turn. Unlike in unroll-versus-evaluate, the cheap step is on the lower side, it is a Decidable instance rather than a recursion, and the other side is a constant without arguments.

Official (v4.36.0) needed about 14 s and 1.7 GB here, nearly all of it evaluating piA, piB and piC. Distilled from AxiomMath/CFSG's CertificateChecks.Batch27011.optI_eq, where the same shape over 1755 points took it, sokonanoda, con-ron and con-leche past 8 GB.

Checker Result 鈴憋笍 馃
gruszka 馃憤 49.1鈥痬s (梅273) 170.6鈥疢B (梅6.4)
nano-lean 馃憤 39.9鈥痬s (梅335) 175.0鈥疢B (梅6.3)
pestka 馃憤 127鈥痬s (梅105) 89.7鈥疢B (梅12)
con-leche 馃憤 14.6鈥痵 (+9%) 3.4鈥疓B (脳3.1)
con-ron 馃憤 11.6鈥痵 (-14%) 1.6鈥疓B (+53%)
nucleus 馃毇 919鈥痬s 116.2鈥疢B
official 馃憤 13.4鈥痵 1.1鈥疓B