TheoremmainScheme_some
Statement
theorem mainScheme_some : ∀ {rs : List (SBasis × SBasis × Env)} {σ : Scheme}, mainScheme rs = some σ →
∃ rs0 B B' E, rs = rs0 ++ [(B, B', E)] ∧ E.VE.find? "main" = some (σ, .v)
| [], _, h => by cases h
| [(B, B', E)], σ, h => by
simp only [mainScheme] at h
split at h
· rename_i σ' h'; cases h; exact ⟨[], B, B', E, rfl, h'⟩
· cases h
| x :: y :: rest, σ, h => by
have h' : mainScheme (y :: rest) = some σProof
h
obtain ⟨rs0, B, B', E, e, hf⟩ := mainScheme_some h'
exact ⟨x :: rs0, B, B', E, by rw [e]; rfl, hf⟩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.