Test "proj-of-prop"
Expected: ✋ reject · Size: 3.9 KB · Lines: 56 · lean4export: 3.1.0 · Lean: 4.29.0 · 📄 Declaration · 🔗 Source
A proof of False via a projection from a Prop-typed structure whose
constructor was applied to an ill-typed argument. The exported term is
badFalse : False := (Wrapper.mk True.intro).p
where Wrapper : Prop has a single field p : False, so Wrapper.mk
expects a proof of False but is given True.intro : True.
A sound checker must reject this. A checker that types a projection by
inferring (rather than checking) its structure argument — i.e. that
trusts the structure to be well-typed instead of verifying the
constructor's argument types against its binders — will accept it,
because Wrapper.mk True.intro still formally inhabits Wrapper at
the structural level, and the p projection is then read back out at
the declared field type False.
| Checker | Result | ⏱️ | 🧠 | |||
|---|---|---|---|---|---|---|
| still-nanoda | ✋ | 2 ms | 2.9 MB | |||
| sonanoda | ✋ | 2 ms | 2.9 MB | |||
| nanoda | ✋ | 2 ms | 2.8 MB | |||
| nanobruijn | ✋ | 2 ms | 3.1 MB | |||
| official-nightly | ✋ | 31 ms | 57.1 MB | |||
| official | ✋ | 32 ms | 66.3 MB | |||
| official-v4.28.0 | ✋ | 38 ms | 71.1 MB | |||
| lean4lean | ✋ | 58 ms | 89.2 MB | |||
| rpylean | ✋ | 2 ms | 7.2 MB | |||
| mini | ✋ | 38 ms | 70.3 MB | |||
| always-decline | 🚫 | 1 ms | 2.8 MB | |||
| always-reject | ✋ | 1 ms | 2.8 MB | |||
| parse-only | 👍 | 37 ms | 70.0 MB | |||
| always-accept | 👍 | 1 ms | 2.8 MB |