Elm Exactly

TheoremfmLookup_fmPlus

StandardElmMech/Mod/Properties.lean:50, Finite maps · tactic proof

Statement

theorem fmLookup_fmPlus {β : Type} (f g : List (String × β)) (a : String) :
    fmLookup (fmPlus f g) a = match fmLookup g a with
      | some x => some x
      | none => fmLookup f a

Proof

by
  unfold fmPlus
  rw [fmLookup_append]
  cases h : fmLookup g a with
  | some x => rfl
  | none =>
    have hg := (fmLookup_none_iff g a).mp h
    have := fmLookup_filter f (fun k => !(g.any fun q => q.1 == k)) a
    simp only [hg, Bool.not_false, ite_true] at this
    exact this

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

Theorems it uses

Used by

In StandardElmMech/Mod/Properties.lean: The frame lemmas (a module's derivation reads the basis only at the modules it imports) and Btest_agrees.

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.