Elm Exactly

TheoremmainKind_worker_iff

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

Statement

theorem mainKind_worker_iff (σ : Scheme) (π : Eff.PTy) :
    mainKind σ = some (.worker, π) ↔
      ∃ τ1 τ2 τ3, σ.body = .con [τ1, τ2, τ3] tProgram ∧ Port τ1 ∧ toPTy τ1 = some π

Proof

by
  unfold mainKind
  constructor
  · intro h
    split at h
    · rename_i τ1 τ2 τ3 t hb
      split at h
      · rename_i ht
        subst ht
        cases hp : toPTy τ1 with
        | none => rw [hp] at h; cases h
        | some π' =>
          rw [hp] at h
          simp only [Option.map_some, Option.some.injEq, Prod.mk.injEq] at h
          obtain ⟨-, rfl⟩ := h
          exact ⟨τ1, τ2, τ3, hb, port_of_toPTy hp, hp⟩
      · split at h
        · split at h <;> simp at h
        · cases h
    · split at h
      · split at h <;> simp at h
      · cases h
  · rintro ⟨τ1, τ2, τ3, hb, -, hp⟩
    rw [hb]
    simp [hp]

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

Theorems it uses

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.