Elm Exactly

Theoremnot_legal_of_noDeriv2

StandardElmMech/Stat/Refusals.lean:65, The refusals · tactic proof

The second module has no derivation, whatever the derivation of the first.

Statement

theorem not_legal_of_noDeriv2 {B : SBasis} {sp : SProgram} {m1 m2 : BModule} {rest : List BModule}
    (hms : (Src.deriveProgram (Src.canonOrder sp)).modules = m1 :: m2 :: rest)
    (h : ∀ a1 B' E, a1.erase = m1 → checkModule B a1 = true → a1.result B = some (B', E) →
      NoDeriv (B.plus B') m2) :
    ¬ LegalProgram B sp

Proof

by
  rintro ⟨_, τ, PE, hel⟩
  rw [hms] at hel
  obtain ⟨m', rest', B', E, hc, hd, _, hrest⟩ := elProgram_inv hel
  cases hc
  obtain ⟨a1, he1, hck1, hr1, _⟩ := principalModDer_check hd
  obtain ⟨τ', PE', hel2⟩ := hrest (by simp)
  obtain ⟨m'', _, B'', E'', hc2, hd2, _, _⟩ := elProgram_inv hel2
  cases hc2
  obtain ⟨a2, he2, hck2, _, _⟩ := principalModDer_check hd2
  rw [h a1 B' E he1 hck1 hr1 a2 he2] at hck2
  cases hck2

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

Theorems 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.