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.