Elm Exactly

TheoremanyOpt_true

StandardElmMech/Stat/PatternsProof.lean:545, Small facts the induction uses · term proof

Statement

theorem anyOpt_true {α : Type} {g : α → Option Bool} : ∀ {xs : List α}, useful.anyOpt xs g = some true →
    ∃ x ∈ xs, g x = some true
  | [], h => by simp [useful.anyOpt] at h
  | x :: xs, h => by
    simp only [useful.anyOpt] at h
    split at h
    · rename_i hx; exact ⟨x, List.mem_cons_self, hx⟩
    · obtain ⟨y, hy, hgy⟩

Proof

anyOpt_true h; exact ⟨y, List.mem_cons_of_mem _ hy, hgy⟩
    · cases h

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

Used by

In StandardElmMech/Stat/PatternsProof.lean: The pattern decider is correct: every type is inhabited (inhabited), useful_spec, exhDec_sound, irrDec_sound.

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.