Elm Exactly

TheoremmainKind_view_iff

StandardElmMech/Stat/Pipeline.lean:248, Payload types and `main` · tactic proof

Statement

theorem mainKind_view_iff (σ : Scheme) (π : Eff.PTy) :
    mainKind σ = some (.view, π) ↔ π = .unit ∧
      (¬ ∃ τ1 τ2 τ3, σ.body = .con [τ1, τ2, τ3] tProgram) ∧ ∃ τ, dflt σ = .con [τ] tNode

Proof

by
  unfold mainKind
  constructor
  · intro h
    split at h
    · rename_i τ1 τ2 τ3 t hb
      split at h
      · rename_i ht
        cases toPTy τ1 <;> simp at h
      · rename_i ht
        split at h
        · rename_i τ t' hd
          split at h
          · rename_i ht'
            simp only [Option.some.injEq, Prod.mk.injEq] at h
            obtain ⟨-, rfl⟩ := h
            refine ⟨rfl, ?_, τ, ht' ▸ hd⟩
            rintro ⟨τ1', τ2', τ3', hb'⟩
            rw [hb] at hb'
            cases hb'
            exact ht rfl
          · cases h
        · cases h
    · rename_i hb
      split at h
      · rename_i τ t' hd
        split at h
        · rename_i ht'
          simp only [Option.some.injEq, Prod.mk.injEq] at h
          obtain ⟨-, rfl⟩ := h
          refine ⟨rfl, ?_, τ, ht' ▸ hd⟩
          rintro ⟨τ1', τ2', τ3', hb'⟩
          exact hb τ1' τ2' τ3' tProgram hb'
        · cases h
      · cases h
  · rintro ⟨rfl, hnp, τ, hd⟩
    split
    · rename_i τ1 τ2 τ3 t hb
      split
      · rename_i ht
        exact absurd ⟨τ1, τ2, τ3, ht ▸ hb⟩ hnp
      · rw [hd]; simp
    · rw [hd]; simp

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

Used by

In StandardElmMech/Stat/Pipeline.lean: SpecOf, DynOf (in Lib.Btest for a view, Mod.Btest [] for a worker: dynBasis), ProgramSem (r:p-program), D11For; copy names, payload types and main (copyName_inj, toPTy_isSome_iff, mainKind_worker_iff, mainKind_view_iff); the pipeline theorems (specOf_of_endToEnd, programSem_of_legal).

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.