Elm Exactly

TheoremportShapeB_map

StandardElmMech/Stat/RefuseTypes.lean:1129, Annotations and ports · tactic proof

Statement

theorem portShapeB_map {f : TyName → TyName} (hfix : ∀ t ∈ fixedNames, f t = t) (τ : Ty)
    (h : portShapeB τ = true) : portShapeB (mapTy f τ) = true

Proof

by
  unfold portShapeB at h
  split at h
  · rename_i τ' α t
    have hm : mapTy f (.fn τ' (.con [.var α] t)) = .fn (mapTy f τ') (.con [.var α] (f t)) := by
      simp [mapTy, mapTys]
    rw [hm]
    simp only [Bool.or_eq_true, Bool.and_eq_true, decide_eq_true_eq] at h
    rcases h with ⟨rfl, hp⟩ | h
    · simp [portShapeB, hfix tCmd (by simp [fixedNames]), portB_map hfix τ' hp]
    · split at h
      · rename_i τ'' α'
        simp only [Bool.and_eq_true, decide_eq_true_eq] at h
        obtain ⟨⟨rfl, rfl⟩, hp⟩ := h
        simp [portShapeB, mapTy, hfix tSub (by simp [fixedNames]), portB_map hfix τ'' hp]
      · cases h
  · cases h

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.