Lean Kernel Arena / bugs/rec-of-subst-prop

Test "bugs/rec-of-subst-prop"

Expected: ✋ reject · Size: 270.3 KB · Lines: 5.1 k · lean4export: 3.1.0 · Lean: 4.29.1 · 📄 Declaration · 🔗 Source

Proof of False from a Prop that carries a Type field, recovered through the recursor instead of a projection.

A second variant of bugs/proj-of-subst-prop, sharing its first two steps:

  1. Definitional equality is not transitive on three Bools built from Acc.rec — gateA ≡ gateB and gateB ≡ gateC by proof irrelevance on the Acc argument, but gateA ≢ gateC — so GateP := gateA = gateB and GateQ := gateA = gateC are definitionally equal types whose proofs behave differently under Eq.rec. resultSort h K-reduces to Prop for a variable h : GateP and stays stuck for the closed gateWitness : GateQ.

  2. Issue.Owner : ∀ (h : GateP), resultSort h is therefore accepted as a family of propositions whose constructor carries a field A : Type, while Owner gateWitness — well-typed, since GateQ ≡ GateP — has a sort that does not reduce to Prop.

Where bugs/proj-of-subst-prop then projects the field out, this variant eliminates Owner with its own Prop-only recursor into Fiber X := Acc emptyTypeRel X, which is a proposition, and recovers the data from there: Acc.rec eliminates Acc into Type, and propext transports an Acc proof between two Fiber types. Proof irrelevance identifies Owner.mk gateWitness Empty with Owner.mk gateWitness Unit, so the identity function of one type is applied to a value of the other, and Empty becomes inhabited. The proof of False uses propext and no other axiom.

Because no projection is involved, the guard that stops bugs/proj-of-subst-prop — refusing to project a data field out of a proposition — never fires here. A checker has to refuse the substitution, or the stuck result sort of Issue.Owner, instead.

Both variants are ruled out by leanprover/lean4#14807, which makes the kernel's is_prop check require the inferred type to reduce to a sort: Issue.Owner is then rejected with (kernel) type expected.

The exploit is by Daniel Selsam (OpenAI), generated with OpenAI's internal models, and is the regression test added in leanprover/lean4#14847.

Checker Result ⏱️ 🧠
mathgraph ✋ 4 ms 83.9 MB
sokonanoda ✋ 4 ms 101.7 MB
nanoclo ✋ 8 ms 61.7 MB
con-ron ✋ 35 ms 66.9 MB
lazylean ✋ 10 ms 23.4 MB
nanoda ✋ 11 ms 3.9 MB
nanobruijn ✋ 17 ms 18.3 MB
con-leche ✋ 25 ms 28.2 MB
eink0rn ✋ 13 ms 30.9 MB
ind-models 💥 118 ms 106.9 MB
official ✋ 53 ms 66.8 MB
lean4lean ✋ 246 ms 109.2 MB
tenet ✋ 177 ms 51.6 MB
nanoclo-fortran ✋ 18 ms 6.9 MB
lean4cobol ✋ 234 ms 14.0 MB
evmlean ✋ 1.6 m 386.7 MB
mini ✋ 1.2 s 73.7 MB
overfull 💥 1.6 m 49.1 MB
kiota ✋ 12 ms 17.0 MB
canonical-min 🚫 416 ms 1.1 GB
rpylean ✋ 10 ms 22.5 MB
vow-lean-kernel ✋ 836 ms 10.2 MB
official-v4.28.0 👍 62 ms 73.6 MB
still-nanoda ✋ 11 ms 4.0 MB
nyaya ✋ 26 ms 13.2 MB
parse-only 👍 42 ms 66.0 MB