TheoremprogResults_length
Statement
theorem progResults_length : ∀ {B : SBasis} {a : AProgram} {rs : List (SBasis × SBasis × Env)},
progResults B a = some rs → rs.length = a.length
| _, [], 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 => simp [hm] at 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 [progResults_length hr]Proved by a term, which Lean's kernel checks directly.
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.