Theoremvb_not_refuted
Statement
theorem vb_not_refuted {C' : Ctx} (hL : ∀ lc, LookSim f C' A lc) (hU : C'.U = []) :
∀ avb : AValBind, checkValBind C' avb = true → vbRefuted A avb.erase = false
| .var x ann τ e rest, h => by
simp only [checkValBind, Bool.and_eq_true] at h
obtain ⟨⟨⟨hann, _⟩, _⟩, hrest⟩Proof
h
simp only [AValBind.erase, vbRefuted_var, Bool.or_eq_false_iff]
constructor
· cases ann with
| none => rfl
| some p =>
obtain ⟨ty, U'⟩ := p
simp only [Option.map_some]
simp only [checkAnn, Bool.and_eq_true, decide_eq_true_eq] at hann
obtain ⟨⟨hnew, hel⟩, _⟩ := hann
obtain ⟨U'', hU'', hs⟩ := ann_sim hcol hAU hL hU hnew hel
cases hc : annFails A ty with
| false => rfl
| true =>
have := List.all_eq_true.mp hc U'' hU''
simp [hs] at this
· cases rest with
| none => rfl
| some r =>
simp only [AValBind.eraseOpt, Option.map_some, Option.getD_some]
exact vb_not_refuted hL hU r hrest
| .pat _ _, _ => by simp [AValBind.erase, vbRefuted]Proved by a term, which Lean's kernel checks directly.
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.