Elm Exactly

Theoremagrees_append

StandardElmMech/Complete.lean:161, Agreement of an oracle with a list of choices (for completeness, Completeness.lean) · tactic proof

Statement

theorem agrees_append {o : Oracle} {k : Nat} {L1 L2 : List Bool} (h : Agrees o k (L1 ++ L2)) :
    Agrees o k L1 ∧ Agrees o (k + L1.length) L2

Proof

by
  constructor
  · intro i hi
    have := h i (by simp; omega)
    rw [this, List.getElem_append_left hi]
  · intro i hi
    have := h (L1.length + i) (by simp; omega)
    rw [show k + L1.length + i = k + (L1.length + i) by omega, this]
    simp

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

Used by

In StandardElmMech/Complete.lean: The index of the next choice only grows (evExp_next and the others); Agrees; lemmas for the side conditions.

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.