AFTD Auto-Formalizing Theoretical Domains

spider_update_centre

def

The function spider_update_centre updates centre status s given leg transition delta: if delta is inward, none maps to incoming, incoming maps to incoming, outgoing maps to free, free maps to free; if delta is outward, none maps to outgoing, incoming maps to free, outgoing maps to outgoing, free maps to free; if delta is free, s is unchanged.

Statement

def spider_update_centre (s : CentreStatus) (delta : SpiderLegEnd) : CentreStatus
Defined in
scout/2610-15145-nim-heaps-in-the-game-of-cycles-the-parity-conjecture-fails.md, Lemma 3.2
Verified
18 Oct 2026
Axioms
none listed
Built on 2
  • CentreStatusThe status of the central vertex in a spider state: none (no marked arcs incident), incoming (at least one incoming arc), outgoing (at…
  • SpiderLegEndThe end condition of an attached leg in a spider state is either free (no arc on the leg), inward (pointing towards the centre), or…
Used by 16
  • spider_gamma_rotate_three_short_legsFor any leg p, centre status and fuel, the value of (s;{p,1^in,1^out}) equals the value of (s;{1^in,1^out,p}): the leg p may be moved from…
  • spider_blocked_incoming_one_outwardFor the configuration κ₂ = (in;{(1,outward)}), the blocked family V^φ_κ₂(r) equals r xor 1 for every r ≥ 1 and both φ.
  • spider_blocked_incoming_one_outward_options_eqFor r ≥ 2, the raw options list generated by [(1, outward), (r, φ)] at fuel r + 2 with centre status incoming unfolds to the explicit list…
  • spider_gamma_root_optionsThe option list of the root state S(1,2,z) at fuel N+1 (with z = m+1 and N ≥ 3) is the mex of 8 explicit "head" options together with the…
  • spider_blocked_raw_opts_splitThe raw option list of (in;{(r,β),(1,free)}) decomposes as spider_blocked_leg0_opts r β ++ spider_blocked_free_leg_opts r β: the zipIdx…
  • spider_gammaThe function spider_gamma computes a natural number from a fuel parameter fuel : ℕ, a centre status s : CentreStatus, and a list of spider…
  • spider_blocked_leg0_optsThe contribution of the blocked leg (r,β) alone to the raw option list of (in;{(r,β),(1,free)}): for each cut j₀ = 0,…,r-1 of that leg,…
  • spider_blocked_free_leg_optsThe contribution of the free leg (1,free) alone to the raw option list of (in;{(r,β),(1,free)}): the unique cut j = 1 with direction δ…
  • spider_gamma_swap_twoThe Grundy value of a two-legged spider state is invariant under swapping the two legs in the list.
  • spider_gamma_fuel_independentFor every fuel at least the total number of markable edges in L plus one, the value of spider_gamma does not depend on the fuel: it equals…
  • spider_blocked_raw_optsThe raw option list of the state (in;{(r,β),(1,free)}) after exactly one unfolding step of spider_gamma at fuel r+2, with the *sub-state…
  • spider_blocked_none_one_inward_one_outward_raw_opts_eqFor r ≥ 2 and φ ≠ free, the value of (none;{(1,inward),(1,outward),(r,φ)}) at fuel r+3 is the mex of the raw option list…
  • spider_blocked_incoming_one_inward_options_nonemptyThe options list generated by [(1, inward), (r, φ)] at incoming centre is non-empty.
  • spider_two_leg_one_free_options_eqThe raw zipIdx.flatMap options list of [(1, free), (k, free)] at fuel k + 2 with incoming centre status unfolds to the explicit list [k, k…
  • spider_blocked_two_three_level_five_optionsOne unfolding step of the recursion for the level-5 root state (none;{(5,inward),2^*,3^*}) at fuel n+1: the value is the mex of the list…
  • spider_gamma_reversalFor every fuel, centre status s and leg list L, the value of the spider state (s;L) equals the value of the state obtained by exchanging…

Read back from the Lean

The definition spider_update_centre is a function taking a centre status s : CentreStatus and a leg-end update delta : SpiderLegEnd and returning a new CentreStatus, specified as follows: - If delta is SpiderLegEnd.inward: - CentreStatus.none updates to CentreStatus.incoming - CentreStatus.incoming remains CentreStatus.incoming - CentreStatus.outgoing updates to CentreStatus.free - CentreStatus.free remains CentreStatus.free - If delta is SpiderLegEnd.outward: - CentreStatus.none updates to CentreStatus.outgoing - CentreStatus.incoming updates to CentreStatus.free - CentreStatus.outgoing remains CentreStatus.outgoing - CentreStatus.free remains CentreStatus.free - If delta is SpiderLegEnd.free: - returns s unchanged (for any s).

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

/-- Status update of the centre vertex after orienting an incident edge. -/
def spider_update_centre (s : CentreStatus) (delta : SpiderLegEnd) : CentreStatus :=
  match delta with
  | .inward =>
    match s with
    | .none => .incoming
    | .incoming => .incoming
    | .outgoing => .free
    | .free => .free
  | .outward =>
    match s with
    | .none => .outgoing
    | .incoming => .free
    | .outgoing => .outgoing
    | .free => .free
  | .free => s
See it in the graphDiscuss this resultChallenge it