Theoremtypes_top
Statement
theorem types_top {a : ATopDec} {C : Ctx} {E : Env} {PE : PortEnv} {db : Option BDatBind} {tbs : List BTypBind}
(he : a.erase = .types db tbs) (hI : Inv B f A C) (hn : typesNodeOK A db tbs = true)
(hH : aliasesRefuted A tbs = true ∨ aliasesAllOK A tbs = true) (h : checkTopDec C a = some (E, PE)) :
aliasesRefuted A tbs = false ∧ Inv B f A (C.oplusE E) ∧ consOK A db = trueProof
by
simp only [typesNodeOK, Bool.and_eq_true, decide_eq_true_eq] at hn
cases a with
| types TE VE db'' tbs'' =>
simp only [ATopDec.erase, BTopDec.types.injEq] at he
obtain ⟨rfl, rfl⟩ := he
simp only [checkTopDec] at h
split at h
· rename_i hc
simp only [Option.some.injEq, Prod.mk.injEq] at h
obtain ⟨rfl, rfl⟩ := h
have hl := types_leaf hcol hAU (post := []) hI (by simpa using hn.1.1) hn.1.2 (by simpa using hn.2)
(by simpa using hH) hc
refine ⟨?_, ⟨fun lc => lookSim_of_same (sameTy_oplusE_types C _ _) (hl.2.2.1 lc), hI.U,
fun t ht => T_oplusE C _ t (hI.T t ht)⟩, hl.2.2.2⟩
cases hr : aliasesRefuted A tbs'' with
| false => rfl
| true => have := hl.1 (by simpa using hr); simp [aliasesRefuted] at this
· cases h
| value _ _ | port _ _ _ | seq _ _ => simp [ATopDec.erase] at heProved with tactics, which Lean expands into a proof term that its kernel checks.
Theorems it uses
Used by
In StandardElmMech/Stat/RefuseTypes.lean: Refusals by type expressions (aliases, constructor arguments, annotations, ports) and by the type of main (typesFailB, mainFailB), for every choice of generated names and variable sorts.
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.