Test "proj-of-subst-prop"
Expected: ✋ reject · Size: 255.6 KB · Lines: 4.9 k · lean4export: 3.1.0 · Lean: 4.29.1 · 📄 Declaration · 🔗 Source
Proof of False by projecting the Bool field out of a proposition, reached by
substituting a proof of one proposition for a proof of a definitionally equal
one.
Mechanism
-
Definitional equality is not transitive here.
a,bandcare threeBools built fromAcc.recsuch that a kernel reportsa ≡ bandb ≡ c— both by proof irrelevance on theAccargument, the latter after some iota steps — whilea ≢ c, because there the twoAccproofs have different types (Acc (· < ·) 1vs.Acc (· < ·) 0). -
So
P := a = bandQ := a = care definitionally equal types whose proofs behave differently.gate h := Eq.rec (motive := fun _ _ => Type) Prop hK-reduces toPropforh : P, because that reduction only needs the type ofhto be definitionally equal to the typea = aofEq.refl a, i.e.b ≡ a. For the closedwitness : Qit stays stuck, since that would needc ≡ a. -
An inductive family is declared over the reducing side and used on the stuck one.
Owner : ∀ (h : P), gate his accepted as a family of propositions — its recursor only eliminates intoProp.Owner witnessis well-typed, sinceQ ≡ P, but its sort does not reduce toProp, so the projectionobserveis permitted to extract theBoolfield from an inhabitant.
Proof irrelevance then identifies two Owner.mk applications carrying
different Bool fields, and observing them yields False, with no axioms
involved.
Unlike rec-missing-ih and proj-of-stuck-prop, this needs no interference
from the definitional-equality cache: every comparison above comes out the same
way in a fresh type-checker session, so it is independent of whether, and how,
such a cache is keyed. What it does need is that the sort of an inductive
family is re-examined after a substitution that definitional equality permits.
The projection in the last step is ruled out by
leanprover/lean4#14807, which
makes the kernel's is_prop check require the inferred type to reduce to a
sort: a stuck sort then raises (kernel) type expected instead of answering
that the type is not a proposition.
| Checker | Result | ⏱️ | 🧠 | |||
|---|---|---|---|---|---|---|
| mathgraph | ✋ | 4 ms | 95.9 MB | |||
| nanoda | ✋ | 11 ms | 3.9 MB | |||
| nanobruijn | ✋ | 16 ms | 25.5 MB | |||
| ind-models | 💥 | 114 ms | 105.9 MB | |||
| official | ✋ | 51 ms | 67.1 MB | |||
| lean4lean | ✋ | 56 ms | 98.4 MB | |||
| evmlean | ✋ | 1.6 m | 380.6 MB | |||
| mini | ✋ | 1.2 s | 74.6 MB | |||
| sokonanoda | ✋ | 4 ms | 96.1 MB | |||
| nanoclo | ✋ | 7 ms | 67.8 MB | |||
| zignodamus | ✋ | 4 ms | 8.8 MB | |||
| vow-lean-kernel | ✋ | 820 ms | 10.1 MB | |||
| official-v4.28.0 | 👍 | 61 ms | 73.6 MB | |||
| still-nanoda | 👍 | 11 ms | 3.5 MB | |||
| kiota | ✋ | 12 ms | 17.2 MB | |||
| rpylean | ✋ | 11 ms | 25.9 MB | |||
| nyaya | ✋ | 35 ms | 14.6 MB | |||
| parse-only | 👍 | 41 ms | 65.2 MB |