Elm Exactly

Theoremcon_rows_length

StandardElmMech/Stat/PatternsProof.lean:685, Small facts the induction uses · tactic proof

Rows typed at τ :: τr whose head is constructor k have as many arguments as k takes.

Statement

theorem con_rows_length {tbl : ConTable} {τ : Ty} {τr : List Ty} {k : String} {as : List Ty}
    (has : argTys tbl τ k = some as) {P : List (List PatN)} (hP : ∀ r ∈ P, PTypedList tbl (τ :: τr) r) :
    ∀ r ∈ P, ∀ args rest, r = .con k args :: rest → args.length = as.length

Proof

by
  intro r hr args rest he
  subst he
  obtain ⟨_, as', has', hargs⟩ := ptyped_con (hP _ hr).1
  rw [has] at has'
  cases has'
  exact (PTypedList.length_eq hargs).symm

Proved 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.