Cyclic mixed-demand coloring
Abstract
Mixed singleton and double demands on a cyclic distance graph have an exact slot-coloring minimum.
In the formulas, div denotes natural-number division, mod denotes natural remainder, and subtraction on natural numbers is truncated. Angle brackets construct a finite value; proof arguments of cyclicIndex are suppressed under the displayed size inequality.
The packing and slot constructions assume 0<m<=n. Demands are positive and at most two in the mixed minimum; the general slot theorem allows larger finite demands.
Definition 1.1 (Demand types).
Formalization. D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.Vertex (✓ std3).
Source. Repository-derived.
Commentary.
There are n cyclic prefixes. Prefix t has k(t) types, indexed by Fin(k(t)). A vertex is a prefix together with a type rank. Rank zero is used for every singleton, independently of any external label attached to that singleton.
Definition 1.2 (Integer circular adjacency).
Formalization. D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.Near (✓ std3).
Source. Repository-derived.
Commentary.
Two prefixes are near when their integer circular distance is strictly less than m. The definition includes the ordinary interval and both orientations across the seam. For positive m a prefix is near itself.
Definition 1.3 (Proper demand coloring).
Formalization. D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.Proper (✓ std3).
Source. Repository-derived.
Commentary.
A coloring separates every pair of distinct types whose prefixes are near. For m>0, all types at a single prefix have different colors.
Theorem 1.4 (Cyclic packing).
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.separated_packing (✓ std3). ∎
Source. Repository-derived.
Commentary.
For 0<m<=n, every finite set of pairwise separated types has cardinality at most floor(n/m). Attach the next m cyclic positions to each selected type. These intervals are disjoint: an intersection forces near prefixes, and different types at one prefix are also forbidden. Their injection into the n positions gives m times the cardinality at most n. The argument includes empty sets, singleton sets, and intervals crossing the seam.
Theorem 1.5 (Total demand bound).
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.packing_lower_bound (✓ std3). ∎
Source. Repository-derived.
Commentary.
For 0<m<=n, every proper coloring with c colors satisfies sum(k)<=c floor(n/m). Partition the types by color and apply the cyclic packing bound to every color class.
Definition 1.6 (Wrapping block sums).
Formalization. D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.Window (✓ std3).
Source. Repository-derived.
Commentary.
A cumulative boundary function s represents the slot blocks. A nonwrapping m-block sum is s(i+m)-s(i). A wrapping sum is s(n)-s(i)+s(i+m-n)-s(0).
Theorem 1.7 (Cyclic slot validity).
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.cyclic_slot_coloring (✓ std3). ∎
Source. Repository-derived.
Commentary.
Assume 0<m<=n, c>0, s(0)=0, strictly positive blocks s(i+1)-s(i), k(i)<=s(i+1)-s(i), c divides s(n), and every wrapping m-block sum is at most c. Color rank r at prefix i by (s(i)+r) mod c. For an adjacent ordered pair, selected slots are strictly ordered and less than c apart. Across the seam translate the second slot by s(n), which preserves its residue. Distinct ranks in one block are handled by the same strict bound. Thus the coloring is proper, including equality of a window sum with c.
Theorem 1.8 (Exact shortened-slot formula).
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.low_slot_formula_valid (✓ std3). ∎
Source. Repository-derived.
Commentary.
For the shortened singleton blocks, the displayed cumulative formula starts at zero, has length one exactly on R and length two elsewhere, ends at 2ma, and its chosen slot residues form a proper coloring. The existential constructor uses this coloring.
Theorem 1.9 (Shortened singleton blocks).
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.low_slot_construction (✓ std3). ∎
Source. Repository-derived.
Commentary.
Assume 0<m<=n, n=ma+rho, and every demand is one or two. Choose a set R of exactly 2rho singleton prefixes. Set s(i)=2i-#{r in R:r<i}. Each chosen block has length one; every other block has length two. All demands are contained, the total is 2ma, and every wrapping m-block sum is at most 2m. Cyclic slot validity supplies 2m colors for any placement of the chosen singleton prefixes.
Theorem 1.10 (The low branch).
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.low_branch_coloring (✓ std3). ∎
Source. Repository-derived.
Commentary.
Assume 0<m<=n, n=ma+rho, and every demand is one or two. If there are at least 2rho singleton prefixes, select exactly 2rho of them and use the shortened-block construction. No contiguous placement condition is imposed on the singletons.
Theorem 1.11 (Spaced extra slots).
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.spaced_slot_construction (✓ std3). ∎
Source. Repository-derived.
Commentary.
Assume 0<m<=n and every demand is at most two. Start with blocks of length two and add one slot at each prefix in a cyclically m-separated set R. Set s(i)=2i+#{r in R:r<i}. Every wrapping m-window contains at most one extra slot, so its sum is at most 2m+1. If 2m+1 divides 2n+|R|, this gives a proper coloring with 2m+1 colors.
Theorem 1.12 (Exact spaced-slot formula).
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.high_slot_formula_valid (✓ std3). ∎
Source. Repository-derived.
Commentary.
With c=2m+1, z=(a-2rho) mod c, and R={qm:0<=q<z}, the cumulative formula starts at zero, ends at 2n+z, and its chosen slot residues form a proper coloring. The high-branch constructor uses this coloring.
Theorem 1.13 (The high branch).
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.high_branch_coloring (✓ std3). ∎
Source. Repository-derived.
Commentary.
Assume 0<m<=n, n=ma+rho, a>=2rho, and every demand is at most two. Put c=2m+1 and z=(a-2rho) mod c. Add slots at 0,m,…,(z-1)m. Since z<=a, consecutive extras and the cyclic closing gap are at least m apart. The identity 2n+(a-2rho)=ca shows that c divides 2n+z. This construction allows arbitrary singleton positions and even applies when every demand is two.
Definition 1.14 (A cyclic consecutive window).
Formalization. D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.cyclicIndex (✓ std3).
Source. Repository-derived.
Commentary.
The offset i from start is start+i when this is below n, and start+i-n otherwise. Offsets range over Fin(m), with m<=n, so there is at most one seam crossing.
Theorem 1.15 (The double-demand clique).
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.double_window_lower_bound (✓ std3). ∎
Source. Repository-derived.
Commentary.
If an m-consecutive cyclic window consists entirely of double-demand prefixes, its 2m types form a clique. Their colors are distinct, giving c>=2m for every proper coloring.
Theorem 1.16 (The exact mixed minimum).
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.mixed_demand_minimum (✓ std3). ∎
Source. Repository-derived.
Commentary.
Assume m>=2, n>2m, n=ma+rho, rho<m, a>=2rho, demands k(t) in {1,2}, and one m-consecutive all-double window. Let L be the number of singleton prefixes. The least feasible number of colors is max(2m,ceil((2n-L)/a)), exactly 2m+1 when L<2rho and 2m otherwise. Natural ceiling is represented by (2n-L+a-1)/a; the hypotheses imply a>0. The clique gives the 2m lower bound, packing uses floor(n/m)=a and total demand 2n-L, and the two slot constructions attain the stated bound. This is a theorem about cyclic demand types; additional physical observation data require their own correspondence.
References
- Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.Near - Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.Proper - Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.Vertex - Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.Window - Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.cyclicIndex - Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.cyclic_slot_coloring - Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.double_window_lower_bound - Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.high_branch_coloring - Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.high_slot_formula_valid - Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.low_branch_coloring - Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.low_slot_construction - Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.low_slot_formula_valid - Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.mixed_demand_minimum - Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.packing_lower_bound - Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.separated_packing - Truth anchor:
D5/S3/Combinatorics/Graph/CyclicMixedDemandColoring.spaced_slot_construction