Elm Exactly

Theoremmem_unionL

StandardElmMech/Stat/RefuseTypes.lean:258, Simulation of the elaboration of type expressions · tactic proof

Statement

theorem mem_unionL {α : Type} [DecidableEq α] {x : α} {A B : List α} : x ∈ unionL A B ↔ x ∈ A ∨ x ∈ B

Proof

by
  unfold unionL diffL
  simp only [List.mem_append, List.mem_filter, Bool.not_eq_true', decide_eq_false_iff_not]
  constructor
  · rintro (h | ⟨h, _⟩)
    · exact .inl h
    · exact .inr h
  · rintro (h | h)
    · exact .inl h
    · by_cases hA : x ∈ A
      · exact .inl hA
      · exact .inr ⟨h, hA⟩

Proved with tactics, which Lean expands into a proof term that its kernel checks.

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.