AFTD Auto-Formalizing Theoretical Domains

parity_game_attractor

def

A game on a finite vertex type V is given by own : V → Bool (own v = true means Even owns v, false means Odd owns v), E : V → V → Bool (E v w = true means there is an edge from v to w) and prio : V → ℕ (the priority of each vertex). A player is a Boolean: true is Even, false is Odd. parity_game_attractor own E pl U (arguments in this order: owner map, edge relation, player, target set) is the finite set of vertices obtained from U by applying |V| times (|V| = the number of vertices) the one-step operator X ↦ X ∪ {v : (own v = pl and some w with E v w = true lies in X) or (own v ≠ pl and every w with E v w = true lies in X)}. This is stage |V| of the inductive definition of the pl-attractor of U (stage 0 is U, stage k+1 adds the vertices of player pl with a successor in stage k and the vertices of the other player all of whose successors are in stage k); the stages increase and are stationary from stage |V| on, so it is their union.

Statement

def parity_game_attractor {V : Type} [Fintype V] [DecidableEq V] (own : V → Bool)
    (E : V → V → Bool) (pl : Bool) (U : Finset V) : Finset V
Defined in
arXiv:2511.03752 (Attractors Is All You Need: Parity Games In Polynomial Time), Section 2 (attractor set, as stage |V| of the inductive definition)
Verified
19 Nov 2026
Axioms
none listed
Used by 5
  • parity_game_aprimeA game on a finite vertex type V is given by own : V → Bool (own v = true means Even owns v, false means Odd owns v), E : V → V → Bool (E…
  • parity_game_peel_seqA game on a finite vertex type V is given by own : V → Bool (own v = true means Even owns v, false means Odd owns v), E : V → V → Bool (E…
  • parity_game_astarA game on a finite vertex type V is given by own : V → Bool (own v = true means Even owns v, false means Odd owns v), E : V → V → Bool (E…
  • parity_game_peel_claimed_dominion_counterexampleConsider the parity game on the four vertices 0, 1, 2, 3 in which Even owns vertices 0 and 1, Odd owns vertices 2 and 3, the priorities…
  • parity_game_attractor_supersetThe attractor of a set U of vertices, for either player, contains U.

Read back from the Lean

Given a finite type V with decidable equality, a vertex ownership function own : V → Bool, a directed edge relation E : V → V → Bool, a player pl : Bool, and a subset U : Finset V, parity_game_attractor own E pl U is defined as the result of iterating Fintype.card V times, starting from U, the one-step attractor operator. The one-step operator maps a set X : Finset V to the union of X and all vertices v : V such that either: 1. own v = pl, and there exists some w : V such that E v w = true and w ∈ X; or 2. own v ≠ pl, and for all w : V, if E v w = true, then w ∈ X.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The attractor of a vertex set `U` for player `pl` (`true` = Even, `false` = Odd) in the game with owner map `own` and edge relation `E`: the `|V|`-th stage of the usual inductive definition, at which the increasing stages have become stationary. -/
def parity_game_attractor {V : Type} [Fintype V] [DecidableEq V] (own : V → Bool)
    (E : V → V → Bool) (pl : Bool) (U : Finset V) : Finset V :=
  (fun X : Finset V => X ∪ Finset.univ.filter (fun v =>
      (own v = pl ∧ ∃ w, E v w = true ∧ w ∈ X) ∨ (own v ≠ pl ∧ ∀ w, E v w = true → w ∈ X)))^[Fintype.card V] U
See it in the graphDiscuss this resultChallenge it