Elm Exactly

Theoremfind?_mem_vals

StandardElmMech/Stat/RefuseTypes.lean:836, Type declarations · term proof

Statement

theorem find?_mem_vals {K V : Type} [DecidableEq K] (k : K) (v : V) :
    ∀ l : FMap K V, FMap.find? l k = some v → v ∈ FMap.vals l
  | [], h => by cases h
  | (k', v') :: rest, h => by
    simp only [FMap.find?] at h
    simp only [FMap.vals, List.map_cons, List.mem_cons]
    split at h
    · cases h; exact .inl rfl
    · exact .inr (find?_mem_vals k v rest h)

Proof

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

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.