Elm Exactly

TheoremelProgram_inv

StandardElmMech/Stat/Refusals.lean:25, Inversion of the rules of Chapter 9 · tactic proof

Statement

theorem elProgram_inv {B : SBasis} {ms : List BModule} {τ : Ty} {PE : PortEnv}
    (h : ElProgram B ms τ PE) :
    ∃ m rest B' E, ms = m :: rest ∧ PrincipalModDer B m B' E ∧
      (rest = [] → MainOK E) ∧ (rest ≠ [] → ∃ τ' PE', ElProgram (B.plus B') rest τ' PE')

Proof

by
  cases h with
  | r_p_stat_module hd _ hne hrest => exact ⟨_, _, _, _, rfl, hd, fun h => absurd h hne, fun _ => ⟨_, _, hrest⟩⟩
  | r_p_stat_main_program hd _ hm hb hp =>
    exact ⟨_, _, _, _, rfl, hd, fun _ => ⟨_, hm, .inl ⟨_, _, _, hb, hp⟩⟩, fun h => absurd rfl h⟩
  | r_p_stat_main_view hd _ hm hv =>
    exact ⟨_, _, _, _, rfl, hd, fun _ => ⟨_, hm, .inr ⟨_, hv⟩⟩, fun h => absurd rfl h⟩

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

Rules of the book it uses

Used by

In StandardElmMech/Stat/Refusals.lean: Refusals (milestone 9d): inversion of Chapter 9's rules, and the lemmas that turn "no derivation checks", "no derivation meets the further restrictions" or "no derivation gives main a Chapter 9 type" into ¬ LegalProgram, with no hypothesis about principality.

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.