Elm Exactly

Theoremnot_mainOK

StandardElmMech/Stat/RefuseTypes.lean:1424, The type of `main` · tactic proof

Statement

theorem not_mainOK {E : Env} (h : ∃ σ st, FMap.find? E.VE "main" = some (σ, st) ∧ badHeadB σ.body = true) :
    ¬ MainOK E

Proof

by
  rintro ⟨σ, hf, hm⟩
  obtain ⟨σ', st, hf', hb⟩ := h
  rw [hf] at hf'
  simp only [Option.some.injEq, Prod.mk.injEq] at hf'
  obtain ⟨rfl, _⟩ := hf'
  rcases hm with ⟨τ1, τ2, τ3, hb', _⟩ | ⟨τ, hd⟩
  · rw [hb'] at hb; simp [badHeadB] at hb
  · have key : ∀ S : Subst, (S.apply σ.body).getD σ.body ≠ .con [τ] tNode := fun S e => by
      have := badHead_apply S σ.body hb
      rw [e] at this
      simp [badHeadB] at this
    unfold dflt at hd
    exact key _ hd

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

Theorems it uses

Used by

In StandardElmMech/Stat/RefuseTypes.lean: Refusals by type expressions (aliases, constructor arguments, annotations, ports) and by the type of main (typesFailB, mainFailB), for every choice of generated names and variable sorts.

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.