Elm Exactly

TheoremevTopDec_sound_l

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

Statement

theorem evTopDec_sound_l {o : Oracle} {n : Nat} : ∀ {E : Env} {td : TopDec} {k : Nat} {I : Interface}
    {l : Log} {k' : Nat}, evTopDec o n E td k = ⟨.value I, l, k'⟩ → EvalTopDecL E td I l
  | E, .val vb, k, I, l, k', h => by
    simp only [evTopDec] at h
    split at h
    · simp at h
    · rename_i hne
      split at h
      · rename_i VE l1 k1 h1
        split at h
        · rename_i vs l2 k2 h2
          simp only [Res.mk.injEq, Outcome.value.injEq] at h
          obtain ⟨rfl, rfl, rfl⟩

Proof

h
          exact .r_dm_topdec_val_l E vb VE vs l1 l2 hne (evValBind_sound_l h1) (evForces_sound_l h2)
        all_goals simp at h
      all_goals simp at h
  | E, .type db, k, I, l, k', h => by
    simp only [evTopDec, Res.mk.injEq, Outcome.value.injEq] at h
    obtain ⟨rfl, rfl, rfl⟩ := h
    exact .r_dm_topdec_type_l E db _ _ (evDatBind_sound db)
  | E, .alias tb, k, I, l, k', h => by
    simp only [evTopDec, Res.mk.injEq, Outcome.value.injEq] at h
    obtain ⟨rfl, rfl, rfl⟩ := h
    exact .r_dm_topdec_alias_l E tb _ _ (evTypBind_sound tb)
  | E, .port x .out τ, k, I, l, k', h => by
    simp only [evTopDec, Res.mk.injEq, Outcome.value.injEq] at h
    obtain ⟨rfl, rfl, rfl⟩ := h
    exact .r_dm_topdec_port_out_l E x τ
  | E, .port x .inn τ, k, I, l, k', h => by
    simp only [evTopDec, Res.mk.injEq, Outcome.value.injEq] at h
    obtain ⟨rfl, rfl, rfl⟩ := h
    exact .r_dm_topdec_port_in_l E x τ
  | E, .seq t1 t2, k, I, l, k', h => by
    simp only [evTopDec] at h
    split at h
    · rename_i I1 l1 k1 h1
      split at h
      · rename_i I2 l2 k2 h2
        simp only [Res.mk.injEq, Outcome.value.injEq] at h
        obtain ⟨rfl, rfl, rfl⟩ := h
        have d1 := evTopDec_sound_l h1
        obtain ⟨RA1, CE1, VE1⟩ := I1
        exact .r_dm_topdec_seq_l E t1 t2 RA1 CE1 VE1 I2 l1 l2 d1 (evTopDec_sound_l h2)
      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.