Elm Exactly

TheoremplusB_iff

StandardElmMech/Src/Graph.lean:209, Facts about growing · tactic proof

Statement

theorem plusB_iff (n : Nat) (r : Nat → Nat → Bool) (i j : Nat) : plusB n r i j = true ↔ Plus n r i j

Proof

by
  unfold plusB
  rw [List.contains_iff_mem]
  constructor
  · intro h
    exact iter_sound n r i n (start n r i)
      (fun j hj => by obtain ⟨hj, hi, hr⟩ := mem_start.mp hj; exact .step hi hj hr) j h
  · intro h
    obtain ⟨m, hm, hr, hj | hp⟩ := h.first
    · subst hj; exact start_sub n r i m (mem_start.mpr ⟨hm, h.lt.1, hr⟩)
    · exact reach_closed (plusSet_closed n r i) hp (start_sub n r i m (mem_start.mpr ⟨hm, h.lt.1, hr⟩))

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

Theorems it uses

Used by

In StandardElmMech/Src/Graph.lean: Reachability on graphs over 0 .. n-1 (Plus, Reach) and its decider, proved correct (plusB_iff, reachB_iff).

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.