Elm Exactly

TheorembadHead_map

StandardElmMech/Stat/RefuseTypes.lean:1410, The type of `main` · tactic proof

Statement

theorem badHead_map {f : TyName → TyName} (hP : f tProgram = tProgram) (hN : f tNode = tNode) (τ : Ty)
    (h : badHeadB (mapTy f τ) = true) : badHeadB τ = true

Proof

by
  cases τ with
  | var a => simp [mapTy, badHeadB] at h
  | fn a b => rfl
  | record ρ tl => rfl
  | con as t =>
    simp only [mapTy, mapTys_eq, badHeadB, List.length_map, Bool.and_eq_true, Bool.not_eq_true'] at h ⊢
    by_cases hp : t = tProgram
    · subst hp; rw [hP] at h; simpa using h
    · by_cases hn : t = tNode
      · subst hn; rw [hN] at h; simpa using h
      · simp [hp, hn]

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

Theorems it uses

Used by

In StandardElmMech/Stat/RefuseTypes.lean: Refusals by type expressions (aliases, constructor arguments, annotations, ports) and by the type of main (typesFailB, mainFailB), for every choice of generated names and variable sorts.

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.