Elm Exactly

TheoremaliasDecls_eq

StandardElmMech/Src/DerivesTo.lean:232, Modules · term proof

Statement

theorem aliasDecls_eq : ∀ ds : List STopDec,
    (ds.flatMap fun d => match d with
      | .alias c _ t => [(c, t)]
      | _ => []) = (aliasesOf ds).map (fun a => (a.1, a.2.2))
  | [] => rfl
  | d :: ds => by
    have ih

Proof

aliasDecls_eq ds
    unfold aliasesOf at ih ⊢
    cases d <;> simp only [List.filterMap_cons, List.flatMap_cons, List.map_cons, List.nil_append,
      List.cons_append] <;> first | exact ih | (congr 1)

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

Used by

In StandardElmMech/Src/DerivesTo.lean: The derived forms as the book states them, a relation (DerivesE, DerivesTo), and derive_derivesTo.

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.