Elm Exactly

TheoremforcedBadAt_sound

StandardElmMech/Stat/RefuseTypes.lean:1468, The type of `main` · term proof

Statement

theorem forcedBadAt_sound : ∀ (C : Ctx) (a : AAtExp), checkAtExp C a = true → forcedBadAt a.erase = true →
    badHeadB a.ty = true
  | _, .nil τ, h, _ => by
    simp only [checkAtExp] at h
    simp only [AAtExp.ty]
    unfold isListTy at h
    split at h
    · rename_i x t
      simp only [beq_iff_eq] at h
      subst h
      simp [badHeadB, tList, tProgram, tNode]
    · cases h
  | _, .unit, _, _ => by simp [AAtExp.ty, badHeadB, tUnitTy, tUnit, tProgram, tNode]
  | _, .tuple _ _ e3, _, _ => by
    simp only [AAtExp.ty]
    cases AExp.tyOpt e3 <;> simp [tupleTy, badHeadB, tTuple2, tTuple3, tProgram, tNode]
  | _, .record _, _, _ => by simp [AAtExp.ty, badHeadB]
  | C, .paren e, h, hf => by
    simp only [checkAtExp] at h
    simp only [AAtExp.erase, forcedBadAt] at hf
    simp only [AAtExp.ty]
    exact forcedBad_sound C e h hf
  | C, .letE d e, h, hf => by
    simp only [checkAtExp, Bool.and_eq_true] at h
    simp only [AAtExp.erase, forcedBadAt] at hf
    simp only [AAtExp.ty]
    exact forcedBad_sound _ e h.2 hf
  | _, .scon _ _, _, hf => by simp [AAtExp.erase, forcedBadAt] at hf
  | _, .var _ _ _, _, hf => by simp [AAtExp.erase, forcedBadAt] at hf
  | _, .con _ _ _, _, hf => by simp [AAtExp.erase, forcedBadAt] at hf
  | _, .op _ _ _, _, hf => by simp [AAtExp.erase, forcedBadAt] at hf
  | _, .update _ _ _ _, _, hf => by simp [AAtExp.erase, forcedBadAt] at hf

Proof

Proved by a term, which Lean's kernel checks directly.

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.