Elm Exactly

TheoremexposeItem_sk

StandardElmMech/Stat/RefuseScope.lean:1556, The skeleton of a module's interface is the same in every derivation · tactic proof

Statement

theorem exposeItem_sk {E : Env} {T : FMap String SkVE}
    (hT : ∀ c, FMap.find? (FMap.mapV E.TE skS) c = FMap.find? T c) (it : BItem) (I : IEnv)
    (h : exposeItem E it = some I) : exposeItemSk T it = some (skI I)

Proof

by
  cases it with
  | var x =>
    simp only [exposeItem] at h
    cases hx : FMap.find? E.VE x with
    | none => rw [hx] at h; cases h
    | some b =>
      rw [hx] at h
      simp only [Option.map_some, Option.some.injEq] at h
      subst h
      rfl
  | op o => simp [exposeItem] at h
  | ty c =>
    simp only [exposeItem] at h
    have hc := hT c
    rw [find?_mapV] at hc
    cases hx : FMap.find? E.TE c with
    | none => rw [hx] at h; cases h
    | some st =>
      rw [hx] at h hc
      simp only [Option.map_some, Option.some.injEq] at h
      subst h
      simp only [exposeItemSk, ← hc, Option.map_some, skI, keys_ofStatusV]
      rfl
  | tyAll c =>
    simp only [exposeItem] at h
    have hc := hT c
    rw [find?_mapV] at hc
    cases hx : FMap.find? E.TE c with
    | none => rw [hx] at h; cases h
    | some st =>
      rw [hx] at h hc
      simp only [Option.map_some, Option.some.injEq] at h
      subst h
      simp only [exposeItemSk, ← hc, Option.map_some, skI, skS, keys_mapV]
      rfl

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

Theorems it uses

In StandardElmMech/Stat/RefuseScope.lean: Refusals by scope, constructor arity and imports, for one module and for a module after a helper (scopeFailB).

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.