Elm Exactly

TheoremfmLookup_append'

StandardElmMech/Eff/MkObj.lean:128, Lookups through `mkObj` · term proof

Statement

theorem fmLookup_append' (k : String) : ∀ (l1 l2 : List Bind),
    fmLookup (l1 ++ l2) k = match fmLookup l1 k with
      | some v => some v
      | none => fmLookup l2 k
  | [], l2 => rfl
  | (a, v) :: l1, l2 => by
    simp only [List.cons_append, fmLookup]
    split
    · rfl
    · exact fmLookup_append' k l1 l2

Proof

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

Used by

In StandardElmMech/Eff/MkObj.lean: A76: mkObj ignores the order of distinct keys (a76_mkObj_perm), a lookup finds the last binding (lookup_mkObj), and decoding ignores keys outside the record type (a76_dec_extra_key).

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.