Two-gadget chains, the balanced odd split, and the family
DefinitionRhoMin_EveryChain of two gadgets. For interiors of sizes , the function with the values of on positions , the values of shifted by on the next positions, and the identity afterwards. It is the value function of for either .
Balanced odd split. For an even number with , the pair
The family . Defined recursively: is the identity if , and otherwise is the chain of two gadgets with interiors and , where is the balanced odd split of .
Chain parameters of two gadgets at offset with sizes , interiors and flag , in the format of the chain parameters of the gadget definitions.
The three bounds together. For a value function , a block with corners and numbers : bounds the paths, bounds the corner paths and bounds the corner pairs of in the digraph .
The family is the balanced recursive construction whose three path quantities grow by an additive constant per level of nesting.
Formalization Note is defined for every natural number and is a function on all of ; the paper uses it for odd and positions below . For the first component of the split is by truncated subtraction; the paper uses the split only for even .
import Definitions.Def_RhoMin_Gadget import Definitions.Def_RhoMin_Orient import Definitions.Def_RhoMin_Defs import Definitions.Def_RhoMin_Piece import Definitions.Def_RhoMin_Dir import Mathlib.Data.Nat.Log import Mathlib.Order.Interval.Finset.Nat import Mathlib.Data.Fintype.Perm import Mathlib.Data.Fintype.Card import Mathlib.Data.List.Nodup import Mathlib.Data.Nat.Find import Mathlib.Data.List.FinRange import Mathlib.Data.Finset.Lattice.Fold import Mathlib.Data.Finset.Card import Mathlib.Data.List.Count import Mathlib.Algebra.BigOperators.Group.Finset.Basic import Mathlib.Algebra.Order.BigOperators.Group.Finset import Mathlib.Data.Fintype.Inv namespace RhoMin /-- Ch(ga, gb; ·) values: gadget Y(ga) (size a + 3), gadget Y(gb) (size b + 3), then the identity. -/ def chain2V (a : ℕ) (ga : ℕ → ℕ) (b : ℕ) (gb : ℕ → ℕ) (i : ℕ) : ℕ := if i < a + 3 then gadV a ga i else if i < a + 3 + (b + 3) then (a + 3) + gadV b gb (i - (a + 3)) else i /-- split an even m ≥ 2 into two odd numbers. -/ def spA (m : ℕ) : ℕ := if (m / 2) % 2 = 1 then m / 2 else m / 2 - 1 def spB (m : ℕ) : ℕ := if (m / 2) % 2 = 1 then m / 2 else m / 2 + 1 def T (r : ℕ) : ℕ → ℕ := if h : r < 9 then id else chain2V (spA (r - 7)) (T (spA (r - 7))) (spB (r - 7)) (T (spB (r - 7))) termination_by r decreasing_by all_goals (simp only [spA, spB]; split_ifs <;> omega) def cp2 (q a : ℕ) (ga : ℕ → ℕ) (b : ℕ) (gb : ℕ → ℕ) (eps : Bool) : Pieces := ⟨q, 2, fun j => if j = 0 then a else b, fun j => if j = 0 then ga else gb, eps⟩ /-- The three bounds on a block S with corners c, w. -/ abbrev Bnd (f : ℕ → ℕ) (S : Finset ℕ) (c w R L M : ℕ) : Prop := BoundR (Arc f) S R ∧ BoundL (Arc f) S c w L ∧ BoundM (Arc f) S c w M end RhoMin
Read-back
What the Lean code literally says, in plain math · claude-fable-5-2
Definition chain2V. For natural numbers , , functions (arbitrary, with no assumptions) and a natural number , the natural number is
where, for a natural number , a function and a natural number ,
Spelled out: the value is at ; at ; for ; at ; at ; at ; for ; at ; and for all . When (respectively ) the range involving (respectively ) is empty.
Definition spA. For a natural number (any ; no parity or size assumption), with ,
where the subtraction is truncated at . Hence for (where ) the value is ; for all the value is an odd number.
Definition spB. For a natural number (any ; no parity or size assumption), with ,
The value is always odd; for it is . Together with (which is if is odd and the truncated if is even): for one has , which is when is even and when is odd; for the sum is .
Definition T. For every natural number (no parity assumption), is a function , defined by recursion on :
- if , then is the identity function, for all ;
- if , put (so ), , and
then for all ,
where equals if ; if ; if ; and if .
The recursion is on the strictly smaller indices . Each is defined on all of . In the case , both and are odd, and equals when is odd and when is even; so for all (odd ) or all (even ). For example, for : , , and takes the values at and for .
Definition cp2. Given natural numbers , , , functions (arbitrary) and a truth value , this is the bundle — a natural number , a natural number , a function , a family of functions indexed by , and a truth value — given by
- ;
- ;
- and for every (in particular for all , not only );
- and for every ;
- the truth value is the given .
Consequently the associated offsets are , , . No conditions (parity, injectivity, etc.) are imposed on the inputs.
Abbreviation Bnd. Let be an arbitrary function, a finite set, and natural numbers. Define a binary relation on by: holds if and only if
(The parity condition is on the source only; the relation is not symmetric in general.) Call a finite list of natural numbers admissible if its entries are pairwise distinct, for every (automatically true when ), and every entry lies in ; say a list has an end at if its first entry is or its last entry is (never true for the empty list). The proposition is the conjunction of three statements:
- every admissible list has at most entries;
- every admissible list that has an end at or has an end at has at most entries;
- for every pair of admissible lists , such that no entry of is an entry of , has an end at , and has an end at , the total number of entries of and is at most .
No relation between , and is assumed. Empty and one-entry lists inside are admissible, so statement 1 forces when . Statement 2 holds for every if neither nor is in . Statement 3 holds for every if , or , or , since then no such pair of lists exists.