Elm Exactly

TheoremctorsAt_argTys

StandardElmMech/Stat/PatternsProof.lean:153, A97: every type has an inhabitant · tactic proof

Statement

theorem ctorsAt_argTys {tbl : ConTable} {τ : Ty} {k : String} {as : List Ty} (h : (k, as) ∈ ctorsAt tbl τ) :
    argTys tbl τ k = some as

Proof

by
  unfold ctorsAt at h
  split at h
  · obtain ⟨c, _, hc⟩ := List.mem_filterMap.mp h
    cases hca : argTys tbl _ c.1 with
    | none => rw [hca] at hc; cases hc
    | some as' =>
      rw [hca] at hc
      simp only [Option.map_some, Option.some.injEq, Prod.mk.injEq] at hc
      obtain ⟨rfl, rfl⟩ := hc
      exact hca
  · cases h

Proved with tactics, which Lean expands into a proof term that its kernel checks.

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.