Theoremnot_legal_of_typesFailB
Statement
theorem not_legal_of_typesFailB {B : SBasis} {sp : Src.SProgram} (h : typesFailB B sp = true) :
¬ LegalProgram B spProof
by
unfold typesFailB at h
split at h
· rename_i m rest hms
split at h
· rename_i C0 d hC hd
simp only [Bool.and_eq_true] at h
obtain ⟨⟨hfix, hun⟩, hr⟩ := h
refine not_legal_of_noDeriv hms ?_
intro a he
have hC' : importCtx B a.imports = some C0 := by rw [imports_erase he]; exact hC
obtain ⟨ad, hb, had⟩ := body_erase he hd
obtain ⟨hU, hT⟩ := importCtx_UT hC
have hI := inv_base B (fcol B.T) C0 _ hU hT hun
have hn := ref (col_fcol B hfix) rfl ad C0 hI (had ▸ hr)
unfold checkModule
rw [AModule.result_of_ctx hC']
unfold AModule.resultIn
simp [checkTopDecOpt, hb, hn]
· cases h
· cases hProved with tactics, which Lean expands into a proof term that its kernel checks.
Theorems it uses
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.