Elm Exactly

Theorembases_of_progResults

StandardElmMech/Stat/Pipeline.lean:344, The pipeline · term proof

Statement

theorem bases_of_progResults : ∀ {B : SBasis} {a : AProgram} {rs : List (SBasis × SBasis × Env)},
    progResults B a = some rs → AProgram.bases B a = some (rs.map (·.1))
  | _, [], rs, h => by simp only [progResults, Option.some.injEq] at h; subst h; rfl
  | B, m :: rest, rs, h => by
    simp only [progResults] at h
    cases hm : m.result B with
    | none => rw [hm] at h; cases h
    | some p =>
      obtain ⟨B', E⟩

Proof

p
      simp only [hm] at h
      cases hr : progResults (B.plus B') rest with
      | none => simp [hr] at h
      | some rs' =>
        simp only [hr, Option.map_some, Option.some.injEq] at h
        subst h
        simp [AProgram.bases, hm, bases_of_progResults hr]

Proved by a term, which Lean's kernel checks directly.

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.