Elm Exactly

Theoremmem_next_pending

StandardElmMech/Stat/CopyLoop.lean:161, One round · tactic proof

Statement

theorem mem_next_pending {gid : Nat} {rs : List (Assignment × Spec (List D.Def))} {b : Assignment} :
    b ∈ ((rs.flatMap (·.2.reqs)).filter (·.1 == gid)).map (·.2) ↔ ∃ p ∈ rs, ∃ r ∈ p.2.reqs, r.1 = gid ∧ r.2 = b

Proof

by
  simp only [List.mem_map, List.mem_filter, List.mem_flatMap, beq_iff_eq]
  constructor
  · rintro ⟨r, ⟨⟨p, hp, hr⟩, hg⟩, rfl⟩; exact ⟨p, hp, r, hr, hg, rfl⟩
  · rintro ⟨p, hp, r, hr, hg, rfl⟩; exact ⟨r, ⟨⟨p, hp, hr⟩, hg⟩, rfl⟩

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

Used by

In StandardElmMech/Stat/CopyLoop.lean: The copy loop terminates within 2^k + 1 rounds, makes the least set of copies closed under requests, at most 2^k (copyLoop_fuel, copyLoop_least, copies_le_pow).

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.