Elm Exactly

TheoremreachIn_iff

StandardElmMech/Src/GroupingProof.lean:42, The reach table · tactic proof

Statement

theorem reachIn_iff {a b : Nat} (ha : a < n) : reachIn (reachTable n r) a b = true ↔ Reach n r a b

Proof

by
  unfold reachIn reachTable
  rw [List.getD_eq_getElem?_getD, List.getElem?_map, List.getElem?_range ha]
  simp only [Option.map_some, Option.getD_some, List.contains_cons]
  rw [Bool.or_eq_true, beq_iff_eq, ← plusB, plusB_iff]
  simp only [Reach]
  constructor
  · rintro (h | h)
    · exact .inl h.symm
    · exact .inr h
  · rintro (h | h)
    · exact .inl h.symm
    · exact .inr h

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

Theorems it uses

Used by

In StandardElmMech/Src/GroupingProof.lean: components_valid: the canonical grouping is one the book allows (ValidNumbering).

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.