Elm Exactly

TheoremelProgram_main

StandardElmMech/Stat/Legal.lean:62, The conditions of Chapter 9, decided · tactic proof

The last step of a program: its main module's derivation gives main a type by one of the two rules.

Statement

theorem elProgram_main {B : SBasis} {m : BModule} {B' : SBasis} {E : Env} {τ : Ty}
    (hd : PrincipalModDer B m B' E) (hp : PortsDisjoint B B') (hm : mainTy E = some τ) :
    ElProgram B [m] τ (B.plus B').PE

Proof

by
  unfold mainTy at hm
  split at hm
  · rename_i σ hσ
    split at hm
    · rename_i τ1 τ2 τ3 t hb
      split at hm
      · rename_i hc
        obtain ⟨rfl, hpt⟩ := hc
        cases hm
        exact .r_p_stat_main_program hd hp hσ hb (portB_sound _ hpt)
      · obtain ⟨τ0, h1, rfl⟩ := viewTy_sound hm
        exact .r_p_stat_main_view hd hp hσ h1
    · obtain ⟨τ0, h1, rfl⟩ := viewTy_sound hm
      exact .r_p_stat_main_view hd hp hσ h1
  · cases hm

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/Legal.lean: The master theorems: a program whose inferred derivation checks, meets the further restrictions and gives main a Chapter 9 type is legal, under D11 (legal_of_infer1, legal_of_infer).

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.