Abstract chains, their port conditions, and the three path bounds of a block
DefinitionRhoMin_PieceChain data. A number of pieces, a finite set of positions (natural numbers), and for each index a joint , two gates , two corners and an interior block , a finite set of positions. The -th piece is
Chain conditions. For a digraph on the natural numbers, the data form a chain if:
- every position of is the joint , or lies in a piece , or is a joint , for some ;
- distinct pieces are disjoint, no joint with lies in a piece, and the joints are distinct;
- for the gates are distinct and do not lie in ;
- (ports) for and positions with an arc : if the arc enters from outside it is or ; if it leaves it is or ; if it enters from outside it is or ; if it leaves it is or .
Three bounds of a block. Let be a finite set of positions with corners , and call a repetition-free walk of with all vertices in a path in .
- bounds the paths of if every path in has at most vertices.
- bounds the corner paths of if every path in with an end at or at has at most vertices.
- bounds the corner pairs of if any two vertex-disjoint paths in , the first with an end at and the second with an end at , have at most vertices in total.
The chain conditions are exactly what the analysis of paths in a chain of gadgets uses, and the three bounds are the quantities that the recurrences control.
Formalization Note The quantities , , of the paper are exact maxima; here they appear as the upper-bound predicates BoundR, BoundL, BoundM. The chain data do not require the corners to lie in the block.
import Definitions.Def_RhoMin_Dir
import Mathlib.Data.Finset.Card
import Mathlib.Data.List.Count
namespace RhoMin
structure ChainData where
K : ℕ
z : ℕ → ℕ
a : ℕ → ℕ
b : ℕ → ℕ
c : ℕ → ℕ
w : ℕ → ℕ
I : ℕ → Finset ℕ
X : Finset ℕ
def ChainData.M (C : ChainData) (j : ℕ) : Finset ℕ := insert (C.a j) (insert (C.b j) (C.I j))
structure IsChain (A : ℕ → ℕ → Prop) (C : ChainData) : Prop where
cover : ∀ x ∈ C.X, x = C.z 0 ∨ ∃ j < C.K, x ∈ C.M j ∨ x = C.z (j + 1)
Mdisj : ∀ i < C.K, ∀ j < C.K, i ≠ j → ∀ x, x ∈ C.M i → x ∉ C.M j
zM : ∀ i ≤ C.K, ∀ j < C.K, C.z i ∉ C.M j
zne : ∀ i ≤ C.K, ∀ j ≤ C.K, C.z i = C.z j → i = j
aI : ∀ j < C.K, C.a j ∉ C.I j
bI : ∀ j < C.K, C.b j ∉ C.I j
ab : ∀ j < C.K, C.a j ≠ C.b j
inM : ∀ j < C.K, ∀ u v, u ∈ C.X → v ∈ C.X → u ∉ C.M j → v ∈ C.M j → A u v →
(u = C.z j ∧ v = C.a j) ∨ (u = C.z (j + 1) ∧ v = C.b j)
outM : ∀ j < C.K, ∀ u v, u ∈ C.X → v ∈ C.X → u ∈ C.M j → v ∉ C.M j → A u v →
(u = C.a j ∧ v = C.z (j + 1)) ∨ (u = C.b j ∧ v = C.z j)
inI : ∀ j < C.K, ∀ u v, u ∈ C.X → v ∈ C.X → u ∉ C.I j → v ∈ C.I j → A u v →
(u = C.a j ∧ v = C.w j) ∨ (u = C.b j ∧ v = C.c j)
outI : ∀ j < C.K, ∀ u v, u ∈ C.X → v ∈ C.X → u ∈ C.I j → v ∉ C.I j → A u v →
(u = C.c j ∧ v = C.a j) ∨ (u = C.w j ∧ v = C.b j)
/-- Every directed simple path inside `S` has at most `R` vertices. -/
def BoundR (A : ℕ → ℕ → Prop) (S : Finset ℕ) (R : ℕ) : Prop :=
∀ l : List ℕ, l.Nodup → Walk A l → (∀ x ∈ l, x ∈ S) → l.length ≤ R
/-- Every directed simple path inside `S` with an end at a corner has at most `L` vertices. -/
def BoundL (A : ℕ → ℕ → Prop) (S : Finset ℕ) (c w L : ℕ) : Prop :=
∀ l : List ℕ, l.Nodup → Walk A l → (∀ x ∈ l, x ∈ S) → (IsEnd c l ∨ IsEnd w l) → l.length ≤ L
/-- Two disjoint directed simple paths inside `S`, one with an end at `c`, one with an end at `w`, have
at most `M` vertices together. -/
def BoundM (A : ℕ → ℕ → Prop) (S : Finset ℕ) (c w M : ℕ) : Prop :=
∀ l₁ l₂ : List ℕ, l₁.Nodup → l₂.Nodup → Walk A l₁ → Walk A l₂ → (∀ x ∈ l₁, x ∈ S) →
(∀ x ∈ l₂, x ∈ S) → (∀ x ∈ l₁, x ∉ l₂) → IsEnd c l₁ → IsEnd w l₂ → l₁.length + l₂.length ≤ M
end RhoMin
Read-back
What the Lean code literally says, in plain math · claude-fable-5-2
Structure ChainData. A chain datum is a bundle of eight pieces of data with no conditions imposed on them:
- a natural number ;
- five functions , written ;
- a function assigning to every natural number a finite set ;
- a finite set .
All the functions are defined on every natural number , including . Nothing relates the pieces to one another: may be , the sets and may be empty, and the values and the sets need not lie in .
Definition ChainData.M. For a chain datum and a natural number (any , with no requirement ), the finite set is
If or already lies in , or , the union simply has fewer elements; and are not added.
Structure IsChain. Let be an arbitrary binary relation on (written ; it is not assumed symmetric, irreflexive, or decidable) and let be a chain datum with components and . The proposition " is a chain for " is the conjunction of the following eleven conditions.
- (cover) For every : either , or there is such that or .
- (Mdisj) For all and with , and every natural number : if then . (That is, .)
- (zM) For all and all : .
- (zne) For all and : if then . (So are pairwise distinct.)
- (aI) For all : .
- (bI) For all : .
- (ab) For all : .
- (inM) For all and all natural numbers : if , , , and , then
- (outM) For all and all natural numbers : if , , , and , then
- (inI) For all and all natural numbers : if , , , and , then
- (outI) For all and all natural numbers : if , , , and , then
Points the conditions leave open or make degenerate: conditions 8–11 only restrict pairs with both and in ; they say which such pairs may be -related across the boundary of or , and do not assert that any listed pair is actually -related. No condition requires , , , , , or . Condition 1 is a one-directional covering statement (every element of is of one of the listed forms), not an equality of sets. The indices in conditions 3 and 4 run up to and including for , and conditions 8 and 9 mention with . When , conditions 2, 3, 5–11 hold vacuously, condition 4 is trivial, and the whole proposition reduces to: every element of equals (so is empty or ).
Definition BoundR. Let be a binary relation on , a finite set, and a natural number. The proposition says: for every finite list of natural numbers such that
- the entries of are pairwise distinct,
- holds for every pair of consecutive entries, (a condition that is automatically true when ),
- every entry of lies in ,
the number of entries satisfies . The relation is only required along the list in the forward direction . The empty list and every one-entry list with satisfy the hypotheses, so the proposition forces whenever is non-empty; when is empty only the empty list qualifies and the proposition holds for every .
Definition BoundL. Let be a binary relation on , a finite set, and natural numbers. The proposition says: for every finite list of natural numbers such that
- the entries of are pairwise distinct,
- holds for every (automatically true when ),
- every entry of lies in ,
- at least one of the following holds: the first entry of is , the last entry of is , the first entry of is , or the last entry of is ,
the number of entries satisfies . The last hypothesis fails for the empty list, so only non-empty lists are constrained. The point or may be either the starting or the terminating entry of the list. No relation between , and is assumed: is allowed, and if neither nor belongs to then no list satisfies the hypotheses and the proposition holds for every .
Definition BoundM. Let be a binary relation on , a finite set, and natural numbers. The proposition says: for every pair of finite lists and of natural numbers such that
- the entries of are pairwise distinct, and the entries of are pairwise distinct,
- holds for every , and holds for every (each automatically true for a list with at most one entry),
- every entry of lies in , and every entry of lies in ,
- no entry of is an entry of ,
- the first entry of is or the last entry of is ,
- the first entry of is or the last entry of is ,
the total number of entries satisfies . The roles are not symmetric: is the list with an end at and the list with an end at . Both lists are necessarily non-empty, since the end conditions fail for an empty list. No relation between , and is assumed; if , or if , or if , then no pair of lists satisfies all the hypotheses and the proposition holds for every .