Theoremfind?_map_key
Statement
theorem find?_map_key {K V W : Type} [DecidableEq K] (h : K × V → W) (k : K) :
∀ l : FMap K V, FMap.find? (l.map (fun p => (p.1, h p))) k = (FMap.find? l k).map (fun v => h (k, v))
| [] => rfl
| (k', v) :: rest => by
simp only [List.map_cons, FMap.find?]
split
· rename_i e; subst e; rfl
· exact find?_map_key h k restProof
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.