Test "bugs/quot-bad-type"
Expected: ✋ reject · Size: 4.2 KB · Lines: 73 · lean4export: 3.1.0 · Lean: 4.36.0 · 📄 Declaration
Proof of False from a forged quot declaration.
The export contains Eq and False from Init.Prelude, followed by a
quot record with name: Quot, kind: "type", and levelParams: [u]
whose type is forged to False instead of
∀ {α : Sort u}, (α → α → Prop) → Sort u. The theorem
inconsistent : False is then simply Quot.{0}.
A sound kernel must either check that each exported quot declaration
matches Lean's fixed quotient signatures (and that Eq is declared) or
synthesize the genuine Quot declarations itself rather than trusting the
exported type.
rpylean accepted this export because register_quotient only checked the
declaration name and W_Quotient.type_check only checked that the exported
type was a Sort.