Elm Exactly

TheoremevProgram_sound_l

StandardElmMech/Mod/Sound.lean:191 · term proof

Statement

theorem evProgram_sound_l {o : Oracle} {n : Nat} : ∀ {B : Basis} {p : List Module} {k : Nat} {v : Val}
    {l : Log} {k' : Nat}, evProgram o n B p k = ⟨.value v, l, k'⟩ → EvalProgramL B p v l
  | B, [], k, v, l, k', h => by simp [evProgram] at h
  | B, [m], k, v, l, k', h => by
    simp only [evProgram] at h
    split at h
    · rename_i B' VE l1 k1 h1
      split at h
      · rename_i w hw
        simp only [Res.mk.injEq, Outcome.value.injEq] at h
        obtain ⟨rfl, rfl, rfl⟩

Proof

h
        exact .r_p_dyn_main_l B m B' VE w l1 (evModule_sound_l h1) hw
      · simp at h
    all_goals simp at h
  | B, m :: m2 :: p, k, v, l, k', h => by
    simp only [evProgram] at h
    split at h
    · rename_i B' VE l1 k1 h1
      split at h
      · rename_i w l2 k2 h2
        simp only [Res.mk.injEq, Outcome.value.injEq] at h
        obtain ⟨rfl, rfl, rfl⟩ := h
        exact .r_p_dyn_module_l B m (m2 :: p) B' VE w l1 l2 (evModule_sound_l h1)
          (evProgram_sound_l h2) (by simp)
      all_goals simp at h
    all_goals simp at h

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

Rules of the book it uses

Theorems it uses

Used by

In StandardElmMech/Mod/Sound.lean: Its soundness.

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.