Test "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 proj-of-subst-prop, sharing its first two steps:
-
Definitional equality is not transitive on three
Bools built fromAcc.rec—gateA ≡ gateBandgateB ≡ gateCby proof irrelevance on theAccargument, butgateA ≢ gateC— soGateP := gateA = gateBandGateQ := gateA = gateCare definitionally equal types whose proofs behave differently underEq.rec.resultSort hK-reduces toPropfor a variableh : GatePand stays stuck for the closedgateWitness : GateQ. -
Issue.Owner : ∀ (h : GateP), resultSort his therefore accepted as a family of propositions whose constructor carries a fieldA : Type, whileOwner gateWitness— well-typed, sinceGateQ ≡ GateP— has a sort that does not reduce toProp.
Where 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 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 | 99.9 MB | |||
| nanoda | ✋ | 11 ms | 3.8 MB | |||
| nanobruijn | ✋ | 16 ms | 22.1 MB | |||
| ind-models | 💥 | 118 ms | 106.3 MB | |||
| official | ✋ | 53 ms | 66.6 MB | |||
| lean4lean | ✋ | 246 ms | 105.7 MB | |||
| evmlean | ✋ | 1.6 m | 429.8 MB | |||
| mini | ✋ | 1.2 s | 74.0 MB | |||
| sokonanoda | ✋ | 4 ms | 102.0 MB | |||
| nanoclo | ✋ | 8 ms | 65.7 MB | |||
| zignodamus | ✋ | 4 ms | 8.8 MB | |||
| vow-lean-kernel | ✋ | 836 ms | 10.2 MB | |||
| official-v4.28.0 | 👍 | 62 ms | 73.9 MB | |||
| still-nanoda | ✋ | 11 ms | 3.9 MB | |||
| kiota | ✋ | 12 ms | 18.9 MB | |||
| rpylean | ✋ | 11 ms | 26.5 MB | |||
| nyaya | ✋ | 26 ms | 13.7 MB | |||
| parse-only | 👍 | 42 ms | 65.7 MB |