spider_rho
The function spider_rho takes h : ℕ and delta, phi : SpiderLegEnd, returning h if phi = free; if phi = inward, it returns h % 2 when delta = inward, and (if h ≥ 2 ∧ h % 2 = 0 then 1 else 0) otherwise; if phi = outward, it returns h % 2 when delta = outward, and (if h ≥ 2 ∧ h % 2 = 0 then 1 else 0) otherwise.
Statement
def spider_rho (h : ℕ) (delta : SpiderLegEnd) (phi : SpiderLegEnd) : ℕ- Defined in
- scout/2610-15145-nim-heaps-in-the-game-of-cycles-the-parity-conjecture-fails.md, Theorem 4.3 and Section 6.1
- Verified
- 18 Oct 2026
- Axioms
- none listed
- Built on 1
- 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 31
- spider_none_one_inward_one_outward_opts_all_lt_memFor r ≥ 2 and φ ≠ free, every k < r is a member of the closed-form option list of the κ₁ family.
- 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_optionvals_not_memFor r ≥ 1 and β inward or outward, the closed-form value spider_blocked_val β r does not occur in the explicit options list of…
- spider_blocked_optionvals_low_memFor r ≥ 2, β inward or outward, and k + 2 ≤ r, the number k occurs in the explicit options list of (in;{(r,β),(1,free)}).
- 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_mex_incoming_one_outward_all_lt_memEvery natural number k < r ^^^ 1 is a member of the explicit options list for (in;{(1,outward),(r,φ)}) when r ≥ 2 and φ ≠ free.
- 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_mex_incoming_one_outwardThe minimum excluded value of the explicit options list for the configuration κ₂ = (in;{(1,outward),(r,φ)}) equals r ^^^ 1 for every r ≥ 2…
- spider_mex_incoming_one_outward_not_memThe value r ^^^ 1 is not a member of the explicit options list for (in;{(1,outward),(r,φ)}) when r ≥ 2 and φ ≠ free.
- spider_rho_zero_sameFor any non-free spider leg end φ, spider_rho 0 φ φ = 0.
- spider_none_one_inward_one_outward_opts_not_memFor r ≥ 2 and φ ≠ free, the level r is not a member of the closed-form option list of the κ₁ family.
- spider_blocked_optionvals_top_memFor r ≥ 1 and β inward or outward, r is in the explicit options list; moreover r-1 is in it when β = inward and r % 4 ≠ 3, and when β =…
- spider_blocked_none_one_inward_one_outward_opts_eqFor r ≥ 2, φ ≠ free, and assuming the closed form for all smaller levels, the mex of the raw option list equals the mex of the explicit…
- 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_blocked_optionvalsThe explicit options list of the state (in;{(r,β),(1,free)}) at fuel r + 2 after substituting the inductive closed forms: for each cut j =…
- spider_gamma_swap_twoThe Grundy value of a two-legged spider state is invariant under swapping the two legs in the list.
- spider_blocked_optionvals_leFor r ≥ 2 and β ≠ free, every element of the explicit options list of (in;{(r,β),(1,free)}) is at most r.
- 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_none_one_inward_one_outward_raw_optsThe raw option list of the state (none;{(1,inward),(1,outward),(r,φ)}) after one unfolding step, in the exact order the recursion…
- spider_rho_pair_valuesFor every h ≥ 1 and φ ≠ free, the pair of rho values (spider_rho h inward φ, spider_rho h outward φ) is either (0, 1) or (1, 0).
- 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…
- spider_none_one_inward_one_outward_optsThe explicit closed-form option list of the state (none;{(1,inward),(1,outward),(r,φ)}) after substituting the sub-state values: the two…
Read back from the Lean
The function spider_rho takes a natural number h : ℕ and two values delta, phi : SpiderLegEnd (an inductive type with three constructors: free, inward, and outward), and returns a natural number defined by cases on phi:
- If phi = .free, it returns h.
- If phi = .inward:
- If delta = .inward, it returns h % 2.
- Otherwise (if delta ≠ .inward), it returns 1 if h ≥ 2 and h % 2 = 0 (i.e., h is an even number at least 2), and 0 otherwise.
- If phi = .outward:
- If delta = .outward, it returns h % 2.
- Otherwise (if delta ≠ .outward), it returns 1 if h ≥ 2 and h % 2 = 0, and 0 otherwise.
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
/-- Value of a detached run of h edges with given near and far end conditions. -/ def spider_rho (h : ℕ) (delta : SpiderLegEnd) (phi : SpiderLegEnd) : ℕ := match phi with | .free => h | .inward => if delta == .inward then h % 2 else (if h ≥ 2 ∧ h % 2 == 0 then 1 else 0) | .outward => if delta == .outward then h % 2 else (if h ≥ 2 ∧ h % 2 == 0 then 1 else 0)