Elm Exactly

Theoremmem_keys_fieldOf

StandardElmMech/Eff/RoundTrip.lean:176, Lists and their values · tactic proof

Statement

theorem mem_keys_fieldOf {r : List (String × Val)} {l : String} (h : l ∈ r.map (·.1)) :
    ∃ v, fieldOf r l = some v

Proof

by
  induction r with
  | nil => simp at h
  | cons p r ih =>
    obtain ⟨k, w⟩ := p
    unfold fieldOf fmLookup
    by_cases hk : k = l
    · subst hk; simp
    · have : (k == l) = false := by simpa using hk
      simp only [this]
      simp only [List.map_cons, List.mem_cons] at h
      exact ih (h.resolve_left (Ne.symm hk))

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

Used by

In StandardElmMech/Eff/RoundTrip.lean: The round trip of encoding and decoding (roundtrip), except where A88 says otherwise (NoExc), under the named hypothesis FloatRoundTrip; the exceptions shown to be needed.

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.