Theoremcovers_mkCon_iff
Statement
theorem covers_mkCon_iff (k k' : String) (args : List PatN) (cs : List Inh) :
(PatN.con k args).covers (Inh.mkCon k' cs) ↔ k = k' ∧ args.length = cs.length ∧ RowCovers args csProof
by
rw [covers_con_iff]
have hroot : (Inh.mkCon k' cs).f [] = some (.con k' cs.length) := rfl
rw [hroot]
simp only [Option.some.injEq, INode.con.injEq]
constructor
· rintro ⟨⟨hk, hl⟩, hr⟩
rw [children_mkCon k' cs _ hl.symm] at hr
exact ⟨hk.symm, hl.symm, hr⟩
· rintro ⟨hk, hl, hr⟩
refine ⟨⟨hk.symm, hl.symm⟩, ?_⟩
rw [children_mkCon k' cs _ hl]
exact hrProved with tactics, which Lean expands into a proof term that its kernel checks.
Theorems it uses
Used by
In StandardElmMech/Stat/PatternsProof.lean: The pattern decider is correct: every type is inhabited (inhabited), useful_spec, exhDec_sound, irrDec_sound.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.