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

Test "perf/proj-applied-struct"

Expected: 👍 accept · Size: 111.4 KB · Lines: 2.1 k · lean4export: 3.2.0 · Lean: 4.38.0-nightly-2026-12-03 · Timeout: 3.83 min · 📄 Declaration · 🔗 Source

The declarations to check compare

(gC slowA c).fn x      and      (gC' slowA c).fn x

(and two variants), where gC' s c unfolds to gC s c, and gC s c is if s = c then ⟨…, 0⟩ else ⟨…, 1⟩ for a structure whose field fn is a function. slowA is a closed Nat that evaluates in 2^19 unit steps, and c and x are variables.

Unfolding gC' makes the sides identical, for Θ(1). Reducing the structure gC slowA c to a constructor instead decides slowA = c: it evaluates slowA, for Θ(2^19), and then is stuck on c anyway. Unlike in proj-cheap-struct, the projections are not compared as such: each is the head of an application. Official (v4.35.0) reached whnf_core with full reduction of projected structures before it compared the applications by their arguments.

Official (v4.35.0) needed about 19 s and 1.4 GB here, nearly all of it evaluating slowA, slowB and slowC. Distilled from AxiomMath/CFSG's CertificateChecks.KernelSporSch.RuE64.invol_eq, where the same shape took it over 24 GB and more than 1.5 hours.

Checker Result ⏱️ 🧠
gruszka 👍 2.79 ms (÷3891) 138.3 MB (÷5.3)
nano-lean 👍 1.29 ms (÷8409) 40.2 MB (÷18)
pestka 👍 4.53 ms (÷2396) 20.7 MB (÷35)
con-leche 👍 14.4 s (+33%) 3.1 GB (×4.4)
con-ron 👍 10.3 s (-5%) 2.5 GB (×3.4)
nucleus 👍 433 ms (÷25) 13.9 MB (÷53)
official 👍 10.8 s 732.7 MB