Lean Kernel Arena (Preview) / perf/short-circuit-and

Test "perf/short-circuit-and"

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

The declarations to check compare

false && eqA 600 (unpack 600 11 p) (unpack 600 11 q)      and      false && Nat.beq p q

(and two variants: the sides swapped, and the conjunction nested in a second one as in the CFSG goal), where p and q are variables, unpack n w p reads n points of w bits out of p, and eqA compares two arrays point by point.

&& is a match on its first argument, so unfolding it reduces both sides to false, for 螛(1). A checker that compares the arguments of the shared head first compares the open second arguments instead, which are not definitionally equal: it reduces points Nat.land (Nat.shiftRight p (w * i)) m by peeling the shift bit by bit down to the free p, for 螛((n路w)虏), and only then unfolds &&. Unlike in discarded-argument, the head discards its second argument only because the first is false, and the arguments are open terms that can neither be evaluated nor quickly told apart.

Official (v4.36.0) needed about 14 s and 1.6 GB here. Distilled from AxiomMath/CFSG's CertificateChecks.Batch27581.p2, where the same shape over 1755 points of 11 bits took it 441 s, and sokonanoda and Gruszka past 8 GB.

Checker Result 鈴憋笍 馃
gruszka 馃憤 55.2鈥痬s (梅253) 166.6鈥疢B (梅5.6)
nano-lean 馃憤 38.8鈥痬s (梅360) 162.6鈥疢B (梅5.7)
pestka 馃憤 130鈥痬s (梅107) 80.0鈥疢B (梅12)
con-leche 馃憤 12.3鈥痵 (-12%) 2.6鈥疓B (脳2.9)
con-ron 馃憤 9.82鈥痵 (-30%) 1.3鈥疓B (+49%)
nucleus 馃毇 806鈥痬s 101.7鈥疢B
official 馃憤 14.0鈥痵 925.5鈥疢B