Elm Exactly

TheoremargTys_ctorsAt

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

Statement

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

Proof

by
  unfold argTys at h
  split at h
  · rename_i args t
    split at h
    · rename_i k' as0 xs t' hf
      have hm := List.mem_of_find?_eq_some hf
      have hk := List.find?_some hf
      simp only [beq_iff_eq] at hk
      subst hk
      unfold ctorsAt
      refine List.mem_filterMap.mpr ⟨(k', as0, .con xs t'), hm, ?_⟩
      have : argTys tbl (.con args t) k' = some as := by
        unfold argTys; simp only [hf]; exact h
      simp [this]
    · cases h
  · 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.