Elm Exactly

TheoremelabPort_sound

StandardElmMech/Stat/CheckSound.lean:342, Modules · tactic proof

Statement

theorem elabPort_sound (C : Ctx) (x : Var) (ty : BTy) (U : List BVar) (E : Env) (PE : PortEnv)
    (h : elabPort C x ty U = some (E, PE)) : ElTopDec C (.port x ty) E PE

Proof

by
  unfold elabPort at h
  split at h
  · rename_i hn
    have hnew := newFor_of_newForB hn
    split at h
    · rename_i τ' α t hτ
      have hel := elabTy_sound _ _ _ hτ
      split at h
      · rename_i hc
        obtain ⟨rfl, hp⟩ := hc
        simp only [Option.some.injEq, Prod.mk.injEq] at h
        obtain ⟨rfl, rfl⟩ := h
        exact .r_sm_topdec_portout hnew hel rfl (portB_sound _ hp)
      · split at h
        · rename_i τ'' α'
          split at h
          · rename_i hc
            obtain ⟨rfl, rfl, hp⟩ := hc
            simp only [Option.some.injEq, Prod.mk.injEq] at h
            obtain ⟨rfl, rfl⟩ := h
            exact .r_sm_topdec_portin hnew hel rfl (portB_sound _ hp)
          · cases h
        · cases h
    · cases h
  · cases h

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

Rules of the book it uses

Theorems it uses

Used by

In StandardElmMech/Stat/CheckSound.lean: The checker is sound: a phrase that checks has a derivation by the rules of Chapters 4 and 5 (checkExp_sound, checkModule_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.