Elm Exactly

TheoremdefaultM_typed

StandardElmMech/Stat/PatternsProof.lean:668, Small facts the induction uses · term proof

Statement

theorem defaultM_typed {tbl : ConTable} {τ : Ty} {τr : List Ty} : ∀ (P : List (List PatN)),
    (∀ r ∈ P, PTypedList tbl (τ :: τr) r) → ∀ r ∈ defaultM P, PTypedList tbl τr r
  | [], _, r, hr => by simp [defaultM] at hr
  | r0 :: P, hP, r, hr => by
    have ih

Proof

defaultM_typed P (fun r h => hP r (List.mem_cons_of_mem _ h))
    have h0 := hP r0 List.mem_cons_self
    match r0, hr, h0 with
    | .wild :: rest, hr, h0 =>
      simp only [defaultM, List.mem_cons] at hr
      rcases hr with rfl | hr
      · exact h0.2
      · exact ih r hr
    | .den _ :: _, hr, _ => exact ih r (by simpa [defaultM] using hr)
    | .con _ _ :: _, hr, _ => exact ih r (by simpa [defaultM] using hr)
    | [], hr, _ => exact ih r (by simpa [defaultM] using hr)

Proved by a term, which Lean's kernel checks directly.

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.