Elm Exactly

Theoremlookup_encFields_other

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

Statement

theorem lookup_encFields_other {l : String} : ∀ {fs : PFields} {r : List (String × Val)} {o : BObj},
    encFields fs r = some o → l ∉ fs.labels → o.lookup l = none
  | .nil, _, o, h, _ => by simp [encFields] at h; subst h; rfl
  | .cons l' τ rest, r, o, h, hl => by
    simp only [PFields.labels, List.mem_cons, not_or] at hl
    simp only [encFields] at h
    split at h
    · split at h
      · rename_i jl orest _ _
        simp only [Option.some.injEq] at h; subst h
        have : (l' == l) = false

Proof

by simpa using Ne.symm hl.1
        simp only [BObj.lookup, this]
        exact lookup_encFields_other ‹_› hl.2
      · cases h
    · cases h

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

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.