Elm Exactly

Theoremfind?_append

StandardElmMech/Stat/FMap.lean:44 · tactic proof

Statement

theorem find?_append (f g : FMap K V) (k : K) :
    find? (f ++ g) k = (find? f k).or (find? g k)

Proof

by
  induction f with
  | nil => simp [find?]
  | cons p r ih =>
    obtain ⟨k', v⟩ := p
    simp only [List.cons_append, find?]
    split <;> simp [ih]

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

Used by

In StandardElmMech/Stat/FMap.lean: Finite maps for the static semantics (association lists, first occurrence wins), with their lemmas.

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.