From f4ec5e5d87e440b4d7980346a13c1756f52b34c9 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sun, 15 Nov 2026 14:02:58 +0800 Subject: [PATCH 01/15] COE-01: chromatic observer theorem and Lean finite certificates --- .../workflows/coe01-chromatic-observers.yml | 42 ++++++++++ MathCan.lean | 1 + MathCan/ChromaticObservers.lean | 80 +++++++++++++++++++ .../CHROMATIC_OBSERVER_THEOREM.md | 64 +++++++++++++++ 4 files changed, 187 insertions(+) create mode 100644 .github/workflows/coe01-chromatic-observers.yml create mode 100644 MathCan/ChromaticObservers.lean create mode 100644 research/compactification/CHROMATIC_OBSERVER_THEOREM.md diff --git a/.github/workflows/coe01-chromatic-observers.yml b/.github/workflows/coe01-chromatic-observers.yml new file mode 100644 index 00000000..a40238e5 --- /dev/null +++ b/.github/workflows/coe01-chromatic-observers.yml @@ -0,0 +1,42 @@ +name: COE-01 chromatic observer Lean certificates + +on: + pull_request: + paths: + - 'MathCan/ChromaticObservers.lean' + - 'MathCan.lean' + - 'research/compactification/CHROMATIC_OBSERVER_THEOREM.md' + - '.github/workflows/coe01-chromatic-observers.yml' + push: + branches: [main] + paths: + - 'MathCan/ChromaticObservers.lean' + - 'MathCan.lean' + - '.github/workflows/coe01-chromatic-observers.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + kernel: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: leanprover/lean-action@v1 + with: + auto-config: false + build: true + build-args: MathCan + test: false + lint: false + use-mathlib-cache: false + - name: Independently check COE-01 target and axiom inventory + shell: bash + run: | + set -euo pipefail + lake env lean MathCan/ChromaticObservers.lean | tee coe01-axioms.txt + if grep -Eq 'sorryAx|ofReduceBool' coe01-axioms.txt; then + echo 'Unexpected admitted or native-reduction axiom' + exit 1 + fi diff --git a/MathCan.lean b/MathCan.lean index 8fbc52db..1b390fbb 100644 --- a/MathCan.lean +++ b/MathCan.lean @@ -32,3 +32,4 @@ import MathCan.GraphAuthorization import MathCan.TreeReconstruction import MathCan.CoarseStateDependence import MathCan.TacticFibers +import MathCan.ChromaticObservers diff --git a/MathCan/ChromaticObservers.lean b/MathCan/ChromaticObservers.lean new file mode 100644 index 00000000..161640ab --- /dev/null +++ b/MathCan/ChromaticObservers.lean @@ -0,0 +1,80 @@ +import Init + +/-! +COE-01: finite arithmetic and code witnesses for chromatic observers. + +The mathematical theorem relates a graph's chromatic number to the minimum +number of binary observables needed to distinguish its tested edges. This +module checks explicit finite cases and robustness witnesses under the pinned +Init-only Lean kernel. The general chromatic equivalence and Lipschitz +extension are proved in the accompanying research note, not by this module. +-/ + +namespace MathCan.ChromaticObservers + +set_option maxRecDepth 4096 +set_option maxHeartbeats 1000000 + +/-- A concrete six-code, six-bit binary alphabet. -/ +def robustSixCode (v : Fin 6) : Nat := + match v.val with + | 0 => 0 + | 1 => 7 + | 2 => 25 + | 3 => 30 + | 4 => 42 + | _ => 45 + +/-- Finite Hamming distance, restricted to the lowest `width` bits. -/ +def bitDistance (width a b : Nat) : Nat := + ((List.range width).filter (fun i => a.testBit i != b.testBit i)).length + +/-- Every one of the six words lies in the six-bit cube. -/ +theorem robustSixCode_in_range : + ∀ v : Fin 6, robustSixCode v < 2 ^ 6 := by + decide + +/-- All fifteen unordered pairs have Hamming distance at least three. -/ +theorem robustSixCode_margin_three : + ∀ u v : Fin 6, u ≠ v → + 3 ≤ bitDistance 6 (robustSixCode u) (robustSixCode v) := by + decide + +/-- Complete-graph six-state observation needs more than four colors. -/ +theorem six_spokes_exceed_two_bits : 2 ^ 2 < 6 := by + decide + +/-- At width five, six radius-one binary balls would contain 36 words, + exceeding the 32 available. The sphere-disjointness inference is in + the accompanying proof, not the arithmetic statement. -/ +theorem six_radius_one_balls_overfill_five_bits : + 2 ^ 5 < 6 * (1 + 5) := by + decide + +/-- A path of eight vertices admits the alternating one-bit encoding. -/ +theorem eight_path_one_bit_certificate : + (List.range 7).all (fun i => i % 2 != (i + 1) % 2) = true := by + decide + +/-- Any `margin` differing positions retain a difference after at most + `erased` positions are dropped. The exact Hamming-set argument is in + the research note; this proves its integer inequality. -/ +theorem erasure_margin_arithmetic (margin erased : Nat) + (h : erased < margin) : 0 < margin - erased := by + omega + +/-- Repeating a bit `margin` times makes the output width exactly + `margin * k` and supplies the stated finite upper budget. -/ +theorem repetition_width (k margin : Nat) : + k * margin = margin * k := by + omega + +#print axioms robustSixCode_in_range +#print axioms robustSixCode_margin_three +#print axioms six_spokes_exceed_two_bits +#print axioms six_radius_one_balls_overfill_five_bits +#print axioms eight_path_one_bit_certificate +#print axioms erasure_margin_arithmetic +#print axioms repetition_width + +end MathCan.ChromaticObservers diff --git a/research/compactification/CHROMATIC_OBSERVER_THEOREM.md b/research/compactification/CHROMATIC_OBSERVER_THEOREM.md new file mode 100644 index 00000000..378d411f --- /dev/null +++ b/research/compactification/CHROMATIC_OBSERVER_THEOREM.md @@ -0,0 +1,64 @@ +# COE-01: chromatic observer dimension and stable probe extension + +**Date:** 2026-11-15. **Status:** new, self-contained finite theorem with exact computational witnesses and partial Lean certificates; no claim of priority over the mathematics literature. The theorem is an elementary graph-coding observation presented here for task-relative compactification. Its verification is separate from claims in the two source manuscripts. + +## Motivation and source separation + +- [OpenAI Math family 098](https://github.com/openai/math/blob/main/lean/docs/098.md), *A doubling Hilbert subset with no finite-dimensional bi-Lipschitz embedding* (September 25, 2026), constructs an obstruction to globally faithful metric dimension reduction, even for compact doubling Hilbert subsets. Its published Lean comparator has a more specific scope than the whole family. +- [OpenAI Math family 332](https://github.com/openai/math/blob/main/preprints/Metric-Markov-Cotype-Two-of-l1-October-5-2026/README.md), *Metric Markov Cotype Two of ℓ1* (October 5, 2026), claims a universal-loss Lipschitz extension from arbitrary Hilbert subsets into ℓ1. The present work uses the distinction between stable forward observables and inverse metric fidelity; it neither assumes the manuscript has been independently certified nor reproduces its deep proof. + +The following theorem is proved directly using finite graph coloring, binary codes, and scalar McShane extension, so its truth is independent of those source manuscripts. The fact that it is *new to this repository* is verified; literature-wide mathematical novelty remains unassessed. + +## The chromatic observer and extension theorem + +Let `G=(V,E)` be a finite simple graph with `n>=1` vertices and chromatic number `χ(G)`. Identify its vertices with unit vectors `e_v` in `H=R^n`, and let `S={0} ∪ {e_v : v∈V}`. A `k`-bit observer is an assignment `c:V→{0,1}^k`. The evaluator distinguishes exactly the edges `uv∈E`: it requires `c(u) ≠ c(v)` for those pairs. + +**Theorem COE-1 (exact task-relative dimension).** The minimum number of binary features is + +``` + k_0(G) = ceil(log_2 χ(G)). +``` + +For any optimal observer there is an extension `F:H→[0,1]^k`, with `F(e_v)=c(v)` and `F(0)=(1/2,...,1/2)`, such that + +``` + ||F(x)-F(y)||_∞ ≤ ||x-y||_2. +``` + +Hence the same extension, viewed in `ℓ1^k`, has Lipschitz constant at most `k`. This explicit factor `k` is only our elementary coordinatewise bound. Family 332's universal ℓ1 extension result concerns arbitrary ℓ1-valued Lipschitz data, and is logically stronger. + +*Proof.* A separating observer assigns distinct binary words across every edge; treating each distinct word as a color gives a proper coloring using at most `2^k` colors, so `χ(G)≤2^k`. Conversely, give vertices an optimal χ-coloring and encode each color with `k_0` bits. For the extension, set `f_j(e_v)=c(v)_j` and `f_j(0)=1/2`. Distances between different spokes equal `√2`, and each spoke is unit distance from zero. Thus each coordinate `f_j` is 1-Lipschitz on `S`. Define + +``` + F_j(x) = clip_[0,1] ( min_{s∈S} [ f_j(s) + ||x-s||_2 ] ). +``` + +The infimum of 1-Lipschitz cones is 1-Lipschitz and agrees with `f_j` on `S`; clipping preserves both properties. Taking the maximum over coordinates proves the result. ∎ + +**Theorem COE-2 (robust coding bounds).** Let `k_r(G)` be the fewest bits in an observer satisfying `d_H(c(u),c(v))≥r` on every tested edge. Then, for every integer `r≥1`, + +``` + ceil(log_2 χ(G)) ≤ k_r(G) ≤ r * ceil(log_2 χ(G)). +``` + +The upper bound repeats every bit of an optimal `k_0` observer `r` times. An observer with margin `r` survives any `r-1` feature erasures on all tested edges. For `r=2t+1`, the radius-`t` Hamming error balls around the endpoints of each edge are disjoint, so an evaluator that knows the tested pair can recover its identity after at most `t` flips. + +For each clique of size `m`, the ordinary sphere-packing inequality supplies the **necessary** condition + +``` + m * sum_{j=0}^t binom(k,j) ≤ 2^k +``` + +at a `2t+1` flip margin. This is a clique-specific obstruction, with no claim that the graph's chromatic number can replace `m` in the sphere-packing expression. + +*Proof.* A margin-r observer separates edges, yielding the first inequality. Bit repetition gives the second. Removing fewer than r positions leaves at least one difference. Two radius-t Hamming balls intersect only if their centers have distance at most 2t, by the triangle inequality. On a clique, all m balls are pairwise disjoint, each of cardinality `sum binom(k,j)`. ∎ + +**Finite sharp cell.** For `G=K6`, one-bit separation has exact width 3. Under one-bit flip tolerance (`r=3`) the exact width is **6**. A five-bit code would need `6*(1+5)=36` positions for disjoint radius-one balls inside `2^5=32` available positions, impossible. The six six-bit words `0,7,25,30,42,45` have pairwise Hamming distance at least three. The Lean module checks their range, pairwise margins and the integer packing obstruction; the general packing lemma is written here. + +## Scope and limitations + +The graph represents **evaluator-relevant pairs**, rather than all Hilbert distances. Two vertices with the same observer code may be geometrically separated, and the extended observer need not have a Lipschitz inverse. The construction is thus compatible with the obstruction in family 098. Finite-dimensional ℓ1 extension with optimal universal constant, all graphs' robust coding numbers and the genuine compact doubling construction of family 098 remain separate questions. + +## Reproduce + +The companion reference in `MoralityLabAI/Compactification-Theory/research/chromatic_observer_gym_v1` implements exact graph coloring, minimal robust observer search, the explicit extension and regression tests. Its deterministic suite enumerates all 64 simple graphs on four vertices. The MathCan Lean module uses the repository's `leanprover/lean4:v4.35.0` `Init` toolchain and reports the transitive axioms of each finite lemma. Source results are not imported as axioms. From a9afd3efa96753a07e00dccde8625c8f3adcd0b3 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sun, 15 Nov 2026 14:04:52 +0800 Subject: [PATCH 02/15] fix(COE-01): use Nat.mul_comm for nonlinear width identity --- MathCan/ChromaticObservers.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MathCan/ChromaticObservers.lean b/MathCan/ChromaticObservers.lean index 161640ab..9d7cc7fb 100644 --- a/MathCan/ChromaticObservers.lean +++ b/MathCan/ChromaticObservers.lean @@ -67,7 +67,7 @@ theorem erasure_margin_arithmetic (margin erased : Nat) `margin * k` and supplies the stated finite upper budget. -/ theorem repetition_width (k margin : Nat) : k * margin = margin * k := by - omega + exact Nat.mul_comm k margin #print axioms robustSixCode_in_range #print axioms robustSixCode_margin_three From 778dc5b99099478164d461d14de9e71f1403dd48 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sun, 15 Nov 2026 14:07:22 +0800 Subject: [PATCH 03/15] COE-03: metric quotient theorem and Lean forced-identification certificates --- MathCan/ChromaticObservers.lean | 27 +++++++++++++++++++ .../CHROMATIC_OBSERVER_THEOREM.md | 22 +++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/MathCan/ChromaticObservers.lean b/MathCan/ChromaticObservers.lean index 9d7cc7fb..4c919f9d 100644 --- a/MathCan/ChromaticObservers.lean +++ b/MathCan/ChromaticObservers.lean @@ -63,6 +63,31 @@ theorem erasure_margin_arithmetic (margin erased : Nat) (h : erased < margin) : 0 < margin - erased := by omega +/-- A unit Hamming jump requires at least the threshold in metric + distance. Thus a shorter edge forces the binary observer to be equal. -/ +theorem binary_lipschitz_forces_identification + (threshold distance : Nat) (a b : Bool) + (hshort : distance < threshold) + (hlip : (if a = b then 0 else threshold) ≤ distance) : + a = b := by + by_contra hne + simp [hne] at hlip + omega + +/-- Two short edges force equality at their endpoints, including when + their direct distance is large. This models a metric-quotient chain. -/ +theorem two_short_edges_collapse + (threshold d01 d12 : Nat) (a b c : Bool) + (h01 : d01 < threshold) (h12 : d12 < threshold) + (hlip01 : (if a = b then 0 else threshold) ≤ d01) + (hlip12 : (if b = c then 0 else threshold) ≤ d12) : + a = c := by + have hab : a = b := + binary_lipschitz_forces_identification threshold d01 a b h01 hlip01 + have hbc : b = c := + binary_lipschitz_forces_identification threshold d12 b c h12 hlip12 + exact hab.trans hbc + /-- Repeating a bit `margin` times makes the output width exactly `margin * k` and supplies the stated finite upper budget. -/ theorem repetition_width (k margin : Nat) : @@ -75,6 +100,8 @@ theorem repetition_width (k margin : Nat) : #print axioms six_radius_one_balls_overfill_five_bits #print axioms eight_path_one_bit_certificate #print axioms erasure_margin_arithmetic +#print axioms binary_lipschitz_forces_identification +#print axioms two_short_edges_collapse #print axioms repetition_width end MathCan.ChromaticObservers diff --git a/research/compactification/CHROMATIC_OBSERVER_THEOREM.md b/research/compactification/CHROMATIC_OBSERVER_THEOREM.md index 378d411f..e5d59d90 100644 --- a/research/compactification/CHROMATIC_OBSERVER_THEOREM.md +++ b/research/compactification/CHROMATIC_OBSERVER_THEOREM.md @@ -55,10 +55,28 @@ at a `2t+1` flip margin. This is a clique-specific obstruction, with no claim th **Finite sharp cell.** For `G=K6`, one-bit separation has exact width 3. Under one-bit flip tolerance (`r=3`) the exact width is **6**. A five-bit code would need `6*(1+5)=36` positions for disjoint radius-one balls inside `2^5=32` available positions, impossible. The six six-bit words `0,7,25,30,42,45` have pairwise Hamming distance at least three. The Lean module checks their range, pairwise margins and the integer packing obstruction; the general packing lemma is written here. +## The metric-quotient strengthening + +The Hilbert-star construction is a special case of a stronger metric theorem. Let `(X,d)` be any nonempty **finite metric space**, `L>0`, and `E` an undirected evaluator graph on X. Form the **forced-identification graph** `H_L` by joining every two distinct points with `d(x,y)<1/L`. Let `π:X→Q` be its connected-component quotient. A binary observer `c:X→{0,1}^k` is `L`-Lipschitz into ℓ∞ exactly when it is constant on each connected component of `H_L`. + +**Theorem COE-3 (exact metric-constrained chromatic observer).** If an evaluator edge joins two points in the same forced-identification component, no finite-width L-Lipschitz binary observer can satisfy the test. Otherwise, let `G_Q` be the evaluator graph induced on `Q`. Then + +``` + min_L-Lipschitz observer bits = ceil(log_2 χ(G_Q)). +``` + +Every resulting observer on X extends to any ambient metric space containing X as an `L`-Lipschitz function with values in `[0,1]^k`, measured in ℓ∞. In particular this applies to Hilbert activations. + +*Proof.* Whenever `c(x)≠c(y)`, two binary vectors differ in some coordinate by exactly 1, so the Lipschitz condition forces `1≤L d(x,y)`. This shows c is constant across `H_L` edges and consequently across connected components. Evaluator edges internal to one such component are therefore infeasible. For the converse, color `G_Q` optimally using χ distinct binary words in `k=ceil(log2 χ)` coordinates, and pull the code back along π. If x,y lie in the same component their codes agree. Across distinct components, `(x,y)` is no edge of `H_L`, hence `d(x,y)≥1/L`. As binary codes are at most unit distance apart in ℓ∞, the pulled-back observer is L-Lipschitz. Any evaluator-respecting observer yields a proper coloring of `G_Q`, giving the matching lower bound. Extend each coordinate by `clip_[0,1](inf_{s∈X}[c_j(s)+L d(x,s)])`; the standard cone argument finishes. ∎ + +This result makes an additional obstruction explicit: *short-edge connectivity can force globally identical binary readings even for points whose direct distance exceeds `1/L`*. On the real line with samples `0, 3/5, 6/5` and `L=1`, all points belong to one connected `H_L` component. The evaluator request to distinguish endpoints is impossible, even though their direct distance is `6/5 > 1`. Increasing L to 2 splits all three points into separate components, making a one-bit task observer feasible. At the exact boundary `d=1/L`, different bits are permitted. + +For robust Hamming-margin r observables the same forced-identification quotient applies, because the output ℓ∞ distance of any distinct binary codes remains 1. The COE-2 color-repetition upper bound therefore holds on `G_Q` whenever the instance is feasible. An ambient Lipschitz extension takes values in the continuous cube; its intermediate points may have fractional coordinates, as required by continuity on connected Hilbert spaces. + ## Scope and limitations -The graph represents **evaluator-relevant pairs**, rather than all Hilbert distances. Two vertices with the same observer code may be geometrically separated, and the extended observer need not have a Lipschitz inverse. The construction is thus compatible with the obstruction in family 098. Finite-dimensional ℓ1 extension with optimal universal constant, all graphs' robust coding numbers and the genuine compact doubling construction of family 098 remain separate questions. +The graph represents **evaluator-relevant pairs**, rather than all Hilbert distances. The COE-3 quotient incorporates local metric constraints before coding. Two vertices with the same observer code may be geometrically separated, and the extended observer need not have a Lipschitz inverse. The construction is thus compatible with the obstruction in family 098. Finite-dimensional ℓ1 extension with optimal universal constant, all graphs' robust coding numbers and the genuine compact doubling construction of family 098 remain separate questions. ## Reproduce -The companion reference in `MoralityLabAI/Compactification-Theory/research/chromatic_observer_gym_v1` implements exact graph coloring, minimal robust observer search, the explicit extension and regression tests. Its deterministic suite enumerates all 64 simple graphs on four vertices. The MathCan Lean module uses the repository's `leanprover/lean4:v4.35.0` `Init` toolchain and reports the transitive axioms of each finite lemma. Source results are not imported as axioms. +The companion reference in `MoralityLabAI/Compactification-Theory/research/chromatic_observer_gym_v1` implements exact graph coloring, minimal robust observer search, the explicit extension and regression tests. Its deterministic suite enumerates all 64 simple graphs on four vertices and checks metric-quotient equivalence, transitive forced identifications and strict threshold behavior. The MathCan Lean module uses the repository's `leanprover/lean4:v4.35.0` `Init` toolchain and reports the transitive axioms of each finite lemma. Source results are not imported as axioms. From c55e66d3325796c53db1dcdbe9e5c284e8f569d2 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sun, 15 Nov 2026 14:09:00 +0800 Subject: [PATCH 04/15] fix(COE-03): prove Boolean short-edge collapse by cases in Init --- MathCan/ChromaticObservers.lean | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MathCan/ChromaticObservers.lean b/MathCan/ChromaticObservers.lean index 4c919f9d..61917ac9 100644 --- a/MathCan/ChromaticObservers.lean +++ b/MathCan/ChromaticObservers.lean @@ -70,9 +70,7 @@ theorem binary_lipschitz_forces_identification (hshort : distance < threshold) (hlip : (if a = b then 0 else threshold) ≤ distance) : a = b := by - by_contra hne - simp [hne] at hlip - omega + cases a <;> cases b <;> simp_all <;> omega /-- Two short edges force equality at their endpoints, including when their direct distance is large. This models a metric-quotient chain. -/ From 62a857a4ad265d0138b13c7d69b5e8c28e9f1bb9 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sun, 15 Nov 2026 14:12:42 +0800 Subject: [PATCH 05/15] COE-04: prove critical Lipschitz threshold and chromatic staircase --- .../CHROMATIC_OBSERVER_THEOREM.md | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/research/compactification/CHROMATIC_OBSERVER_THEOREM.md b/research/compactification/CHROMATIC_OBSERVER_THEOREM.md index e5d59d90..ce1cb5c8 100644 --- a/research/compactification/CHROMATIC_OBSERVER_THEOREM.md +++ b/research/compactification/CHROMATIC_OBSERVER_THEOREM.md @@ -73,10 +73,35 @@ This result makes an additional obstruction explicit: *short-edge connectivity c For robust Hamming-margin r observables the same forced-identification quotient applies, because the output ℓ∞ distance of any distinct binary codes remains 1. The COE-2 color-repetition upper bound therefore holds on `G_Q` whenever the instance is feasible. An ambient Lipschitz extension takes values in the continuous cube; its intermediate points may have fractional coordinates, as required by continuity on connected Hilbert spaces. +## The exact critical Lipschitz constant and width staircase + +Let `rho(u,v)` denote the **minimum bottleneck distance** between distinct vertices of a finite metric space: + +``` + rho(u,v) = min_{finite paths u=x0,...,xm=v} + max_{0<=i0` for `u!=v`. The complete weighted graph supplies a path, so the minimum is attained. + +**Theorem COE-4 (exact feasible Lipschitz threshold).** For a nonempty evaluator edge set E, define + +``` + L_* = max_{uv in E} (1/rho(u,v)). +``` + +A finite-width, binary, `L`-Lipschitz evaluator observer exists **exactly when `L>=L_*`**, with equality included. If E is empty, every `L>=0` permits a constant observer; take `L_*=0`. For positive L in the feasible regime, define `k(L)` as the minimum bit count. Then `k(L)` is a nonincreasing, integer-valued staircase; its only possible jump locations lie among the reciprocals `1/d(x,y)` of the positive pairwise metric distances. The values at the jump locations use the **new**, weaker equivalence relation. + +*Proof.* Two vertices lie in one connected component of `H_L` if and only if they admit a path all of whose edge distances are **strictly** less than `1/L`. By finiteness, this holds exactly when `rho(u,v)<1/L`. Theorem COE-3 makes every evaluator edge feasible precisely when `rho(u,v)>=1/L`, i.e. `L>=1/rho(u,v)`. Taking their maximum gives the critical constant. At equality the strict short-edge condition excludes a bottleneck edge of length exactly `1/L`, so feasibility holds. If `L2>=L1>0`, any binary observer that satisfies the L1-Lipschitz bound also satisfies the L2 bound; minimizing over a larger feasible set shows `k(L2)<=k(L1)`. Finally `H_L` changes only when the strict inequality `d(x,y)<1/L` switches truth value at `L=1/d(x,y)`. Since G stays fixed, its quotient and hence chromatic width stay fixed between consecutive such thresholds. ∎ + +**Exact rational witnesses.** On line samples `0,3/5,6/5`, the bottleneck path from first to last has jump size `3/5`; `rho=3/5`, so an evaluator separating the endpoints has the exact critical constant `L_*=5/3`. At `L=49/30` it is impossible, while at `L=5/3` it admits a one-bit observer. A second example has line samples `0,3,6,1/5` and evaluator path edges `(0,1),(1,2),(2,3)`. At `L=1`, short-distance identification merges vertices 0 and 3, creating a triangle in the quotient and requiring two bits. At `L=5`, all four vertices separate and one bit suffices. The exact-rational Python oracle computes `rho` with min/max Floyd-Warshall and checks these cases separately from the observer solver. A further exhaustive four-state harness compares the bottleneck threshold with direct feasibility for each of 64 evaluator graphs across rational Lipschitz values, including exact critical equality. + +These statements concern **finite sampled metric spaces** and binary `ell_infinity` observables. The minimax bottleneck and graph-coloring principles are standard mathematical constructions; the combined evaluator-specific formulation is a research contribution to this program, with literature-wide priority unassessed. + ## Scope and limitations The graph represents **evaluator-relevant pairs**, rather than all Hilbert distances. The COE-3 quotient incorporates local metric constraints before coding. Two vertices with the same observer code may be geometrically separated, and the extended observer need not have a Lipschitz inverse. The construction is thus compatible with the obstruction in family 098. Finite-dimensional ℓ1 extension with optimal universal constant, all graphs' robust coding numbers and the genuine compact doubling construction of family 098 remain separate questions. ## Reproduce -The companion reference in `MoralityLabAI/Compactification-Theory/research/chromatic_observer_gym_v1` implements exact graph coloring, minimal robust observer search, the explicit extension and regression tests. Its deterministic suite enumerates all 64 simple graphs on four vertices and checks metric-quotient equivalence, transitive forced identifications and strict threshold behavior. The MathCan Lean module uses the repository's `leanprover/lean4:v4.35.0` `Init` toolchain and reports the transitive axioms of each finite lemma. Source results are not imported as axioms. +The companion reference in `MoralityLabAI/Compactification-Theory/research/chromatic_observer_gym_v1` implements exact graph coloring, minimal robust observer search, the explicit extension and regression tests. Its deterministic suite enumerates all 64 simple graphs on four vertices and checks metric-quotient equivalence, transitive forced identifications strict threshold behavior, exact critical Lipschitz values and a decreasing chromatic-width staircase. The MathCan Lean module uses the repository's `leanprover/lean4:v4.35.0` `Init` toolchain and reports the transitive axioms of each finite lemma. Source results are not imported as axioms. \ No newline at end of file From d3c3cd000ecb99f22f202cabd0408538a546d312 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sun, 15 Nov 2026 14:52:04 +0800 Subject: [PATCH 06/15] COE-02: Lean finite cut witnesses and unbounded integral-relaxation gap --- .github/workflows/coe02-cut-observers.yml | 42 ++++++ MathCan.lean | 1 + MathCan/ChromaticCutCodes.lean | 110 +++++++++++++++ .../CHROMATIC_CUT_CAPACITY.md | 126 ++++++++++++++++++ 4 files changed, 279 insertions(+) create mode 100644 .github/workflows/coe02-cut-observers.yml create mode 100644 MathCan/ChromaticCutCodes.lean create mode 100644 research/compactification/CHROMATIC_CUT_CAPACITY.md diff --git a/.github/workflows/coe02-cut-observers.yml b/.github/workflows/coe02-cut-observers.yml new file mode 100644 index 00000000..add26b3f --- /dev/null +++ b/.github/workflows/coe02-cut-observers.yml @@ -0,0 +1,42 @@ +name: COE-02 cut observer Lean and exact checks + +on: + pull_request: + paths: + - 'MathCan/ChromaticCutCodes.lean' + - 'MathCan.lean' + - 'research/compactification/CHROMATIC_CUT_CAPACITY.md' + - '.github/workflows/coe02-cut-observers.yml' + push: + branches: [main] + paths: + - 'MathCan/ChromaticCutCodes.lean' + - 'MathCan.lean' + - '.github/workflows/coe02-cut-observers.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + cut-certificate-kernel: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: leanprover/lean-action@v1 + with: + auto-config: false + build: true + build-args: MathCan + test: false + lint: false + use-mathlib-cache: false + - name: Check finite cut certificates and transitive axioms + shell: bash + run: | + set -euo pipefail + lake env lean MathCan/ChromaticCutCodes.lean | tee coe02-axioms.txt + if grep -Eq 'sorryAx|ofReduceBool' coe02-axioms.txt; then + echo 'Rejected: sorry or native reduction axiom in Lean proof.' + exit 1 + fi diff --git a/MathCan.lean b/MathCan.lean index 1b390fbb..0e5a6913 100644 --- a/MathCan.lean +++ b/MathCan.lean @@ -33,3 +33,4 @@ import MathCan.TreeReconstruction import MathCan.CoarseStateDependence import MathCan.TacticFibers import MathCan.ChromaticObservers +import MathCan.ChromaticCutCodes diff --git a/MathCan/ChromaticCutCodes.lean b/MathCan/ChromaticCutCodes.lean new file mode 100644 index 00000000..ad9b332e --- /dev/null +++ b/MathCan/ChromaticCutCodes.lean @@ -0,0 +1,110 @@ +import Init + +/-! +COE-02: exact finite certificates for integer-cut observers. + +This module checks K5's five-state/three-bit antipodal obstruction, +the sharp four-bit code at ell_1 distance budget two, and balanced-cut +identities underlying the fractional relaxation optimum 5/3. + +The general integer cut theorem, anticode bound and unbounded integrality +gap have written proofs in CHROMATIC_CUT_CAPACITY.md. This Init-only +module establishes selected finite examples, not those general theorems. +-/ + +namespace MathCan.ChromaticCutCodes + +set_option maxRecDepth 4096 +set_option maxHeartbeats 1000000 + +def hamming (width a b : Nat) : Nat := + ((List.range width).filter (fun i => a.testBit i != b.testBit i)).length + +/-- Five pairwise separated words realizing the L=2 equilateral K5 budget. -/ +def k5Witness (v : Fin 5) : Nat := + match v.val with + | 0 => 0 + | 1 => 1 + | 2 => 2 + | 3 => 4 + | _ => 8 + +theorem k5_witness_within_four_bits : + ∀ v : Fin 5, k5Witness v < 2 ^ 4 := by + decide + +theorem k5_witness_pairwise_margin_and_cap : + ∀ u v : Fin 5, u ≠ v → + 1 ≤ hamming 4 (k5Witness u) (k5Witness v) ∧ + hamming 4 (k5Witness u) (k5Witness v) ≤ 2 := by + decide + +/-- Three-bit antipodal pairs, namely (0,7),(1,6),(2,5),(3,4). -/ +theorem three_cube_antipodes_distance_three : + ∀ v : Fin 4, hamming 3 v.val (7 - v.val) = 3 := by + decide + +/-- Any five selected words from the 3-cube contain an antipodal pair. + The mask ranges over all 256 subsets of the eight three-bit words. -/ +theorem five_three_bit_words_force_antipodal_pair : + ∀ subset : Fin 256, + 5 ≤ ((List.range 8).filter (fun w => subset.val.testBit w)).length → + ((List.range 4).any (fun i => + subset.val.testBit i && subset.val.testBit (7 - i))) = true := by + decide + +/-- A balanced cut on five states contains 2 or 3 states and is + canonically oriented to exclude state zero. -/ +def balancedCut5 (mask : Nat) : Bool := + let count := ((List.range 5).filter (fun i => mask.testBit i)).length + (mask.testBit 0 == false) && (count == 2 || count == 3) + +def splits5 (mask u v : Nat) : Bool := + mask.testBit u != mask.testBit v + +def balanceSplitCount (u v : Nat) : Nat := + ((List.range 32).filter (fun mask => + balancedCut5 mask && splits5 mask u v)).length + +def cutPairCount5 (mask : Nat) : Nat := + ((List.range 5).flatMap (fun u => + (List.range 5).filter (fun v => + decide (u < v) && splits5 mask u v))).length + +theorem ten_balanced_cuts_on_five_points : + ((List.range 32).filter balancedCut5).length = 10 := by + decide + +theorem each_pair_crosses_six_balanced_cuts : + ∀ u v : Fin 5, u ≠ v → balanceSplitCount u.val v.val = 6 := by + decide + +theorem every_five_state_cut_crosses_at_most_six_pairs : + ∀ mask : Fin 32, cutPairCount5 mask.val ≤ 6 := by + decide + +theorem balanced_cuts_cross_exactly_six_pairs : + ∀ mask : Fin 32, balancedCut5 mask.val = true → + cutPairCount5 mask.val = 6 := by + decide + +/-- Cross-multiplied exact equality 10*(1/6) = 5/3. -/ +theorem k5_fractional_mass_cross_multiplication : 10 * 3 = 5 * 6 := by + decide + +/-- The sharp K5 integer / fractional ratio equals 12/5. -/ +theorem k5_integrality_ratio_cross_multiplication : 4 * 3 = 12 := by + decide + +#print axioms k5_witness_within_four_bits +#print axioms k5_witness_pairwise_margin_and_cap +#print axioms three_cube_antipodes_distance_three +#print axioms five_three_bit_words_force_antipodal_pair +#print axioms ten_balanced_cuts_on_five_points +#print axioms each_pair_crosses_six_balanced_cuts +#print axioms every_five_state_cut_crosses_at_most_six_pairs +#print axioms balanced_cuts_cross_exactly_six_pairs +#print axioms k5_fractional_mass_cross_multiplication +#print axioms k5_integrality_ratio_cross_multiplication + +end MathCan.ChromaticCutCodes diff --git a/research/compactification/CHROMATIC_CUT_CAPACITY.md b/research/compactification/CHROMATIC_CUT_CAPACITY.md new file mode 100644 index 00000000..1e618a58 --- /dev/null +++ b/research/compactification/CHROMATIC_CUT_CAPACITY.md @@ -0,0 +1,126 @@ +# COE-02: integer cut capacity, stable binary probes and an unbounded relaxation gap + +**Date:** 2026-11-15. **Research status:** self-contained new-to-program mathematics with exact small-instance witnesses. No claim of literature-wide priority. The general finite-metric and equilateral theorems below have written proofs; the companion Lean module certifies selected finite cases, not the general statements. + +## Motivation and sources + +This develops [COE-01](CHROMATIC_OBSERVER_THEOREM.md), which was motivated by two manuscripts in OpenAI's October 2026 mathematics collection: + +* [#098, A doubling Hilbert subset with no finite-dimensional bi-Lipschitz embedding](https://github.com/openai/math/blob/4eaee87548250b2682affda7d05d947c05554bae/preprints/A-doubling-Hilbert-subset-with-no-finite-dimensional-bi-Lipschitz-embedding-September-25-2026/main.pdf). Global metric reconstruction can be impossible even for doubling Hilbert subsets. +* [#332, Metric Markov Cotype Two of ℓ1](https://github.com/openai/math/blob/4eaee87548250b2682affda7d05d947c05554bae/preprints/Metric-Markov-Cotype-Two-of-l1-October-5-2026/l1-markov-cotype.pdf). The manuscript claims a universal-loss extension of ℓ1-valued Lipschitz maps defined on Hilbert subsets. + +COE-01 controls binary observers in `ell_infinity`, where any two distinct bitwords are exactly distance one. The present result controls the **whole feature-distance budget in `ell_1`**, where every bit that changes across a pair consumes one unit. It is a finite combinatorial theorem established without assuming the claimed source-paper theorems. An infinite-dimensional Lipschitz extension is a separate question. + +## COE-5: exact integer cut-capacity formulation + +Let `(X,d)` be a nonempty finite metric space of `n` distinct states, with evaluator graph `E` and desired Hamming margin `r >= 1`. A binary observer `c:X -> {0,1}^k` is admissible at Lipschitz budget `L >= 0` when + +``` + d_H(c(u),c(v)) >= r for uv in E + d_H(c(u),c(v)) <= L * d(u,v) for all distinct u,v in X. +``` + +Choose one representative from every nonconstant cut `S | X\S`, orienting cuts so a designated state `x0` lies outside `S`. Write `delta_S(u,v)=1` when exactly one of `u,v` belongs to `S`, and zero otherwise. Let `B_uv=floor(L*d(u,v))` for all unordered distinct pairs. + +**Theorem (exact finite integer program).** An admissible width-`k` observer exists if and only if there are nonnegative integer cut multiplicities `m_S` satisfying + +``` + sum_S m_S*delta_S(u,v) >= r for uv in E + sum_S m_S*delta_S(u,v) <= B_uv for all distinct u,v + sum_S m_S <= k. +``` + +Consequently, the minimum width equals the minimum `sum_S m_S` over feasible integer cut multiplicities. If no feasible multiplicities exist, no finite width can satisfy the task under the specified `ell_1` Lipschitz budget. + +*Proof.* Each nonconstant coordinate of a binary observer partitions X into its zero-set and one-set. Complement the coordinate if necessary to place `x0` in the zero-set. Its contribution to Hamming distance on `(u,v)` is precisely `delta_S(u,v)`. Grouping repeated cuts produces the integers `m_S`. Constant coordinates can be removed. Conversely, repeat the indicator of each cut `S` exactly `m_S` times. The resulting words have the stipulated pairwise Hamming distances. Integer-valued distances satisfy `D_uv<= L*d_uv` precisely when `D_uv<=floor(L*d_uv)`. Adding at most `k-sum m_S` constant bits gives exact width `k`, if requested. ∎ + +**Finite-decision corollary.** Any feasible solution with nonconstant coordinates obeys + +``` + (n-1) * sum_S m_S <= sum_{u= n-1` unordered pairs. Thus a finite BFS over pair-load vectors `D_uv in {0,...,B_uv}` is a complete decision procedure. The companion oracle deduplicates identical load vectors and returns a minimum-width cut multiset. A user-specified search-size guard raises an explicit resource exception rather than reporting infeasibility. + +## COE-6: dual lower certificates + +Take nonnegative rational evaluator weights `alpha_e`, and nonnegative rational pair weights `beta_p`. Suppose **every** nontrivial cut obeys + +``` + sum_{e in E} alpha_e * delta_S(e) + <= 1 + sum_{p in pairs(X)} beta_p * delta_S(p). +``` + +Then every admissible binary observer satisfies the checkable lower bound + +``` + k >= ceil(r * sum_e alpha_e - sum_p beta_p * B_p). +``` + +*Proof.* Multiply each cut inequality by its integer multiplicity `m_S` and sum over S. The lower margin constraints imply the left side is at least `r sum_e alpha_e`. The total cut count contributes `k`, while the pair capacity terms are at most `sum_p beta_p B_p`. Rearranging yields the bound. ∎ + +This certificate uses rational arithmetic and a finite enumeration of all canonical cuts. It can certify width lower bounds without trusting an optimization solver's internal search. Integrality can require stronger obstructions than these linear certificates. + +## COE-7: exact equilateral feasibility and width cliffs + +Consider an equilateral space of `n>=2` points, `d(u,v)=1` for `u!=v`, with `r=1`. + +**Theorem (Lipschitz phase at 1 and 2).** For a nonempty evaluator graph G: + +* `L<1`: the evaluator is infeasible. +* `1<=L<2`: an observer exists exactly when G is bipartite; when it exists, minimum width is 1. +* `L>=2`: every finite evaluator graph is feasible; at `L=2`, width is at most `chi(G)-1` by assigning the zero word and distinct unit words to its colors. + +*Proof.* An evaluator edge demands one Hamming unit, hence `L>=1`. If `L<2`, the integer pair capacities equal one. A subset of a Hamming cube with all pairwise distances at most one has at most two distinct words: after XOR-translating one word to zero, all other words have Hamming weight one, and two different unit words are distance two. Therefore all evaluator distinctions can be represented only by a two-coloring. A bipartition supplies the corresponding one-bit observer. At `L=2`, assign the first color zero and the others separate unit words. Their pairwise distances lie in `{0,1,2}`, with edges separated. ∎ + +An odd evaluator cycle is therefore infeasible at `L=1` **regardless of how many binary probes are supplied**, despite every direct metric distance meeting the single-edge requirement. This is a global parity/cube-geometry obstruction absent from the `ell_infinity` observer theorem. + +**Theorem (sharp complete-graph cost at L=2).** For the complete evaluator `K_n` on the equilateral metric, the minimum binary width at `L=2`, `r=1`, is + +``` + k(K_2)=1, k(K_3)=2, k(K_4)=2, + k(K_n)=n-1 for every n>=5. +``` + +*Proof.* An admissible `K_n` observer assigns `n` distinct vertices of a k-dimensional binary cube whose diameter is at most two. For `k=1` there are at most two words, and for `k=2` at most four. For `k>=3`, any diameter-two subset `A` has size at most `k+1`. To prove this, XOR-translate so `0 in A`; every remaining word has weight one or two. If there are no weight-two words, at most `k` unit words remain. Otherwise the family F of supports of weight-two words consists of pairwise intersecting 2-subsets. Unit words can use only coordinates in the intersection of all members of F. If F is a singleton then `|A|<=4<=k+1`. If F has a common coordinate and at least two members, F is a star of size at most `k-1`, and at most its central unit word may occur, so `|A|<=k+1`. If F has empty total intersection, any pairwise-intersecting family of 2-subsets is a triangle with at most three members, and no unit word is allowed, giving `|A|<=4<=k+1`. Thus `n<=k+1` for `k>=3`. The zero word together with `n-1` distinct unit words attains dimension `n-1`; `K_4` is realized by the whole two-bit cube. ∎ + +For `K_5`, **`ell_infinity` at `L=1` needs 3 bits**, while **`ell_1` at `L=2` needs 4** and **`ell_1` at `L=3` needs 3**. Exact words at `L=2`: `0000,0001,0010,0100,1000`. The three-bit lower bound at `L=2` has a simpler finite proof: among five selected vertices of the 3-cube, two must be antipodal, hence distance three. Lean checks the 256-subset-mask pigeonhole certificate and the four-bit constructive witness. + +## COE-8: unbounded integrality gap of soft cut relaxation + +Relax COE-5 by allowing real `m_S >= 0`. This is a *fractional cut-mass relaxation*, not a physical number of binary coordinates. Let `N=binom(n,2)` and `C=floor(n^2/4)`, and retain the equilateral complete evaluator `K_n` at `L=2`, `r=1`. + +**Theorem (sharp fractional optimum).** The fractional program has optimum exactly + +``` + LP_n = N/C. +``` + +*Proof.* Every cut crosses at most `C` of the `N` unordered pairs. Summing the `N` evaluator lower bounds yields `N<= C * sum_S m_S`, giving `LP_n>=N/C`. For equality, take every balanced unordered partition `S|X\S` with `|S|` equal to either `floor(n/2)` or `ceil(n/2)`. Every such cut crosses exactly `C` pairs. There are `T` balanced cuts, and permutation symmetry shows that each pair is crossed by exactly `T*C/N` of them. Give each balanced cut weight `N/(T*C)`. Every pair then has fractional load exactly one, satisfying both lower bound one and upper capacity two; total cut weight is `N/C`. ∎ + +Combining this with the integer anticode theorem gives an **unbounded multiplicative integrality gap** for every `n>=5`: + +``` + integer_optimum / LP_n + = (n-1) * floor(n^2/4) / binom(n,2) + = 2 * floor(n^2/4) / n ~ n/2. +``` + +For `K_5`, the ten balanced cuts each receive weight `1/6`; every pair has load 1, so the fractional value is `10/6=5/3`. The smallest realizable binary observer has width 4, a gap of `12/5=2.4`. The all-edge dual weights `alpha_e=1/6` and `beta_p=0` certify the exact fractional optimum `5/3` from the COE-6 inequalities. More generally, `alpha_e=1/C` gives the sharp dual fractional certificate on `K_n`. + +A soft allocation of fractional cut-mass can therefore assign a dimension-like cost bounded near two while quantization into individual binary features costs linearly many coordinates. The mathematical source of the gap is Hamming cube geometry. Whether a particular SAE or recurrent probe exhibits a comparable learning gap is an experimental question. + +## COE-9: finite Lipschitz width staircase + +As `L` increases, all pair capacities `B_uv=floor(Ld_uv)` weakly increase. The admissible set of integer cut multisets therefore expands, so the exact minimum width (where defined) is nonincreasing. A change can occur only when some `L*d_uv` passes an integer, i.e. at `L=h/d_uv` with positive integer h. All breakpoints are included at equality. This is a distinct staircase from COE-04's `ell_infinity` bottleneck-quotient staircase; neither requires a closed-form coloring algorithm for the general `ell_1` case. + +## Applied benchmark, validation and scope + +The companion [Compactification-Theory COE-02 gym](https://github.com/MoralityLabAI/Compactification-Theory/tree/feat/coe01-chromatic-observer-20261115/research/chromatic_observer_gym_v1) adds exact cut enumeration, load-vector BFS, independently checked rational lower certificates, a frozen activation/evaluator JSON adapter, and a synthetic `K_5` one-hot latent fixture. + +* The frozen fixture has five mutually equidistant rational `ell_1` prototypes; it is explicitly **synthetic** and is not a trained-model or SAE activation capture. +* Ten local unittest methods pass. An independent brute-force word enumerator agrees with the cut-BFS oracle on all 8 three-vertex evaluator graphs, for Lipschitz budgets `0,1,2` and margins `1,2`. +* The checks include exact `K_5` Pareto points, the odd-cycle infeasibility certificate, rational line-metric threshold equality, dual-weight rejection, and exact balanced-cut identities for `2<=n<=9`. +* The Lean module checks finite `K_5` cut counts, 3-bit antipodal obstruction and explicit 4-bit witness under the pinned toolchain. General finite-metric, equilateral anticode and fractional-optimum theorems currently have written proofs only. + +For transfer to looped transformers or SAEs, freeze a checkpoint and a held-out evaluator edge set, extract a **small** fixed collection of activation vectors, and preserve the metric/probe convention in the report. Compare best symbolic width with the performance of fitted continuous probes before binary quantization and after it. Report causal intervention outcomes separately. The present result gives a mathematical capacity boundary for this protocol; it supplies no empirical transformer capability claim. From 5b935839b3aac890ae3f76cbcece651c762abea5 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sun, 15 Nov 2026 15:29:47 +0800 Subject: [PATCH 07/15] COE-03: proof of sharp soft precision and temporal capacity with finite Lean cells --- .github/workflows/coe03-soft-observers.yml | 42 +++++++ MathCan.lean | 1 + MathCan/SoftObserverPrecision.lean | 110 ++++++++++++++++++ .../compactification/SOFT_PRECISION_DEPTH.md | 100 ++++++++++++++++ 4 files changed, 253 insertions(+) create mode 100644 .github/workflows/coe03-soft-observers.yml create mode 100644 MathCan/SoftObserverPrecision.lean create mode 100644 research/compactification/SOFT_PRECISION_DEPTH.md diff --git a/.github/workflows/coe03-soft-observers.yml b/.github/workflows/coe03-soft-observers.yml new file mode 100644 index 00000000..e6905f99 --- /dev/null +++ b/.github/workflows/coe03-soft-observers.yml @@ -0,0 +1,42 @@ +name: COE-03 soft probe finite Lean certificates + +on: + pull_request: + paths: + - 'MathCan/SoftObserverPrecision.lean' + - 'MathCan.lean' + - 'research/compactification/SOFT_PRECISION_DEPTH.md' + - '.github/workflows/coe03-soft-observers.yml' + push: + branches: [main] + paths: + - 'MathCan/SoftObserverPrecision.lean' + - 'MathCan.lean' + - '.github/workflows/coe03-soft-observers.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + lean-kernel: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: leanprover/lean-action@v1 + with: + auto-config: false + build: true + build-args: MathCan + test: false + lint: false + use-mathlib-cache: false + - name: Kernel and axiom inventory for COE-03 + shell: bash + run: | + set -euo pipefail + lake env lean MathCan/SoftObserverPrecision.lean | tee coe03-axioms.txt + if grep -Eq 'sorryAx|ofReduceBool' coe03-axioms.txt; then + echo 'Unexpected admitted proof or reduction axiom' + exit 1 + fi diff --git a/MathCan.lean b/MathCan.lean index 0e5a6913..2b63cc4c 100644 --- a/MathCan.lean +++ b/MathCan.lean @@ -34,3 +34,4 @@ import MathCan.CoarseStateDependence import MathCan.TacticFibers import MathCan.ChromaticObservers import MathCan.ChromaticCutCodes +import MathCan.SoftObserverPrecision diff --git a/MathCan/SoftObserverPrecision.lean b/MathCan/SoftObserverPrecision.lean new file mode 100644 index 00000000..5643cd2e --- /dev/null +++ b/MathCan/SoftObserverPrecision.lean @@ -0,0 +1,110 @@ +import Init + +/-! +COE-03: finite Lean certificates for precision–time observer capacity. + +The general probabilistic O(log n) construction, volume lower bound, +precise b=Theta(log log n) necessity, and diameter-two anticode bound +are given with proofs in research/compactification/SOFT_PRECISION_DEPTH.md. +This Init-only file kernel-checks specific independently reproducible cells. +No original OpenAI manuscript is imported as an axiom. +-/ + +namespace MathCan.SoftObserverPrecision + +set_option maxRecDepth 8192 +set_option maxHeartbeats 2000000 + +/-- Distances are computed in numerator units, with denominator 3. -/ +def softCoord (state : Fin 5) (coord : Fin 3) : Nat := + if state.val == 4 then 1 + else if state.val == coord.val + 1 then 3 + else 0 + +def absNat (a b : Nat) : Nat := (a - b) + (b - a) + +def softDistanceNum (a b : Fin 5) : Nat := + ((List.finRange 3).map (fun j => + absNat (softCoord a j) (softCoord b j))).sum + +/-- The five numerators represent 0,e1,e2,e3 and (1/3,1/3,1/3). -/ +theorem soft_five_in_cube : + ∀ v : Fin 5, ∀ j : Fin 3, softCoord v j ≤ 3 := by + decide + +/-- Every pair has normalized L1 distance in [1,2] with 3 heads. -/ +theorem soft_five_all_pairs_separated_and_bounded : + ∀ u v : Fin 5, u ≠ v → + 3 ≤ softDistanceNum u v ∧ softDistanceNum u v ≤ 6 := by + decide + +/-- A three-bit binary word has at most eight possibilities. -/ +def hamming (width a b : Nat) : Nat := + ((List.range width).filter (fun j => a.testBit j != b.testBit j)).length + +/-- Thresholds 0,1,2,3 on numerator values represent every possible + coordinatewise binary threshold pattern for data in {0,1,3}. + A threshold >3 is equivalent to t=3 if 3 were replaced by 4; + here we use Fin 5 to cover thresholds 0,1,2,3,4 explicitly. -/ +def thresholdWord (t0 t1 t2 : Fin 5) (v : Fin 5) : Nat := + (if t0.val ≤ softCoord v (0 : Fin 3) then 1 else 0) + + (if t1.val ≤ softCoord v (1 : Fin 3) then 2 else 0) + + (if t2.val ≤ softCoord v (2 : Fin 3) then 4 else 0) + +/-- All coordinatewise binary threshold patterns fail at least one K5 + pair: they either collide, or their Hamming distance exceeds two. + This is a finite statement over 5^3=125 discrete threshold choices. -/ +theorem all_coordinate_thresholds_fail : + ∀ t0 t1 t2 : Fin 5, + ∃ u v : Fin 5, u ≠ v ∧ + (hamming 3 (thresholdWord t0 t1 t2 u) (thresholdWord t0 t1 t2 v) = 0 ∨ + 3 ≤ hamming 3 (thresholdWord t0 t1 t2 u) (thresholdWord t0 t1 t2 v)) := by + decide + +/-- Five states need only four *binary* channels under Hamming cap two. -/ +def binaryK5 (v : Fin 5) : Nat := + if v.val == 0 then 0 else 2 ^ (v.val - 1) + +theorem binary_five_four_head_witness : + ∀ u v : Fin 5, u ≠ v → + 1 ≤ hamming 4 (binaryK5 u) (binaryK5 v) ∧ + hamming 4 (binaryK5 u) (binaryK5 v) ≤ 2 := by + decide + +/-- Six states occupy 2 output bits at each of three externally clocked steps. -/ +def temporalWord (v : Fin 6) (tick : Fin 3) : Nat := + if v.val == 2 * tick.val + 1 then 1 + else if v.val == 2 * tick.val + 2 then 2 + else 0 + +def transcriptDistance (a b : Fin 6) : Nat := + ((List.finRange 3).map (fun tick => + hamming 2 (temporalWord a tick) (temporalWord b tick))).sum + +theorem six_states_two_heads_three_ticks : + ∀ u v : Fin 6, u ≠ v → + 1 ≤ transcriptDistance u v ∧ transcriptDistance u v ≤ 2 := by + decide + +/-- The independent 1,024-state Python certificate has extreme raw Hamming + distances 91 and 168 at scale 12/1023. The Lean theorem checks the + resulting rational inequalities, rather than the 523,776 raw pairs. -/ +theorem pinned_grid_extrema_within_margin_and_budget : + 1023 ≤ 91 * 12 ∧ 168 * 12 ≤ 2 * 1023 := by + decide + +/-- Coordinatewise scalar extension costs at most k*a; the finite grid + witness has k*a = 3072/1023 < 4. -/ +theorem pinned_grid_extension_constant_below_four : + 256 * 12 < 4 * 1023 := by + decide + +#print axioms soft_five_in_cube +#print axioms soft_five_all_pairs_separated_and_bounded +#print axioms all_coordinate_thresholds_fail +#print axioms binary_five_four_head_witness +#print axioms six_states_two_heads_three_ticks +#print axioms pinned_grid_extrema_within_margin_and_budget +#print axioms pinned_grid_extension_constant_below_four + +end MathCan.SoftObserverPrecision diff --git a/research/compactification/SOFT_PRECISION_DEPTH.md b/research/compactification/SOFT_PRECISION_DEPTH.md new file mode 100644 index 00000000..02bf895b --- /dev/null +++ b/research/compactification/SOFT_PRECISION_DEPTH.md @@ -0,0 +1,100 @@ +# COE-03: the precision–time trichotomy for task-relative observers + +**15 November 2026. Status:** self-contained mathematical derivation, exact finite rational certificates, an exploratory synthetic training pilot, and small Lean kernel witnesses. Literature-wide originality is unassessed. No assertion of original OpenAI manuscript proof verification or trained-language-model capability. + +## Motivation and provenance + +Continue [COE-01](CHROMATIC_OBSERVER_THEOREM.md) and [COE-02](CHROMATIC_CUT_CAPACITY.md). Their source pair is OpenAI's September–October 2026 Math [family 098](https://github.com/openai/math/blob/4eaee87548250b2682affda7d05d947c05554bae/lean/docs/098.md), on the limitations of bi-Lipschitz dimension reduction, and [family 332](https://github.com/openai/math/blob/4eaee87548250b2682affda7d05d947c05554bae/preprints/Metric-Markov-Cotype-Two-of-l1-October-5-2026/README.md), on the extension of Hilbert-subset Lipschitz maps to ℓ1. The theorems below use elementary finite coding, packing, Hoeffding's inequality, and coordinatewise McShane extension; the statements of families 098 and 332 are motivation rather than assumed lemmas. + +We seek an output code `f:X→[0,1]^k` on `n` equilateral states, with `d_X(u,v)=1` for `u≠v`, such that every evaluator pair is distinguished by an ℓ1 output margin of at least 1 and output Lipschitz budget at most 2: + +``` + 1 <= ||f(u)-f(v)||_1 <= 2 (u != v). +``` + +This is a complete evaluator graph `K_n`. We distinguish *numeric coordinates*, their *precision*, and *time steps*, rather than counting every numeric coordinate as a single Boolean bit. + +## COE-03.1: binary, continuous, and temporal capacity + +**Theorem (three resource regimes).** For every integer `n>=5`: + +1. A one-shot binary observer `f:X→{0,1}^k` has the displayed ℓ1 margin and budget **if and only if** `k>=n-1`. The construction uses `0,e_1,...,e_(n-1)`; any surplus coordinates may be set to zero. +2. The minimum width of a one-shot *real-valued* observer with the displayed margin and budget is `Theta(log n)` as `n→∞`. In particular, if the integer `k>=3` satisfies `k>18 ln(n(n-1))`, there is a code in `{0,3/k}^k` with every pair's ℓ1 distance in `[1,2]`. Any such finite code extends to every ambient metric space containing X as a function into `[0,3/k]^k` with **global ℓ1 Lipschitz constant at most 3**, independently of n and k. +3. Suppose a deterministic recurrent observer emits `w` Boolean coordinates per time step for T steps. Its evaluator receives the **entire concatenated transcript**, and the *total* ℓ1 distance between every pair of transcripts must remain in `[1,2]`. Then `wT>=n-1` is necessary and sufficient. A time-multiplexed one-hot code attains `T=ceil((n-1)/w)`, provided the latent state remains accessible at each step. The lower bound applies even when later Boolean outputs are chosen adaptively from earlier outputs. + +**Binary proof.** Let `C⊂{0,1}^k` have `1<=d_H(x,y)<=2` for all distinct members. XOR-translate a member to 0. All remaining words have Hamming weight 1 or 2. Write T for the singleton supports and F for the two-element supports. Any two members of F intersect; each member of T must belong to every member of F. If `|T|=1`, all pairs in F are incident to its element, giving `|C|<=1+1+(k-1)=k+1`. If `|T|>=2`, there is at most one member of F, and when `|T|>=3` there are none, again giving at most k+1. If T is empty, any pairwise-intersecting family of 2-subsets is either a star of size at most k-1 or (if it has no common element) a subset of the three edges of a triangle. For `k>=3`, `|C|<=1+max(k-1,3)<=k+1`. If F is empty then `|C|<=1+k`. Widths `k<=2` can encode at most four states outright; for `n>=5` the bound follows. One zero word plus the k unit words achieves n=k+1. + +**Real-valued upper bound.** Independently choose k fair bits for each of n states. A fixed pair's Hamming distance `D` is `Binomial(k,1/2)`. Hoeffding gives + +``` +Pr[D <= k/3 or D >= 2k/3] <= 2 exp(-k/18). +``` + +The union bound over `n(n-1)/2` pairs gives failure probability at most `n(n-1) exp(-k/18)<1` under the stated strict k inequality. Therefore some assignment satisfies `k/3 <= D <= 2k/3` for all pairs. Scale the 1 entries by `a=3/k`: every ℓ1 pair distance `aD` lies in `[1,2]`. On the equilateral finite set, each scalar coordinate is a-Lipschitz. The clipped McShane extension + +``` +F_j(z) = clip_[0,a] min_(u in X) {f_j(u)+a*d(z,u)} +``` + +agrees with the finite data and is globally a-Lipschitz. Sum over k scalar coordinates: `||F(z)-F(z')||_1 <= ka*d(z,z')=3*d(z,z')`. The finite observer itself has Lipschitz constant at most 2, with an explicit ambient extension of constant at most 3. This is a constructive, specialized extension and requires no appeal to source family 332. + +**Real-valued lower bound.** Choose a center among the n output points. Every point lies in its ℓ1 radius-2 ball. The open ℓ1 balls of radius 1/2 centered at the n outputs are pairwise disjoint in k-dimensional space, and all lie inside an ℓ1 ball of radius 5/2 around the center. By scaling Lebesgue volume, `n(1/2)^k <= (5/2)^k`, so `n<=5^k` and `k>=log_5 n`. Together with the probabilistic construction, minimal real coordinate width is `Theta(log n)`. This lower bound allows *any* real output amplitudes in `[0,1]`, not merely the two-level construction. + +**Temporal proof.** Concatenation turns any deterministic `w`-coordinate, T-step transcript (including adaptive policies) into a length-`wT` binary word. Its aggregate ℓ1 distance equals the Hamming distance of the flattened word. The binary bound above yields `n<=wT+1`. For sufficiency, assign a distinct one-hot bit to each of n-1 states, assign 0 to the remaining state, and partition the bit positions into T successive blocks of width w. The resulting full transcripts have distances 1 or 2. The proof assumes externally available repeated state access and full-transcript evaluation; it makes no claim about the internal recurrent state memory required to implement this schedule. + +## COE-03.2: finite-grid precision is asymptotically necessary + +Let the observer values lie on the uniform `b`-bit grid `G_q={0,1/q,...,1}`, where `q=2^b-1` and `b>=1`. + +**Theorem (precision upper and lower bounds).** For every n>=5 there exists a `b`-bit-grid observer satisfying the pair-distance conditions with + +``` + k > 50 ln(n(n-1)), + q = 2^b-1 >= 2k, + b = ceil(log2(2k+1)) = O(log log n), + k = O(log n). +``` + +It has an ambient global ℓ1 Lipschitz extension of constant at most 3. Conversely, for any such grid observer, regardless of its construction, + +``` + n <= (1+kq)^(2q). (†) +``` + +Consequently, if `k<=C ln n` for a fixed constant C as n grows, its precision must satisfy `b=Omega(log log n)`. Thus **the smallest asymptotic grid precision among logarithmic-width observers is Theta(log log n)**, with the upper and lower bounds proved here under the margin-one/budget-two assumptions. + +**Upper-bound proof.** Choose independent fair bits as above but use deviations `k/10` instead of `k/6`. With `k>50 ln(n(n-1))`, positive probability remains that every pair has `2k/5 <= D <= 3k/5`. Set + +``` + A = ceil(5q/(2k)), a = A/q. +``` + +Since `q>=2k`, `5/(2k)<=a<=5/(2k)+1/q<=3/k`. All pair distances satisfy `1 <= a D <= 9/5`; coordinate values are in `G_q`, and clipped coordinatewise McShane extension gives global Lipschitz constant `ka<=3`. + +**Lower-bound proof.** Multiply each grid codeword by q to get an integer vector in `{0,...,q}^k`. Fix any state 0. As all distances from it are at most 2, each other vector differs from it in at most `2q` coordinates, because a changed integer coordinate contributes at least 1 to the sum of absolute differences. Encode a vector by its sorted list of modified `(coordinate, new value)` pairs, padded to length `2q` with a sentinel. There are at most `kq` possible modifications (each coordinate has at most q alternatives), plus the sentinel. This encoding is injective, giving (†). If `k<=C ln n` and `q<=ln n`, then + +``` + ln n <= 2q ln(1+kq) <= 2q ln(1+C(ln n)^2), +``` + +so `q >= ln n/[2 ln(1+C(ln n)^2)] = Omega(ln n/ln ln n)`. For `q>ln n` the same asymptotic lower bound holds. Taking `b=log2(q+1)` yields `b>=log2(ln n)-O(log2 ln ln n)`, hence `b=Omega(log log n)`. The probabilistic construction completes the matching order claim. + +**Interpretation.** Width and precision impose different geometric constraints on a quantized probe. A 10-bit *numeric* feature counts as ten stored bits if fully materialized. The theorem is about width as a count of observed scalar coordinates, conditional on their value alphabet and ℓ1 budget; it does not say the total bit budget `kb` is asymptotically smaller than a binary code's bit budget. + +## COE-03.3: finite exact and trained synthetic cells + +**Exact K5 soft certificate.** Code the five states in three channels as + +``` + (0,0,0), (1,0,0), (0,1,0), (0,0,1), (1/3,1/3,1/3). +``` + +The ten pair distances are 1, 4/3, or 2. No three-bit binary observer can achieve the same full `K5` margin and cap; the binary anticode theorem requires four channels. All 64 independent coordinatewise threshold-pattern combinations for this particular soft certificate fail either separation or the distance cap. The MathCan Lean module checks the exact numerator arithmetic and its finite threshold statement; the general asymptotic proofs remain in this manuscript. + +**Reproducible n=1024 finite grid.** Choose `n=1024`, `k=256`, pseudo-random seed 2305, Python `random.Random(seed).getrandbits(k)` for each state, and amplitude `a=12/1023=4/341`, corresponding to ten-bit grid levels. The independently replayed integer Hamming extrema are `91` and `168` across all 523,776 pairs. Therefore every output distance is in `[364/341,672/341]`, a subset of `[1,2]`. Coordinatewise extension gives global ℓ1 Lipschitz bound `k*a=1024/341<4`. The fixed SHA-256 digest (which includes the parameters and all word bytes) is `2a99809deb1babd57d9d10e959775429470fafa90d390331b6d82f6f581dd5eb`. The n=1024 sample is an **exact finite certificate**, separate from the existence bound's worst-case sufficient constants. Thresholding at 1/2 sends every small-amplitude coordinate to zero. Thresholding below a preserves the original high-Hamming words and violates the total ℓ1 cap of 2. + +**CPU training pilot.** A linear three-output probe on five fixed one-hot states is trained with projected subgradient descent, learning rate 0.45, maximum 4,000 steps, deterministic seeds 0 through 9. Each pairwise loss is squared hinge distance outside `[1,2]`. Stopping loss is below `1e-12`, with evaluation tolerance `1e-3`. When all ten edges train, 10/10 seeds meet the soft constraint; binarizing all coordinates at 1/2 yields 0/10 full-K5 valid codes. With exploratory holdout edges `(0,4),(1,3),(2,4)`, all ten fit the seven training pairs, and 2/10 satisfy the three withheld pairs. This split was considered during exploratory analysis and is **not a preregistered generalization claim**. All reported cases are synthetic and trained in the CPU sandbox; no language model, SAE checkpoint, mechanistic intervention, or real validation cohort was used. + +## Next research gate + +Extract deterministic frozen activation states from a named looped-transformer checkpoint. Define evaluator edges using intervention outcomes before selecting or tuning probes. Quantize features at fixed output scales and compare (i) edge coverage (ii) Lipschitz usage (iii) numerical precision (iv) aggregation horizon. Evaluate under a held-out task split, and report actual storage bits and runtime separately from observer width. The current source is a mathematical reference and proof-audited controlled experiment; deployment and model-capability claims are outside scope. From ace80b319bcaf8d05d665ed414cf348ea07340bb Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sun, 15 Nov 2026 16:06:11 +0800 Subject: [PATCH 08/15] COE-04: temporal cut-capacity theorems and Lean finite witnesses --- .github/workflows/coe04-temporal-capacity.yml | 42 ++++++ MathCan.lean | 1 + MathCan/TemporalCutCapacity.lean | 126 ++++++++++++++++++ .../TEMPORAL_OBSERVER_CAPACITY.md | 88 ++++++++++++ 4 files changed, 257 insertions(+) create mode 100644 .github/workflows/coe04-temporal-capacity.yml create mode 100644 MathCan/TemporalCutCapacity.lean create mode 100644 research/compactification/TEMPORAL_OBSERVER_CAPACITY.md diff --git a/.github/workflows/coe04-temporal-capacity.yml b/.github/workflows/coe04-temporal-capacity.yml new file mode 100644 index 00000000..210b1f36 --- /dev/null +++ b/.github/workflows/coe04-temporal-capacity.yml @@ -0,0 +1,42 @@ +name: COE-04 tied temporal observer Lean certificates + +on: + pull_request: + paths: + - 'MathCan/TemporalCutCapacity.lean' + - 'MathCan.lean' + - 'research/compactification/TEMPORAL_OBSERVER_CAPACITY.md' + - '.github/workflows/coe04-temporal-capacity.yml' + push: + branches: [main] + paths: + - 'MathCan/TemporalCutCapacity.lean' + - 'MathCan.lean' + - '.github/workflows/coe04-temporal-capacity.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + lean-kernel: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: leanprover/lean-action@v1 + with: + auto-config: false + build: true + build-args: MathCan + test: false + lint: false + use-mathlib-cache: false + - name: Kernel-check COE-04 finite witnesses and transitive axioms + shell: bash + run: | + set -euo pipefail + lake env lean MathCan/TemporalCutCapacity.lean | tee coe04-axioms.txt + if grep -Eq 'sorryAx|ofReduceBool' coe04-axioms.txt; then + echo 'Untrusted Lean proof primitive detected.' + exit 1 + fi diff --git a/MathCan.lean b/MathCan.lean index 2b63cc4c..d5ff8495 100644 --- a/MathCan.lean +++ b/MathCan.lean @@ -35,3 +35,4 @@ import MathCan.TacticFibers import MathCan.ChromaticObservers import MathCan.ChromaticCutCodes import MathCan.SoftObserverPrecision +import MathCan.TemporalCutCapacity diff --git a/MathCan/TemporalCutCapacity.lean b/MathCan/TemporalCutCapacity.lean new file mode 100644 index 00000000..620d9010 --- /dev/null +++ b/MathCan/TemporalCutCapacity.lean @@ -0,0 +1,126 @@ +import Init + +/-! +# COE-04: finite tied recurrent observer certificates + +The paper proves an exact *general* law for the number of heads per visit +needed to separate K_n (n >= 5) under an aggregate Hamming budget 2: + margin 1: ceil((n-1) / visits) + margin 2: ceil(n / visits) + margin >= 3: infeasible. + +This Init-only module checks the five-state tied-transducer witnesses, +edgewise margins and a deterministic-collision persistence lemma. The general +anticode/combinatorial optimality proof and contraction lemma remain in the +accompanying paper and are not claimed as kernel-checked here. +-/ + +namespace MathCan.TemporalCutCapacity + +set_option maxRecDepth 8192 +set_option maxHeartbeats 2000000 + +/-- The same phase-dependent observer is used at every visit. -/ +def tick (state : Fin 5 × Nat) : Fin 5 × Nat := + (state.1, state.2 + 1) + +def tiedRead (state : Fin 5 × Nat) : Bool := + state.1.val == state.2 + +/-- Four visits, one head per visit. Four singleton codes and one zero. -/ +def traceFour (v : Fin 5) : List Bool := + (List.range 4).map (fun t => tiedRead (v, t)) + +/-- Five visits, one head per visit, all five singleton codes. -/ +def traceFive (v : Fin 5) : List Bool := + (List.range 5).map (fun t => tiedRead (v, t)) + +/-- A single stable rule reads the same tied hidden state at the next phase. -/ +theorem tied_step_increments_phase (v : Fin 5) (t : Nat) : + tick (v, t) = (v, t + 1) := by + rfl + +def bitDist (a b : List Bool) : Nat := + ((List.zipWith (fun x y => x != y) a b).filter (fun z => z == true)).length + +/-- Distinct five-state classes admit a four-bit temporal transcript. -/ +theorem one_head_four_visits_separates : + ∀ a b : Fin 5, a ≠ b → traceFour a ≠ traceFour b := by + decide + +/-- Their pairwise Hamming distances are 1 or 2, as required for L=2. -/ +theorem one_head_four_visits_diameter_two : + ∀ a b : Fin 5, a ≠ b → + 1 ≤ bitDist (traceFour a) (traceFour b) ∧ + bitDist (traceFour a) (traceFour b) ≤ 2 := by + decide + +/-- With five visits, even the minimum Hamming distance is 2. -/ +theorem one_head_five_visits_erasure_margin : + ∀ a b : Fin 5, a ≠ b → + bitDist (traceFive a) (traceFive b) = 2 := by + decide + +/-- At four visits, two heads can allocate eight total output slots, with + the first five as singleton codes. The extra three slots are constant. -/ +def traceFourTwo (v : Fin 5) : List Bool := + (List.range 8).map (fun i => v.val == i) + +theorem two_heads_four_visits_margin_two : + ∀ a b : Fin 5, a ≠ b → + bitDist (traceFourTwo a) (traceFourTwo b) = 2 := by + decide + +/-- Recursive deterministic dynamics: if two states collide, every later + iteration remains equal. This concerns true states, not threshold-code + collisions (which may be resolved at later visits). -/ +def iterate {α : Type} (F : α → α) : Nat → α → α + | 0, x => x + | n + 1, x => F (iterate F n x) + +theorem collision_persists {α : Type} (F : α → α) (x y : α) + (t future : Nat) (h : iterate F t x = iterate F t y) : + iterate F (t + future) x = iterate F (t + future) y := by + induction future with + | zero => + simpa using h + | succ n ih => + simpa [iterate, Nat.add_succ] using congrArg F ih + +/-- For every K_n pair, margin >=3 is incompatible with a global + Hamming cap of 2, independently of recurrence architecture. -/ +theorem margin_three_exceeds_budget (d : Nat) (h : 3 ≤ d) : + ¬ d ≤ 2 := by + omega + +/-- Exact integer arithmetic of the K5 finite examples. -/ +theorem five_state_visit_budgets : + 4 * 1 = 5 - 1 ∧ 5 * 1 = 5 ∧ 4 * 2 ≥ 5 := by + omega + + +/-- A four-visit one-bit *unordered* transcript has only five possible + count values. The general stars-and-bars theorem is written separately. -/ +theorem four_visits_one_bit_has_five_counts : + 4 + 1 = 5 ∧ 5 < 8 := by + omega + +/-- The optimal balanced partition of eight states into five count + classes has three collision pairs and 25 distinguished pairs. -/ +theorem eight_state_five_bin_upper_count : + 8 * 7 / 2 = 28 ∧ 28 - 3 = 25 := by + decide + +#print axioms four_visits_one_bit_has_five_counts +#print axioms eight_state_five_bin_upper_count + +#print axioms tied_step_increments_phase +#print axioms one_head_four_visits_separates +#print axioms one_head_four_visits_diameter_two +#print axioms one_head_five_visits_erasure_margin +#print axioms two_heads_four_visits_margin_two +#print axioms collision_persists +#print axioms margin_three_exceeds_budget +#print axioms five_state_visit_budgets + +end MathCan.TemporalCutCapacity diff --git a/research/compactification/TEMPORAL_OBSERVER_CAPACITY.md b/research/compactification/TEMPORAL_OBSERVER_CAPACITY.md new file mode 100644 index 00000000..cf44fdc1 --- /dev/null +++ b/research/compactification/TEMPORAL_OBSERVER_CAPACITY.md @@ -0,0 +1,88 @@ +# COE-04: Tied temporal cut codes, quantizer precision, and the innovation horizon + +**Date:** 2026-11-15. **Research status:** self-contained mathematical proofs and executable finite certificates; literature-wide novelty has not been assessed. Companion application: `MoralityLabAI/Compactification-Theory/research/chromatic_observer_gym_v1/COE04.md`. + +## Mathematical problem + +An evaluator has a finite state space `X` with `n` possible meanings and a graph `G=(X,E)` specifying pairs it must distinguish. A frozen recurrent mechanism produces `z_{t+1}=F(z_t)` for `t=0,...,T-1`. A **single tied readout** `q` emits `k` binary features at every visit. Its transcript is + +`C_T(x) = (q(z_0(x)), q(z_1(x)),...,q(z_{T-1}(x))) in {0,1}^{kT}`. + +For the complete evaluator `G=K_n` on an equilateral metric with unit pair distance, impose the aggregate `ell_1` budget + +`d_H(C_T(x), C_T(y)) <= 2` for all `x,y`, + +alongside minimum Hamming separation `d_H(C_T(x), C_T(y)) >= r` for every distinct pair. Aggregate length is the information delivered through the observer, while `k` is instantaneous head width. The state `z_t` and its recurrence may contain more information than the observer transcript. + +## Theorem 1: sharp time–head-width–robustness tradeoff + +**Theorem (temporal diameter-two cut capacity).** Fix `n >= 5`, `T >= 1`, and integer separation margin `r >= 1`. Allow deterministic recurrent dynamics with a phase register and one tied readout. Under the conditions above, the exact smallest head width is + +``` + / ceil((n-1)/T), if r=1, + k_min(n,T,r) = | ceil(n/T), if r=2, + \ infeasible, if r>=3. +``` + +The same lower bounds hold for arbitrarily complex recurrent dynamics, even if each visit has an independently chosen readout. + +**Proof, lower bounds.** Flatten the `T` outputs into a binary word of length `m=kT`; recurrence and tying cannot increase the number of coordinates in this transcript. Translate one word in the code by XOR so it is zero; this preserves all Hamming distances. + +At margin one, every remaining nonzero word has Hamming weight either one or two. Its weight-two supports form a family of pairwise-intersecting two-element subsets: disjoint supports would differ in four coordinates. A pairwise-intersecting family of two-element sets is either a star (all containing one coordinate), or contained in a triangle. A star has at most `m-1` members; a triangle has at most three. When weight-one words are also present, each weight-two support must contain the coordinates of every weight-one word. An elementary case split yields at most `m+1` total codewords whenever `m>=3`. For `m<=2` the full cube has at most four points, so cannot encode `n>=5`. Hence `n<=m+1`, or `kT>=n-1`. + +At margin two, all nonzero translated words have weight exactly two. Their supports are pairwise intersecting. As `n>=5`, this family has at least four members and therefore must be a star. A star contains at most `m-1` distinct edges. Thus `n<=m`, or `kT>=n`. Finally margin `r>=3` directly contradicts the aggregate Hamming cap two. + +**Proof, constructions.** Set `m=kT`. When `r=1` and `m>=n-1`, use the `n` codewords `0,e_1,...,e_(n-1)`. Their pair distances are one or two. When `r=2` and `m>=n`, use `e_1,...,e_n`, each pair at distance two. Divide the `m` coordinates into `T` consecutive blocks of `k`. Define a shared-state machine with state `(symbol,phase)` and recurrence + +`F(symbol,phase) = (symbol,phase+1)`; + +let the **same** readout `q(symbol,phase)` emit the block of coordinates belonging to that phase. This realizes the code in `T` visits using exactly `k` binary heads. The phase register requires up to `ceil(log2 T)` bits of latent state in addition to the symbol; it is a deliberate resource in the construction, not an uncharged source of capacity. ∎ + +**Checks.** At `(n,T)=(5,4)`, the margin-one optimal observer uses one bit per visit and outputs `(1000),(0100),(0010),(0001),(0000)`; the margin-two optimum uses two bits per visit because five singleton positions are needed. A separate Python clique search over the four-bit cube confirms that the largest binary family with all pairwise Hamming distances exactly two has size four. The Lean file `MathCan/TemporalCutCapacity.lean` kernel-checks the five-state tied witness and Hamming-distance cases. **The Lean checker does not formalize the general extremal-set proof above.** + +## Theorem 2: a finite innovation horizon under contraction + +Suppose the recurrent map `F` is `alpha`-contractive, `0<=alpha<1`, on a normed space and fixes the same point `z_*` for all initial states. Let all `z_0(x)` lie at distance at most `R` from `z_*`. Let `q` be any `k`-bit quantizer that is constant on the open ball `B(z_*,delta)` for some `delta>0`. Define + +`t_* = min {t in N: alpha^t R < delta}`. + +**Theorem (late-observation collapse).** All readouts `q(z_t(x))` coincide across `x` whenever `t>=t_*`. Consequently an injective evaluator transcript for `n` states satisfies + +`n <= 2^(k * min(T,t_*))`. + +If `n>=5` and its transcript additionally satisfies the diameter-two condition from Theorem 1, the stronger necessary inequalities are + +- `n-1 <= k * min(T,t_*)` at margin one; +- `n <= k * min(T,t_*)` at margin two. + +**Proof.** Contraction and the fixed-point condition imply `||z_t(x)-z_*|| <= alpha^t R`. At `t>=t_*` the trajectory enters the common open quantizer cell, so the quantizer output is identical for every source state. The remaining observations are constant transcript suffixes. Only `k min(T,t_*)` binary coordinates can distinguish sources, establishing the counting bound. In the diameter-two setting, discard the constant suffix and apply the two extremal-set bounds above to the remaining coordinates. ∎ + +The quantizer's nonzero cell margin and *common* fixed point are substantive hypotheses. A linear threshold passing through the fixed point may have `delta=0`, in which case contraction alone gives no finite innovation horizon. A recurrent model with input-dependent attractors does not satisfy the common-fixed-point premise. + +## Theorem 3: true-state collisions versus observation collisions + +For deterministic recurrent `F`, if `F^t(x)=F^t(y)` at some visit, then `F^(t+s)(x)=F^(t+s)(y)` for every `s>=0`. Any downstream tied or untied probe produces identical future readouts. In contrast, `q(F^t(x))=q(F^t(y))` says only that **one quantized reading** collided; later visits can separate those states while the hidden trajectories remain distinct. + +The general collision persistence lemma is proved in `MathCan/TemporalCutCapacity.lean` using induction, with the kernel axiom inventory printed by CI. + +## Relationship to COE-01/02/03 and limitations + +COE-01 establishes exact task-relative chromatic binary width. COE-02 adds an `ell_1` cut budget and a diameter-two anticode obstruction. COE-03 shows low-precision binary heads can need many more coordinates than bounded-range fractional heads. This note moves the discrete coordinates into **time**, where a tied recurrent map can expose complementary cuts. The mathematical equivalence is conditional on allowing a phase-carrying latent state; learned models may have inadequate time diversification or may forget earlier distinctions. + +This result concerns a specified finite evaluator, exact binary readouts and aggregate Hamming constraints. It is independent of the infinite-dimensional source results [OpenAI Math #098](https://github.com/openai/math/blob/main/lean/docs/098.md) and [#332](https://github.com/openai/math/blob/main/preprints/Metric-Markov-Cotype-Two-of-l1-October-5-2026/README.md); those papers motivated the distinction between full metric fidelity and stable forward observation. No infinite-dimensional theorem from those sources is imported as an axiom. + +## Theorem 4: ordered versus commutative readout histories + +Some recurrent probes gain from the number of threshold crossings while contributing no distinguishability through the order in which those crossings occurred. Suppose an observer emits a symbol from an alphabet of size `q=2^k` on each of `T` visits, but its decoder sees only the *unordered multiset* of outputs. The number of possible distinguishable multisets is exactly + +`M(T,k) = binom(T+2^k-1, 2^k-1)`. + +This follows by stars-and-bars: each histogram is a nonnegative integer vector of `q` bin counts with total `T`. By comparison, the ordered transcript alphabet contains `2^(kT)` sequences. If `n>M(T,k)`, every commutative decoder must collide on some evaluator states, regardless of the recurrence. + +For one bit per tick this specializes to `M(T,1)=T+1`, because only the count of ones remains. More sharply, when the evaluator is `K_n`, the largest number of its edges that any decoder with `B` distinct output categories can distinguish is + +`binom(n,2) - [r binom(a+1,2) + (B-r) binom(a,2)]`, + +where `a=floor(n/B)`, `r=n mod B`. **Proof:** group the `n` states by their observed category. Every within-group pair collides. If two groups differ in size by at least two, moving one member from the larger to the smaller group strictly reduces the number of colliding pairs. Thus the minimum number of collisions occurs for balanced group sizes, giving the formula. ∎ + +At `n=8,T=4,k=1`, count-only observation permits at most five distinct class codes and can separate at most `25/28` evaluator pairs per context. These counting limits hold without an `ell_1` diameter constraint. The separate diameter-two bounds in Theorem 1 can strengthen them. The observed frozen checkpoint experiment tests whether order *actually contributes* to task distinctions, rather than assuming that a four-step history uses all `2^4` possible ordered words. From 6ead5c60df4e5245794ed9410847bb4c9f75bda4 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sun, 15 Nov 2026 16:43:36 +0800 Subject: [PATCH 09/15] COE-05: phase-gauge capacity, error-correcting temporal code, Lean certificates --- .github/workflows/coe05-phase-gauge.yml | 42 +++++++ MathCan.lean | 1 + MathCan/PhaseGaugeCapacity.lean | 107 ++++++++++++++++++ .../compactification/PHASE_GAUGE_CAPACITY.md | 63 +++++++++++ 4 files changed, 213 insertions(+) create mode 100644 .github/workflows/coe05-phase-gauge.yml create mode 100644 MathCan/PhaseGaugeCapacity.lean create mode 100644 research/compactification/PHASE_GAUGE_CAPACITY.md diff --git a/.github/workflows/coe05-phase-gauge.yml b/.github/workflows/coe05-phase-gauge.yml new file mode 100644 index 00000000..aacdde21 --- /dev/null +++ b/.github/workflows/coe05-phase-gauge.yml @@ -0,0 +1,42 @@ +name: COE-05 finite phase-gauge Lean certificates + +on: + pull_request: + paths: + - 'MathCan/PhaseGaugeCapacity.lean' + - 'MathCan.lean' + - 'research/compactification/PHASE_GAUGE_CAPACITY.md' + - '.github/workflows/coe05-phase-gauge.yml' + push: + branches: [main] + paths: + - 'MathCan/PhaseGaugeCapacity.lean' + - 'MathCan.lean' + - '.github/workflows/coe05-phase-gauge.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + kernel: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: leanprover/lean-action@v1 + with: + auto-config: false + build: true + build-args: MathCan + test: false + lint: false + use-mathlib-cache: false + - name: Kernel-check named COE-05 finite statements and transitive axioms + shell: bash + run: | + set -euo pipefail + lake env lean MathCan/PhaseGaugeCapacity.lean | tee coe05-axioms.txt + if grep -Eq 'sorryAx|ofReduceBool' coe05-axioms.txt; then + echo 'Unexpected admission or native code-evaluation axiom' + exit 1 + fi diff --git a/MathCan.lean b/MathCan.lean index d5ff8495..fd391cc5 100644 --- a/MathCan.lean +++ b/MathCan.lean @@ -36,3 +36,4 @@ import MathCan.ChromaticObservers import MathCan.ChromaticCutCodes import MathCan.SoftObserverPrecision import MathCan.TemporalCutCapacity +import MathCan.PhaseGaugeCapacity diff --git a/MathCan/PhaseGaugeCapacity.lean b/MathCan/PhaseGaugeCapacity.lean new file mode 100644 index 00000000..6fb408a6 --- /dev/null +++ b/MathCan/PhaseGaugeCapacity.lean @@ -0,0 +1,107 @@ +import Init + +/-! +# COE-05: finite witnesses for phase-gauge observer capacity + +The associated MathCan research note proves the general constant-count, +error-correcting and orbit-capacity statements. This Init-only file checks +the explicit 14-code affine F2^3 witness and finite arithmetic instances. +It does not claim a Lean proof of the general packing or Burnside theorems. +-/ + +namespace MathCan.PhaseGaugeCapacity + +set_option maxRecDepth 8192 +set_option maxHeartbeats 1500000 + +/-- Binary dot product on three bits. -/ +def dotParity3 (a x : Nat) : Bool := + ((a.testBit 0 && x.testBit 0) != (a.testBit 1 && x.testBit 1)) != + (a.testBit 2 && x.testBit 2) + +/-- Characteristic number of the affine plane a·x=side in F2^3. -/ +def affinePlaneWord (a side : Nat) : Nat := + ((List.range 8).map (fun x => + if dotParity3 a x == (side == 1) then 2 ^ x else 0)).sum + +/-- The fourteen affine hyperplane words indexed by seven nonzero normals. -/ +def phaseWord (label : Fin 14) : Nat := + affinePlaneWord (label.val / 2 + 1) (label.val % 2) + +/-- Number of set bits among the lowest width coordinates. -/ +def bitWeight (width word : Nat) : Nat := + ((List.range width).filter (fun i => word.testBit i)).length + +/-- Hamming distance on fixed-length binary words. -/ +def bitDistance (width left right : Nat) : Nat := + ((List.range width).filter (fun i => left.testBit i != right.testBit i)).length + +/-- This exact table independently checks the affine normal/side generator. -/ +theorem affine_plane_table : + ((List.finRange 14).map phaseWord) = + [85, 170, 51, 204, 153, 102, 15, 240, 165, 90, 195, 60, 105, 150] := by + decide + +/-- The phase register has fourteen distinct 8-bit words. -/ +theorem phase_code_in_range : + ∀ label : Fin 14, phaseWord label < 2 ^ 8 := by + decide + +/-- Count-only observation always reads four positive phases. -/ +theorem phase_code_constant_weight : + ∀ label : Fin 14, bitWeight 8 (phaseWord label) = 4 := by + decide + +/-- Distinct labels are distance at least four, allowing one bit flip. -/ +theorem phase_code_margin_four : + ∀ left right : Fin 14, left ≠ right → + 4 ≤ bitDistance 8 (phaseWord left) (phaseWord right) := by + decide + +/-- One fixed recurrent shift, independent of the label and visit. -/ +def rotateRight8 (word : Nat) : Nat := + word / 2 + (word % 2) * 128 + +/-- Recurrent register after t visits. -/ +def stateAt (word : Nat) : Nat → Nat + | 0 => word + | t + 1 => rotateRight8 (stateAt word t) + +/-- One fixed bit-zero readout applied at every visit. -/ +def temporalBit (label : Fin 14) (visit : Nat) : Bool := + (stateAt (phaseWord label) visit).testBit 0 + +/-- The eight ordered reads reconstruct the original codeword exactly. -/ +theorem tied_shift_recovers_code : + ∀ label : Fin 14, + ((List.range 8).map (temporalBit label)) = + ((List.range 8).map (fun i => (phaseWord label).testBit i)) := by + decide + +/-- Four triples per support, 56 triples in the full 8-point set. -/ +theorem eight_phase_triple_packing_saturated : 14 * 4 = 56 := by + decide + +/-- Integer obstruction for a seven-phase, fourteen-label constant-count code. + The general subset-packing argument is in the research note. -/ +theorem seven_phase_packing_arithmetic : + 14 * 2 > 7 ∧ 14 * 3 > 21 ∧ 14 * 4 > 35 := by + decide + +/-- A four-positive-visit count is identical for all fourteen labels. -/ +theorem histogram_cannot_separate (left right : Fin 14) : + bitWeight 8 (phaseWord left) = bitWeight 8 (phaseWord right) := by + calc + bitWeight 8 (phaseWord left) = 4 := phase_code_constant_weight left + _ = bitWeight 8 (phaseWord right) := (phase_code_constant_weight right).symm + +#print axioms affine_plane_table +#print axioms phase_code_in_range +#print axioms phase_code_constant_weight +#print axioms phase_code_margin_four +#print axioms tied_shift_recovers_code +#print axioms eight_phase_triple_packing_saturated +#print axioms seven_phase_packing_arithmetic +#print axioms histogram_cannot_separate + +end MathCan.PhaseGaugeCapacity diff --git a/research/compactification/PHASE_GAUGE_CAPACITY.md b/research/compactification/PHASE_GAUGE_CAPACITY.md new file mode 100644 index 00000000..9b17b066 --- /dev/null +++ b/research/compactification/PHASE_GAUGE_CAPACITY.md @@ -0,0 +1,63 @@ +# COE-05: constant-weight phase capacity, error correction, and clock gauge + +**Research date:** 2026-11-15. **Status:** proved finite and general propositions, independently executable exact witnesses, finite Lean certificates. The affine-hyperplane code is the classical Steiner quadruple system `S(3,4,8)`/extended Hamming code construction. This note claims the **temporal-observer application and research-program formulation**, not literature-wide priority for the underlying combinatorial facts. + +## Source relationship and restrictions + +The program began with OpenAI Math #098 (finite-dimensional bi-Lipschitz embedding obstructions) and #332 (Lipschitz extension to `l1`). The present phase coding arguments use elementary finite combinatorics, so they do not depend on the correctness of those source manuscripts. Earlier COE-01..04 identify observer width, cut-metric budgets, output precision, and recurrent history bandwidth. This theorem asks what information survives forgetting *when* the recurrent probe fired. + +A state index `a` has a binary transcript `c(a)=(c_0(a),...,c_(T-1)(a))`. A one-head recurrent observer uses one readout map `p` on every visit of a *time-homogeneous* state transition `R`: `c_t(a)=p(R^t(x_a))`. The full-word observer sees `c(a)`. The histogram observer sees only the Hamming weight `|c(a)|`. An unknown, uniformly random clock phase acts by cyclic shifts of `c(a)`. + +## 1. Constant-weight observer capacity + +**Theorem PG-1 (phase information in a constant-count stratum).** For any `0 <= w <= T`, the maximum number of labels separable using `T` one-bit observations *with every transcript of weight exactly w* is `binom(T,w)`. Any observer restricted to the activation count merges all these labels. All `binom(T,w)` words can be realized by one time-independent cyclic-shift transition on an initial `T`-bit register and one fixed bit-zero readout. + +*Proof.* There are exactly `binom(T,w)` subsets of `T` positions having size `w`. A full-history decoder needs distinct subsets for distinct labels. Conversely, embed each label as its chosen subset's incidence vector in a `T`-bit register. Let `R` be cyclic right rotation, and let `p` read the lowest bit. For `t=0,...,T-1`, the successive readouts are precisely the original register bits in order. The readout has identical weights on every visit and requires no label-conditioned phase lookup. Every count equals `w`. This proves both the upper bound and its attainability. `∎` + +For general binary histories with at most `s` switches between successive visits, their number is exactly + +`M(T,s) = 2 * sum_{j=0}^{s} binom(T-1,j)` for `0 <= s <= T-1`. + +The first bit has two choices, and choosing exactly `j` of the `T-1` boundaries at which to switch determines the entire history. Thus small transition budgets can limit available phase codes even when the history has `2^T` unconstrained possibilities. + +## 2. Exact single-flip-robust, count-blind family + +Represent the eight coordinates by the points of `F_2^3`. For each nonzero `a in F_2^3` and `b in F_2`, let + +`H_(a,b) = { x in F_2^3 : a dot x = b }`, + +and let its characteristic word be `c_(a,b) in {0,1}^8`. There are `7*2=14` such words. Every hyperplane has four points, so `|c_(a,b)|=4`. Distinct parallel hyperplanes are complements, hence distance eight. Two nonparallel affine hyperplanes intersect in exactly two points, hence their words are distance four. Therefore the minimum distance of this 14-word code is **four**. + +**Theorem PG-2 (sharp eight-visit robust phase code).** There exists a single-head, tied, time-homogeneous eight-visit recurrent observer that distinguishes `14` labels; all histories have count four, and nearest-code decoding corrects every single flipped observation. Eight visits are the minimum possible for any fourteen-label, constant-count, one-flip-correcting binary-history observer. + +*Proof.* The construction above has pairwise distance at least four. Any word within Hamming distance one of a codeword is uniquely closest to that codeword because the distance between different codewords is at least four. PG-1 supplies the cyclic shift implementation. The count-only evaluator has a single output category. + +For optimality, a binary constant-weight code correcting a single arbitrary bit flip has pairwise Hamming distance at least three; since all codewords have the same weight, Hamming distances are even, so the minimum is at least four. For `2 <= w <= T-2`, consider all `(w-1)`-subsets contained in the support of each codeword. Two different supports cannot share one, or their distance would be two. Each weight-`w` codeword owns `w` distinct `(w-1)`-subsets. Counting yields + +`n*w <= binom(T,w-1)`. + +Applying the same argument to complements gives + +`n*(T-w) <= binom(T,T-w-1)`. + +For `w=0,T` only one word exists; for `w=1,T-1`, every pair of distinct words is distance two, so at most one label is allowed. With `T=7`, the preceding bounds imply at most three labels when `w=2,5` and at most seven when `w=3,4`, so *any constant-weight single-flip-correcting code of length seven contains at most seven words*. Padding a shorter code with zeros reduces it to that case. Thus fourteen labels require `T>=8`. For `T=8,w=4`, triple counting gives `n <= binom(8,3)/4 = 56/4=14`, achieved by the fourteen affine hyperplanes. `∎` + +The 14 supports form the classical Steiner quadruple system `S(3,4,8)`: each three-point subset of `F_2^3` lies in exactly one affine plane. The exact implementation in `Compactification-Theory/research/chromatic_observer_gym_v1/phase_register.py` checks all 56 unique triples, all 91 pairwise distances, every transcript, and all 112 single-flip decodes. + +## 3. Unknown phase is an information quotient + +Let a finite group `G` act on transcripts, and suppose the unknown nuisance transformation `g` is drawn uniformly from `G` independently of the label. The receiver observes `g.c(a)`. Let `O` denote the set of different `G`-orbits represented by the `n` codewords. + +**Theorem PG-3 (uniform phase-gauge Bayes bound).** With uniformly distributed labels and a noiseless uniformly random unknown `g`, optimal full-transcript decoding accuracy is exactly `|O|/n`. If `G` is the cyclic shift group and all codewords have weight `w`, the number of available orbits (binary necklaces) equals + +`N(T,w) = (1/T) * sum_{s=0}^{T-1} [T/gcd(T,s) divides w] * binom(gcd(T,s), w/(T/gcd(T,s)))`. + +*Proof.* For a fixed orbit, uniform transformation gives a uniform output distribution across all its elements. Indeed, each orbit member has exactly `|G|/|orbit|` preimages in `G`. Hence labels in the same orbit produce identical observations, and labels in distinct orbits give disjoint supports. With a uniform prior, the best decoder succeeds for exactly one label per represented orbit, yielding `|O|/n`. For cyclic shifts, a word fixed by shift `s` is constant on each of its `gcd(T,s)` cycles, each of length `T/gcd(T,s)`; its weight must be a multiple of that length. Burnside's lemma averages fixed-word counts over the `T` shifts, yielding the displayed formula. `∎` + +At `T=8,w=4`, `N(8,4)=(70+2+6+2)/8=10`. The selected fourteen hyperplane words occupy exactly **four** cyclic orbits, of multiplicities `[2,4,4,4]`. Without a shared phase origin their optimal error-free label accuracy becomes `4/14=2/7` under uniform independent phase shifts; full clock alignment restores `14/14`. The count-only decoder has optimal accuracy `1/14` for these labels. This is a precise clock-gauge obstruction; neither training-time random permutations nor fixed global order reversal are equivalent to uniformly unknown independent phase shifts. + +## 4. Verification boundaries + +The Lean file `MathCan/PhaseGaugeCapacity.lean` checks the exact 14-word witness: the printed codebook, constant weight, pairwise distance at least four, its tied-shift readout identity, and integer packing counts. The general theorems PG-1..PG-3 have the complete written proofs above; Lean does not certify the infinite family or Burnside's lemma. The original manuscript pair #098 and #332 is motivation only, and no priority over established error-correcting codes is claimed. + +The applied COE-05 experiment uses independent frozen four-visit causal-attention models to measure the *presence or absence* of order-only distinctions. Those learned models are not the constructive eight-visit cyclic-register system, and trained large-pretrained-model evidence remains a separate requirement. From e347ad8845a2c5331a10a571c9521dc47ca5f5c5 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sun, 15 Nov 2026 16:53:07 +0800 Subject: [PATCH 10/15] ci(COE-05): validate Lean on isolated research branch despite base divergence --- .github/workflows/coe05-phase-gauge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coe05-phase-gauge.yml b/.github/workflows/coe05-phase-gauge.yml index aacdde21..46c9f21f 100644 --- a/.github/workflows/coe05-phase-gauge.yml +++ b/.github/workflows/coe05-phase-gauge.yml @@ -8,7 +8,7 @@ on: - 'research/compactification/PHASE_GAUGE_CAPACITY.md' - '.github/workflows/coe05-phase-gauge.yml' push: - branches: [main] + branches: [main, feat/coe01-chromatic-observer-20261115] paths: - 'MathCan/PhaseGaugeCapacity.lean' - 'MathCan.lean' From 78d6ce882048641124d3277d3455bd40bb9094e8 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sun, 15 Nov 2026 17:08:28 +0800 Subject: [PATCH 11/15] COE-06: phase-blind cyclic code capacity proof and Lean finite certificates --- .github/workflows/coe06-phase-blind.yml | 42 +++++ MathCan.lean | 1 + MathCan/PhaseBlindObservers.lean | 143 ++++++++++++++++++ .../PHASE_BLIND_OBSERVER_CAPACITY.md | 89 +++++++++++ 4 files changed, 275 insertions(+) create mode 100644 .github/workflows/coe06-phase-blind.yml create mode 100644 MathCan/PhaseBlindObservers.lean create mode 100644 research/compactification/PHASE_BLIND_OBSERVER_CAPACITY.md diff --git a/.github/workflows/coe06-phase-blind.yml b/.github/workflows/coe06-phase-blind.yml new file mode 100644 index 00000000..318d587e --- /dev/null +++ b/.github/workflows/coe06-phase-blind.yml @@ -0,0 +1,42 @@ +name: COE-06 phase-blind observer Lean and resource certificates + +on: + pull_request: + paths: + - 'MathCan/PhaseBlindObservers.lean' + - 'MathCan.lean' + - 'research/compactification/PHASE_BLIND_OBSERVER_CAPACITY.md' + - '.github/workflows/coe06-phase-blind.yml' + push: + branches: [main] + paths: + - 'MathCan/PhaseBlindObservers.lean' + - 'MathCan.lean' + - '.github/workflows/coe06-phase-blind.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + kernel: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: leanprover/lean-action@v1 + with: + auto-config: false + build: true + build-args: MathCan + test: false + lint: false + use-mathlib-cache: false + - name: Check explicit cyclic code and exact arithmetic assumptions + shell: bash + run: | + set -euo pipefail + lake env lean MathCan/PhaseBlindObservers.lean | tee coe06-axioms.txt + if grep -Eq 'sorryAx|ofReduceBool' coe06-axioms.txt; then + echo 'Unexpected native-reduction axiom or admission' + exit 1 + fi diff --git a/MathCan.lean b/MathCan.lean index 062e2f14..cb302ea0 100644 --- a/MathCan.lean +++ b/MathCan.lean @@ -52,3 +52,4 @@ import MathCan.ChromaticCutCodes import MathCan.SoftObserverPrecision import MathCan.TemporalCutCapacity import MathCan.PhaseGaugeCapacity +import MathCan.PhaseBlindObservers diff --git a/MathCan/PhaseBlindObservers.lean b/MathCan/PhaseBlindObservers.lean new file mode 100644 index 00000000..b35b5971 --- /dev/null +++ b/MathCan/PhaseBlindObservers.lean @@ -0,0 +1,143 @@ +import Init + +/-! +# COE-06: phase-blind constant-count recurrent observer certificates + +The companion research note proves the cyclic-orbit distance and one-deletion +resource theorems. Here Lean checks the twenty-one concrete fourteen-tick +register words and exact arithmetic at the two largest subcritical widths. + +The finite exhaustive resource ledger for all T <= 13 is verified separately +by the standard-library Python oracle. Thus the global minimality theorem is +proved in the manuscript, while the present file formalizes a finite witness +and the critical integer budget implications; it does not encode every +enumerated resource class in Lean. +-/ + +namespace MathCan.PhaseBlindObservers + +set_option maxRecDepth 8192 +set_option maxHeartbeats 12000000 + +/-- Twenty-one length-14, weight-six binary orbit representatives. -/ +def word (label : Fin 21) : Nat := + match label.val with + | 0 => 207 + | 1 => 243 + | 2 => 311 + | 3 => 473 + | 4 => 543 + | 5 => 629 + | 6 => 697 + | 7 => 811 + | 8 => 851 + | 9 => 903 + | 10 => 1133 + | 11 => 1175 + | 12 => 1337 + | 13 => 1351 + | 14 => 1419 + | 15 => 1445 + | 16 => 1587 + | 17 => 1677 + | 18 => 1865 + | 19 => 2451 + | _ => 2709 + +/-- Fixed, time-independent transition on fourteen-bit registers. -/ +def rotate14 (state : Nat) : Nat := + state / 2 + (state % 2) * 8192 + +/-- Apply the same transition for each iteration. -/ +def rotateN : Nat → Nat → Nat + | 0, state => state + | n + 1, state => rotate14 (rotateN n state) + +/-- The single shared readout is the low bit of the current register. -/ +def readBit (state : Nat) : Bool := state.testBit 0 + +/-- Finite, exact Hamming statistics. -/ +def bitWeight14 (state : Nat) : Nat := + ((List.range 14).filter (fun bit => state.testBit bit)).length + +def bitDistance14 (left right : Nat) : Nat := + ((List.range 14).filter (fun bit => left.testBit bit != right.testBit bit)).length + +/-- Every word fits fourteen bits and contains exactly six set bits. -/ +theorem code_fits_and_constant_weight : + ∀ label : Fin 21, word label < 2 ^ 14 ∧ bitWeight14 (word label) = 6 := by + decide + +/-- The time-independent transition leaves every representative in the cube. -/ +theorem rotation_fits : + ∀ label : Fin 21, rotate14 (word label) < 2 ^ 14 := by + decide + +/-- Pairwise min-distance certificate, chunked to control kernel reduction cost. -/ +private theorem margin_low : + ∀ i j : Fin 21, i.val < 7 → i ≠ j → + ∀ phase : Fin 14, + 4 ≤ bitDistance14 (word i) (rotateN phase.val (word j)) := by + decide + +private theorem margin_mid : + ∀ i j : Fin 21, 7 ≤ i.val → i.val < 14 → i ≠ j → + ∀ phase : Fin 14, + 4 ≤ bitDistance14 (word i) (rotateN phase.val (word j)) := by + decide + +private theorem margin_high : + ∀ i j : Fin 21, 14 ≤ i.val → i ≠ j → + ∀ phase : Fin 14, + 4 ≤ bitDistance14 (word i) (rotateN phase.val (word j)) := by + decide + +/-- Any two different labels remain distance >=4 after an arbitrary + unknown cyclic shift of either transcript. One-bit flips are therefore + correctable by nearest-orbit decoding. -/ +theorem cyclic_orbit_margin_four + (i j : Fin 21) (distinct : i ≠ j) (phase : Fin 14) : + 4 ≤ bitDistance14 (word i) (rotateN phase.val (word j)) := by + by_cases hlow : i.val < 7 + · exact margin_low i j hlow distinct phase + by_cases hmid : i.val < 14 + · have hlo : 7 ≤ i.val := by omega + exact margin_mid i j hlo hmid distinct phase + · have hhi : 14 ≤ i.val := by omega + exact margin_high i j hhi distinct phase + +/-- At T=13,w=6, six candidate necklaces cost five deletion-orbits each; + all remaining candidates cost six. There are 99 resources total. -/ +theorem width13_resource_budget + (special regular : Nat) + (hs : special ≤ 6) + (hbudget : 5 * special + 6 * regular ≤ 99) : + special + regular ≤ 17 := by + omega + +/-- At T=12,w=6, exact candidate cost multiplicities are + (cost,count)=(1,1),(2,1),(3,3),(5,4),(6,71). + The 66 deletion-orbits allow at most fourteen labels. -/ +theorem width12_resource_budget + (one two three five six : Nat) + (h1 : one ≤ 1) (h2 : two ≤ 1) + (h3 : three ≤ 3) (h5 : five ≤ 4) + (hbudget : one + 2 * two + 3 * three + 5 * five + 6 * six ≤ 66) : + one + two + three + five + six ≤ 14 := by + omega + +/-- Full constant-count transcript has the same activity histogram. -/ +theorem any_two_labels_same_count (i j : Fin 21) : + bitWeight14 (word i) = bitWeight14 (word j) := by + calc + bitWeight14 (word i) = 6 := (code_fits_and_constant_weight i).2 + _ = bitWeight14 (word j) := ((code_fits_and_constant_weight j).2).symm + +#print axioms code_fits_and_constant_weight +#print axioms rotation_fits +#print axioms cyclic_orbit_margin_four +#print axioms width13_resource_budget +#print axioms width12_resource_budget +#print axioms any_two_labels_same_count + +end MathCan.PhaseBlindObservers diff --git a/research/compactification/PHASE_BLIND_OBSERVER_CAPACITY.md b/research/compactification/PHASE_BLIND_OBSERVER_CAPACITY.md new file mode 100644 index 00000000..08099a22 --- /dev/null +++ b/research/compactification/PHASE_BLIND_OBSERVER_CAPACITY.md @@ -0,0 +1,89 @@ +# COE-06: exact clock-gauge capacity for a single tied recurrent bit + +**Date:** 2026-11-15. **Scope:** proved finite metric/coding lemmas, an exact standard-library exhaustive bound for all lengths at most 13, a length-14 constructive witness, and frozen-head post-hoc replay. **Novelty:** research-program formulation and integration; priority over coding-theory literature has not been established. No inference on an externally pretrained recurrent transformer is claimed. + +Companion applied implementation: `MoralityLabAI/Compactification-Theory/research/chromatic_observer_gym_v1/gauge_orbit_codes.py` and `resource_bound.py`. This continues COE-05's phase-gauge question using the same physical idea of one readout reused at every tick. The relevant motivating source manuscripts are OpenAI Math family [098](https://github.com/openai/math/blob/4eaee87548250b2682affda7d05d947c05554bae/lean/docs/098.md) (limitations of bi-Lipschitz compression) and [332](https://github.com/openai/math/blob/4eaee87548250b2682affda7d05d947c05554bae/preprints/Metric-Markov-Cotype-Two-of-l1-October-5-2026/README.md) (Lipschitz extension). The theorems below are elementary finite arguments and **do not require** either manuscript's deep claims. + +## 1. Quotient decoding theorem + +Let `C={c_1,...,c_n}` be binary words of length `T`. Their cyclic rotation group is `G=C_T`. A decoder sees `g.c_i ⊕ e`, where the phase `g∈G` is arbitrary and the adversarial Hamming error `e` satisfies `|e|≤t`. The decoder knows the word length and codebook, but not `g` or `i`. + +Define the **inter-orbit distance** + +\[ +\Delta([u],[v]) := \min_{g,h\in G} d_H(g.u,h.v) + = \min_{h\in G}d_H(u,h.v). +\] + +The second equality uses the fact that coordinate rotations preserve Hamming distance. Distances inside the same orbit are irrelevant because all of its members represent the same label. + +**Theorem PB-1 (exact gauge-robust decoding condition).** Every label can be decoded uniquely for every phase and every pattern of at most `t` corrupted bits if and only if `Δ([c_i],[c_j])≥2t+1` for all distinct labels `i,j`. + +*Proof.* Under the inequality, an observation within radius `t` of one label orbit cannot also be within radius `t` of another, by the triangle inequality. Nearest-orbit decoding is unambiguous. Conversely, if distinct label orbits have words at distance `d≤2t`, partition their `d` differing positions into two sets of sizes at most `t`. Flipping one set from the first word yields an observation within `t` flips of the second word. Both labels could have produced that observation, so guaranteed recovery is impossible. ∎ + +When all codewords have the same Hamming weight, distances are even. Thus for a single flipped bit (`t=1`), the condition is equivalent to `Δ≥4`. + +## 2. Deletion-necklace packing theorem + +Identify weight-`w` words with `w`-element subsets of the cyclic index set `Z/TZ`. A **necklace** `[S]` consists of all cyclic translates of `S`. For a representative `S` define its *deletion resources* + +\[ + R(S)=\{\,[S\setminus\{x\}]:x\in S\,\}, +\] + +where the brackets denote cyclic equivalence of `(w−1)`-subsets. Let `N(T,w−1)` be the total number of such necklaces, computable by enumerating the `\binom{T}{w-1}` binary masks and keeping one representative per orbit. + +**Theorem PB-2 (disjoint deletion-necklace resources).** For a constant-weight code with inter-orbit distance at least four, the resource sets `R(S_i)` for distinct labels are pairwise disjoint. Consequently, + +\[ +\boxed{\sum_{i=1}^n |R(S_i)|\le N(T,w-1).} +\] + +*Proof.* Suppose `[S_i\setminus\{x\}] = [S_j\setminus\{y\}]`. After a cyclic translate, the two `w`-subsets share `w−1` positions. They are identical (which places them in the same orbit), or differ in exactly two binary coordinates. Either case contradicts distinct labels with orbit distance at least four. The sets of necklace resources are therefore disjoint; counting all of them gives the inequality. ∎ + +The same argument applies to complements, exchanging weights `w` and `T−w`. For a **computable upper bound**, enumerate all candidate weight-`w` necklaces and sort their resource costs `r_1≤r_2≤...`. Any `n` selected labels use at least `r_1+...+r_n` resources. Therefore `n` is at most the largest `m` whose first `m` costs sum to at most `N(T,w−1)`. Taking the minimum with the complement bound strengthens the certificate. This is an exact finite counting argument that uses integer arithmetic, with no reliance on solver optimality. + +## 3. Sharp fourteen-tick witness for twenty-one labels + +**Theorem PB-3 (optimal time width within the stated model).** A time-independent cyclic register and one fixed single-bit readout can encode **21 labels in 14 visits** with a constant activity count across labels and correct every single bit error despite arbitrary unknown cyclic phase. Under these same constant-weight and adversarial one-bit correction conditions, **13 or fewer visits cannot encode 21 labels**. + +*Upper construction.* Take a fourteen-bit state. At each visit apply the same transition `R(s)=rotate_right_14(s)` and read the least-significant bit. The codewords below are initial states (decimal), all of weight six: + +``` +207 243 311 473 543 629 697 811 851 903 1133 +1175 1337 1351 1419 1445 1587 1677 1865 2451 2709 +``` + +These are distinct cyclic necklace representatives. The independent exact oracle checks the distance from each of the 21 words to *every rotation* of each other word: the minimum cross-orbit distance is four. Theorem PB-1 provides one-flip correction. To make the witness fully reproducible, the oracle additionally tests each possible cyclic phase and each of the fourteen single-bit corruptions, plus the clean case. Five label orbits have length seven and sixteen have length fourteen; the total tested predictions are `5·7·15 + 16·14·15 = 3885`, all correct. The tied shift/readout outputs the original codeword when the first tick is aligned, and a rotation otherwise. Because every label has six positive readings, an activity-count observer distinguishes zero of the `binom(21,2)=210` evaluator pairs. ∎ + +*Lower obstruction.* The exact integer deletion-resource bound from PB-2 is evaluated for every integer `1≤T≤13` and every weight `0≤w≤T` (complement symmetry reduces to `w≤floor(T/2)`). The maximal resource-count bounds over weights are: + +| Maximum visits `T` | 8 | 9 | 10 | 11 | 12 | 13 | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | +| Maximum labels allowed by resource bound | 3 | 3 | 5 | 7 | 14 | 17 | + +All smaller `T` have still smaller bounds. The worst case is `T=13,w=6`. There are exactly `99` deletion-necklace resources; among the `132` candidate six-subset necklaces, six use five resources and the remaining 126 use six. Selecting 18 would consume at least `6·5 + 12·6=102>99` resources. Hence at most 17 labels fit at that width. At `T=12,w=6`, the cost multiplicities `(cost,number)` are `(1,1),(2,1),(3,3),(5,4),(6,71)`, totaling 66 resource classes, and the corresponding bound is 14. The checked-in `COE06_BOUND_LEDGER.json` contains the full per-width and per-weight enumeration, recomputed by `resource_bound.py` using only the standard library. Thus all `T≤13` exclude 21 labels; the length-14 construction is optimal for the stated requirement. ∎ + +These bounds concern **constant Hamming weight** (identical positive counts), a *single tied head* with access to the exact cyclic register state, unknown start phase, and guaranteed correction of one arbitrary bit flip. Variable-weight or phase-marked observers are separate classes. + +## 4. Heldout phase-gauge diagnostic on COE-05 + +A second, observational analysis replays the previously selected frozen one-bit heads (synthetic causal-attention models 2411–2413, contexts 4–7) and replaces each four-bit transcript with its **canonical cyclic necklace**. The replay fixes the COE-05 fit-only thresholds and weights, checks original source checkpoint identifiers, and independently recomputes every evaluated edge from stored per-visit activations. + +| Readout on 336 heldout evaluator pairs | Separated | +| --- | ---: | +| Aligned ordered transcript | 243 | +| Rotation-invariant necklace | 233 | +| Positive-count-only | 233 | +| Differences preserved by order but destroyed by unknown phase | 10 | + +All ten COE-05 order-only hits vanish in the unknown-phase quotient. This was not a new prospective study: it is an exact post-hoc diagnostic on the same frozen observations, with no probe retraining. The constructed twenty-one-label register is a proof of possible *phase-invariant* capacity, and is **not** the trained attention model. + +## 5. Evidence scope + +- `gauge_orbit_codes.py`: exact cross-orbit distances, all corruption cases, explicit tied register map. +- `resource_bound.py`: exhaustive integer enumeration for every `T≤13` and weight; independent of SciPy or any external MILP solver. +- `phase_gauge_replay.py`: frozen, read-only COE-05 heldout replay with the original fit-only heads. +- `MathCan/PhaseBlindObservers.lean`: 21 finite words, constant-weight and pairwise rotated-margin certificates, and the exact largest subcritical integer-budget consequences under Lean 4.35.0. The resource-disjointness theorem and all-`T` enumeration remain supported by the written proof and exact Python oracle, rather than a complete Lean formalization. + +This mathematical campaign concerns synthetic models and a coding-theoretic capacity theorem. A native-pretrained LoopedTransformers experiment should extract raw per-visit activations for pinned checkpoints, lock evaluator edges before fitting probes, and compare aligned/unknown-phase accuracy and causal task behavior on group-disjoint holdouts. From 9649a1627fdfb90d1e14b8143f6493e672c45d7a Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sun, 15 Nov 2026 17:34:17 +0800 Subject: [PATCH 12/15] COE-07: phase-gauge pair-collision theorem, Lean merge identity and exact necklace bounds --- .../workflows/coe07-phase-gauge-ledger.yml | 30 +++++++ MathCan.lean | 1 + MathCan/PhaseGaugePairLedger.lean | 82 +++++++++++++++++++ .../PHASE_GAUGE_PAIR_LEDGER.md | 55 +++++++++++++ tests/test_phase_gauge_pair_ledger.py | 60 ++++++++++++++ 5 files changed, 228 insertions(+) create mode 100644 .github/workflows/coe07-phase-gauge-ledger.yml create mode 100644 MathCan/PhaseGaugePairLedger.lean create mode 100644 research/compactification/PHASE_GAUGE_PAIR_LEDGER.md create mode 100644 tests/test_phase_gauge_pair_ledger.py diff --git a/.github/workflows/coe07-phase-gauge-ledger.yml b/.github/workflows/coe07-phase-gauge-ledger.yml new file mode 100644 index 00000000..7bfe77e8 --- /dev/null +++ b/.github/workflows/coe07-phase-gauge-ledger.yml @@ -0,0 +1,30 @@ +name: COE-07 phase-gauge pair ledger proofs +on: + pull_request: + paths: + - 'MathCan/PhaseGaugePairLedger.lean' + - 'MathCan.lean' + - 'research/compactification/PHASE_GAUGE_PAIR_LEDGER.md' + - '.github/workflows/coe07-phase-gauge-ledger.yml' + workflow_dispatch: +permissions: + contents: read +jobs: + lean-phase-ledger: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: leanprover/lean-action@v1 + with: + auto-config: false + build: true + build-args: MathCan + test: false + lint: false + use-mathlib-cache: false + - name: Kernel check and transitive-axiom report + shell: bash + run: | + set -euo pipefail + lake env lean MathCan/PhaseGaugePairLedger.lean | tee coe07-axioms.txt + if grep -Eq 'sorryAx|ofReduceBool' coe07-axioms.txt; then exit 1; fi diff --git a/MathCan.lean b/MathCan.lean index cb302ea0..64791a33 100644 --- a/MathCan.lean +++ b/MathCan.lean @@ -53,3 +53,4 @@ import MathCan.SoftObserverPrecision import MathCan.TemporalCutCapacity import MathCan.PhaseGaugeCapacity import MathCan.PhaseBlindObservers +import MathCan.PhaseGaugePairLedger diff --git a/MathCan/PhaseGaugePairLedger.lean b/MathCan/PhaseGaugePairLedger.lean new file mode 100644 index 00000000..d927e1e6 --- /dev/null +++ b/MathCan/PhaseGaugePairLedger.lean @@ -0,0 +1,82 @@ +import Init + +/-! +COE-07: pairwise discriminator loss under hierarchical observer quotients. + +The paper proves the full graph-collision formula and optimal balanced +necklace allocations. Here Lean establishes the pair-count merge identity, +exact telescoping of ordered/cyclic/count collisions, and finite arithmetic +receipts. Native LoopScope data are not imported as axioms. +-/ +namespace MathCan.PhaseGaugePairLedger + +set_option maxRecDepth 4096 +set_option maxHeartbeats 1000000 + +/-- The number of unordered pairs in a group of size n, defined recursively + without division or any untrusted computation. -/ +def pairs : Nat → Nat + | 0 => 0 + | n + 1 => pairs n + n + +/-- Merging two disjoint color classes produces exactly a*b new collisions. + This is the combinatorial atom of the phase-quotient loss formula. -/ +theorem pairs_add (a b : Nat) : + pairs (a + b) = pairs a + pairs b + a * b := by + induction b with + | zero => + simp [pairs] + | succ b ih => + simp only [Nat.add_succ, pairs] + rw [ih] + simp only [Nat.mul_succ] + omega + +/-- The additional collision cost of a single class merge is a*b. -/ +theorem merge_collision_gap (a b : Nat) : + pairs (a + b) - (pairs a + pairs b) = a * b := by + rw [pairs_add] + omega + +/-- Given the nested collision counts from ordered histories, necklaces, + and popcounts, the retained-pair ledger telescopes exactly. -/ +theorem phase_quotient_ledger (total orderedCollision cyclicCollision countCollision : Nat) + (hoc : orderedCollision ≤ cyclicCollision) + (hcc : cyclicCollision ≤ countCollision) + (hct : countCollision ≤ total) : + total - orderedCollision = + (total - countCollision) + + (countCollision - cyclicCollision) + + (cyclicCollision - orderedCollision) := by + omega + +/-- Eight visits and nine labels give thirty-six possible K9 pairs. -/ +theorem nine_label_pairs : pairs 9 = 36 := by decide + +/-- Sixty-four labels have 2016 unordered pairs before the digit-equality + exclusions used by the empirical benchmark. -/ +theorem sixty_four_pairs : pairs 64 = 2016 := by decide + +/-- The observed 8-step S4 oracle counts are consistent with the algebraic + telescope; this is integer arithmetic, not a kernel proof of the source. -/ +theorem s4_stalled_eight_visit_arithmetic : + 1414 = 1389 + 25 ∧ + 1389 = 1369 + 20 ∧ + 1369 ≤ 1795 := by decide + +/-- A four-class population split admits an exact constructive loss budget. -/ +theorem two_pair_merges (a b c d : Nat) : + pairs (a + b) + pairs (c + d) = + pairs a + pairs b + pairs c + pairs d + a*b + c*d := by + rw [pairs_add, pairs_add] + omega + +#print axioms pairs_add +#print axioms merge_collision_gap +#print axioms phase_quotient_ledger +#print axioms nine_label_pairs +#print axioms sixty_four_pairs +#print axioms s4_stalled_eight_visit_arithmetic +#print axioms two_pair_merges + +end MathCan.PhaseGaugePairLedger diff --git a/research/compactification/PHASE_GAUGE_PAIR_LEDGER.md b/research/compactification/PHASE_GAUGE_PAIR_LEDGER.md new file mode 100644 index 00000000..00e18440 --- /dev/null +++ b/research/compactification/PHASE_GAUGE_PAIR_LEDGER.md @@ -0,0 +1,55 @@ +# COE-07: exact pairwise information ledger for clock-gauge quotients + +**Status:** new elementary synthesis for the Compactification / LoopScope research program. Proof below. Literature-wide novelty or priority unassessed. Source motivation is OpenAI Math #098 (global metric compression obstructions) and #332 (forward Lipschitz extension), together with the completed COE-05/06 binary recurrent coding investigations. No deep claims from those manuscripts enter the proof. + +## Finite complete-evaluator theorem + +Let \(x_1,\ldots,x_n\) be n evaluator-distinct states. A fixed shared binary recurrent readout produces one T-bit word \(W_i\) per state. Define its cyclic necklace \(N_i = \min_{0\le s0. Therefore a collision-minimizing allocation has group sizes differing by at most one. Increasing the number of used classes weakly decreases collisions, until all min(q(T,w),n) slots are used. The quotient/remainder expression follows. Each distinct necklace exists by the definition of q(T,w); assigning those representatives constructs the optimal observer. \(\square\) + +For T=8 and w=4, the exact necklace count is 10. Thus for n≤10, eight recurrent observations support **n(n−1)/2** clock-gauge-invariant distinctions even with identical positive counts, absent margin or decoder constraints. COE-06's one-flip-correcting construction imposes additional inter-orbit distance and therefore a stricter coding problem. + +**Theorem COE-07C (class-merge gap).** If two code classes containing a and b labels become equivalent under a coarser observation, then exactly ab distinctions are lost. More generally, any quotient sequence can be priced by summing these pairwise merge costs, independently of the order of merging. + +*Proof.* \(\binom{a+b}{2}-\binom a2-\binom b2=ab\). For several merges apply the identity inductively; both the final partition and original partition determine the overall difference in collisions. \(\square\) + +## Exact native output-telemetry diagnostic + +An independent read of the earlier committed `LoopedTransformers` 7M pretrained `gaoxin492/step_21700` correctness-receipt (checkpoint SHA-256 `932b5e0d...`) and matched benchmark counted 1,795 eligible distinct-digit pairs within the 64-item `S4_stalled` stratum. At eight ACT visits, the source has \(D(W)=1414\), \(D(N)=1389\), \(D(C)=1369\). Thus COE-07A attributes **25** distinctions to known clock phase and **20** further distinctions to cyclic-invariant order. The other three strata have no cyclic-invariant gain over count in that eight-visit source record. + +This empirical descriptor is \(W_t=1\{\text{model's target-cell prediction at step t equals the known target}\}\). It uses **ground truth**, so it is an oracle on an existing native run, rather than a deployable model-observable probe or evidence of a learned dark-fiber code. The preregistered native latent-probe test in `LoopedTransformers PR #72` requires checkpoint inference and its independently frozen fit/test gate. The source file Git blob IDs appear in that PR's `NATIVE_OUTPUT_TELEMETRY.md`. + +## Formalization boundary + +`MathCan/PhaseGaugePairLedger.lean` checks the group-merge identity \(\binom{a+b}2=\binom a2+\binom b2+ab\) for arbitrary natural sizes using a recursive pair-count definition, the general nested-collision ledger given its order premises, and concrete arithmetic cells. It prints the transitive axiom set for each statement. The combinatorial partition proof and sharp balanced necklace-capacity theorem are proved in this manuscript; full formalization of those higher-level constructions remains an open step. diff --git a/tests/test_phase_gauge_pair_ledger.py b/tests/test_phase_gauge_pair_ledger.py new file mode 100644 index 00000000..3ff6a70e --- /dev/null +++ b/tests/test_phase_gauge_pair_ledger.py @@ -0,0 +1,60 @@ +"""Independent exact finite oracles for COE-07 pairwise clock-gauge identities.""" +from itertools import combinations +from math import comb +import unittest + + +def necklace(word, T): + mask=(1<>(T-shift)))&mask for shift in range(T)) + + +def sharp_capacity(n,T,w): + reps={necklace(sum(1< Date: Sun, 15 Nov 2026 17:35:55 +0800 Subject: [PATCH 13/15] fix(COE-07): preserve induction hypothesis across pair-count recursion --- MathCan/PhaseGaugePairLedger.lean | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/MathCan/PhaseGaugePairLedger.lean b/MathCan/PhaseGaugePairLedger.lean index d927e1e6..a6b3ea47 100644 --- a/MathCan/PhaseGaugePairLedger.lean +++ b/MathCan/PhaseGaugePairLedger.lean @@ -27,10 +27,14 @@ theorem pairs_add (a b : Nat) : | zero => simp [pairs] | succ b ih => - simp only [Nat.add_succ, pairs] - rw [ih] - simp only [Nat.mul_succ] - omega + calc + pairs (a + (b + 1)) = pairs (a + b) + (a + b) := by + simp only [Nat.add_succ, pairs] + _ = (pairs a + pairs b + a * b) + (a + b) := by + rw [ih] + _ = pairs a + pairs (b + 1) + a * (b + 1) := by + simp only [pairs, Nat.mul_succ] + omega /-- The additional collision cost of a single class merge is a*b. -/ theorem merge_collision_gap (a b : Nat) : From 274cf590b82fd4e33aa8c0a0f0a13bc7297964f0 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sun, 15 Nov 2026 17:40:36 +0800 Subject: [PATCH 14/15] COE-07: certify visit-budget phase-gauge ledgers at T=4 and T=16 --- MathCan/PhaseGaugePairLedger.lean | 14 ++++++++++++++ .../compactification/PHASE_GAUGE_PAIR_LEDGER.md | 10 ++++++++++ 2 files changed, 24 insertions(+) diff --git a/MathCan/PhaseGaugePairLedger.lean b/MathCan/PhaseGaugePairLedger.lean index a6b3ea47..bc22c695 100644 --- a/MathCan/PhaseGaugePairLedger.lean +++ b/MathCan/PhaseGaugePairLedger.lean @@ -68,6 +68,18 @@ theorem s4_stalled_eight_visit_arithmetic : 1389 = 1369 + 20 ∧ 1369 ≤ 1795 := by decide +/-- Prior four-visit stalled-board output ledger, 64 boards, distinct digits. -/ +theorem s4_stalled_four_visit_arithmetic : + 1278 = 1244 + 34 ∧ + 1244 = 1244 + 0 ∧ + 1244 ≤ 1795 := by decide + +/-- Extended sixteen-visit stalled-board output ledger, same 64 boards. -/ +theorem s4_stalled_sixteen_visit_arithmetic : + 1447 = 1428 + 19 ∧ + 1428 = 1422 + 6 ∧ + 1422 ≤ 1795 := by decide + /-- A four-class population split admits an exact constructive loss budget. -/ theorem two_pair_merges (a b c d : Nat) : pairs (a + b) + pairs (c + d) = @@ -81,6 +93,8 @@ theorem two_pair_merges (a b c d : Nat) : #print axioms nine_label_pairs #print axioms sixty_four_pairs #print axioms s4_stalled_eight_visit_arithmetic +#print axioms s4_stalled_four_visit_arithmetic +#print axioms s4_stalled_sixteen_visit_arithmetic #print axioms two_pair_merges end MathCan.PhaseGaugePairLedger diff --git a/research/compactification/PHASE_GAUGE_PAIR_LEDGER.md b/research/compactification/PHASE_GAUGE_PAIR_LEDGER.md index 00e18440..69555e9a 100644 --- a/research/compactification/PHASE_GAUGE_PAIR_LEDGER.md +++ b/research/compactification/PHASE_GAUGE_PAIR_LEDGER.md @@ -48,6 +48,16 @@ For T=8 and w=4, the exact necklace count is 10. Thus for n≤10, eight recurren An independent read of the earlier committed `LoopedTransformers` 7M pretrained `gaoxin492/step_21700` correctness-receipt (checkpoint SHA-256 `932b5e0d...`) and matched benchmark counted 1,795 eligible distinct-digit pairs within the 64-item `S4_stalled` stratum. At eight ACT visits, the source has \(D(W)=1414\), \(D(N)=1389\), \(D(C)=1369\). Thus COE-07A attributes **25** distinctions to known clock phase and **20** further distinctions to cyclic-invariant order. The other three strata have no cyclic-invariant gain over count in that eight-visit source record. +The same frozen output trace has the following **visit-budget sensitivity** for stalled boards, with the identical 1,795 eligible pairs: + +| Visits | Ordered D(W) | Cyclic D(N) | Count D(C) | Clock-sensitive | Cyclic beyond count | +| ---: | ---: | ---: | ---: | ---: | ---: | +| 4 | 1,278 | 1,244 | 1,244 | 34 | 0 | +| 8 | 1,414 | 1,389 | 1,369 | 25 | 20 | +| 16 | 1,447 | 1,428 | 1,422 | 19 | 6 | + +These are descriptive post-hoc replays across the same frozen boards, and all outcomes are recorded with answer-aware correctness bits. + This empirical descriptor is \(W_t=1\{\text{model's target-cell prediction at step t equals the known target}\}\). It uses **ground truth**, so it is an oracle on an existing native run, rather than a deployable model-observable probe or evidence of a learned dark-fiber code. The preregistered native latent-probe test in `LoopedTransformers PR #72` requires checkpoint inference and its independently frozen fit/test gate. The source file Git blob IDs appear in that PR's `NATIVE_OUTPUT_TELEMETRY.md`. ## Formalization boundary From e50ab2f981d7d1296eeda2434be50084d0e3dab2 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sun, 15 Nov 2026 17:56:38 +0800 Subject: [PATCH 15/15] COE-07R: prove dihedral observer collision and majority ledgers --- .github/workflows/coe07r-dihedral-gauge.yml | 38 +++++++++ MathCan.lean | 1 + MathCan/DihedralPhaseGauge.lean | 65 ++++++++++++++++ .../DIHEDRAL_GAUGE_OBSERVER_LEDGER.md | 78 +++++++++++++++++++ tests/test_dihedral_phase_gauge.py | 56 +++++++++++++ 5 files changed, 238 insertions(+) create mode 100644 .github/workflows/coe07r-dihedral-gauge.yml create mode 100644 MathCan/DihedralPhaseGauge.lean create mode 100644 research/compactification/DIHEDRAL_GAUGE_OBSERVER_LEDGER.md create mode 100644 tests/test_dihedral_phase_gauge.py diff --git a/.github/workflows/coe07r-dihedral-gauge.yml b/.github/workflows/coe07r-dihedral-gauge.yml new file mode 100644 index 00000000..597f0f06 --- /dev/null +++ b/.github/workflows/coe07r-dihedral-gauge.yml @@ -0,0 +1,38 @@ +name: COE-07R dihedral observer finite and Lean audit +on: + pull_request: + paths: + - 'MathCan/DihedralPhaseGauge.lean' + - 'MathCan.lean' + - 'research/compactification/DIHEDRAL_GAUGE_OBSERVER_LEDGER.md' + - 'tests/test_dihedral_phase_gauge.py' + - '.github/workflows/coe07r-dihedral-gauge.yml' + workflow_dispatch: +permissions: + contents: read +jobs: + finite: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - run: python -m unittest discover -s tests -p 'test_dihedral_phase_gauge.py' -v + lean: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: leanprover/lean-action@v1 + with: + auto-config: false + build: true + build-args: MathCan + test: false + lint: false + use-mathlib-cache: false + - name: Check finite theorems and transitive axiom inventory + run: | + set -euo pipefail + lake env lean MathCan/DihedralPhaseGauge.lean | tee coe07r-axioms.txt + if grep -Eq 'sorryAx|ofReduceBool' coe07r-axioms.txt; then exit 1; fi diff --git a/MathCan.lean b/MathCan.lean index 64791a33..eaa45def 100644 --- a/MathCan.lean +++ b/MathCan.lean @@ -54,3 +54,4 @@ import MathCan.TemporalCutCapacity import MathCan.PhaseGaugeCapacity import MathCan.PhaseBlindObservers import MathCan.PhaseGaugePairLedger +import MathCan.DihedralPhaseGauge diff --git a/MathCan/DihedralPhaseGauge.lean b/MathCan/DihedralPhaseGauge.lean new file mode 100644 index 00000000..272a2b13 --- /dev/null +++ b/MathCan/DihedralPhaseGauge.lean @@ -0,0 +1,65 @@ +import Init + +/-! +COE-07R: a four-level observer quotient for ordered histories, cyclic +necklaces, dihedral bracelets and counts. These lemmas check arithmetic +under stated collision premises; the full combinatorial orbit theorem +appears in the accompanying MathCan manuscript. +-/ +namespace MathCan.DihedralPhaseGauge + +set_option maxHeartbeats 1000000 + +/-- Nested collision classes yield an exact three-part loss ledger. -/ +theorem dihedral_collision_ledger + (eligible orderedCollision cyclicCollision dihedralCollision countCollision : Nat) + (h₁ : orderedCollision ≤ cyclicCollision) + (h₂ : cyclicCollision ≤ dihedralCollision) + (h₃ : dihedralCollision ≤ countCollision) + (h₄ : countCollision ≤ eligible) : + eligible - orderedCollision = + (eligible - countCollision) + + (countCollision - dihedralCollision) + + (dihedralCollision - cyclicCollision) + + (cyclicCollision - orderedCollision) := by + omega + +/-- In a merge of two label classes, cross-pairs split into same-label + and different-label parts, with no probabilistic assumptions. -/ +theorem two_label_cross_pairs (a₀ a₁ b₀ b₁ : Nat) : + (a₀ + a₁) * (b₀ + b₁) = + (a₀*b₀ + a₁*b₁) + (a₀*b₁ + a₁*b₀) := by + simp only [Nat.add_mul, Nat.mul_add] + omega + +/-- The best single label for a merged class cannot outperform the two + separate classwise-majority decoders. -/ +theorem majority_cannot_improve_after_merge (a₀ a₁ b₀ b₁ : Nat) : + max (a₀ + b₀) (a₁ + b₁) ≤ max a₀ a₁ + max b₀ b₁ := by + omega + +/-- Numeric Burnside checksum, conditional on exact orbit enumerations. -/ +theorem eight_visit_weight_four_burnside_arithmetic : + 10 + 6 = 2 * 8 := by decide + +/-- Exact native trace arithmetic in the 64-board stalled stratum. -/ +theorem native_s4_eight_visit_ledger : + 1414 = 1389 + 25 ∧ + 1389 = 1389 + 0 ∧ + 1389 = 1369 + 20 ∧ + 1414 ≤ 1795 := by decide + +/-- Sixteen visits retain only six dihedral-over-count distinctions. -/ +theorem native_s4_sixteen_visit_ledger : + 1447 = 1428 + 19 ∧ + 1428 = 1422 + 6 ∧ + 1447 ≤ 1795 := by decide + +#print axioms dihedral_collision_ledger +#print axioms two_label_cross_pairs +#print axioms majority_cannot_improve_after_merge +#print axioms eight_visit_weight_four_burnside_arithmetic +#print axioms native_s4_eight_visit_ledger +#print axioms native_s4_sixteen_visit_ledger + +end MathCan.DihedralPhaseGauge diff --git a/research/compactification/DIHEDRAL_GAUGE_OBSERVER_LEDGER.md b/research/compactification/DIHEDRAL_GAUGE_OBSERVER_LEDGER.md new file mode 100644 index 00000000..a1a5c41c --- /dev/null +++ b/research/compactification/DIHEDRAL_GAUGE_OBSERVER_LEDGER.md @@ -0,0 +1,78 @@ +# COE-07R: dihedral observer and unequal-label collision ledger + +**November 15, 2026.** A self-contained finite theorem for cyclically recurrent observations. The result extends the earlier COE-07 phase-gauge ledger to **unknown observation direction**, repeated task labels, and the optimal in-sample decoder of a deterministic descriptor. Literature-wide novelty and priority have not been established. + +## Definitions and theorem + +Let `X` be a finite population with labels `ell:X->A`. A T-visit binary observer gives a word `W(x)`. The cyclic group `C_T` acts on words by rotations. The dihedral group `D_T` additionally reverses their order. Define `N(x)` as the least integer in the rotation orbit (necklace), `B(x)` as the least integer in the rotation/reversal orbit (bracelet), and `C(x)` as popcount. Thus there are nested equivalence relations: + +``` + equality of W refines equality of N refines equality of B refines equality of C. +``` + +For any descriptor `Q:X->Qspace`, write + +``` + n_(q,a) = #{x: Q(x)=q and ell(x)=a}, + n_q = sum_a n_(q,a), + E = #{unordered {x,y}: ell(x) != ell(y)}. +``` + +The **exact unequal-label separation theorem** is + +\[ +D_\ell(Q)=E-\sum_q \left[\binom{n_q}{2}-\sum_{a\in A}\binom{n_{q,a}}2\right]. +\] + +*Proof:* Every eligible pair is either separated by Q or falls into one of its equivalence classes. Inside a class q there are `binom(n_q,2)` pairs, of which `sum_a binom(n_(q,a),2)` share their label and are ineligible. The remaining pairs are exactly the eligible descriptor collisions. Subtract these from E. Each pair falls into a unique class, so the sum is exact. This also covers repeated labels and empty classes. + +Consequently + +\[ +\boxed{D_\ell(W)-D_\ell(C) + = [D_\ell(W)-D_\ell(N)] + + [D_\ell(N)-D_\ell(B)] + + [D_\ell(B)-D_\ell(C)]} +\] + +with each bracket nonnegative by the nested equivalence relations. The middle term measures **orientation-sensitive distinctions that survive uncertainty about the starting clock**. The last term measures distinctions encoded in dihedral-invariant temporal *shape* at fixed count. Pair gaps are exact integer ledger entries with no independence assumption. + +## Sharp decoder theorem under descriptor coarsening + +For `x` uniformly drawn from X, let an oracle choose the most frequent label within the observed class Q=q. The maximal possible *in-sample* correct fraction is + +\[ +\boxed{A_\ell(Q)=\frac{1}{|X|}\sum_q \max_{a\in A} n_{q,a}.} +\] + +*Proof:* The choices for distinct observed q are independent. The best prediction for a class is a label attaining `max_a n_(q,a)`. The displayed sum counts all correctly predicted members and attains the upper bound. For a coarsening that merges two Q classes with label-count vectors `u=(u_a)` and `v=(v_a)`, the decrease in the correct numerator is precisely + +\[ + \Delta_A = \max_a u_a + \max_a v_a - \max_a(u_a+v_a)\ge0. +\] + +It is nonnegative because `u_a+v_a <= max u + max v` for every a. Repeated merges prove `A_ell(W)>=A_ell(N)>=A_ell(B)>=A_ell(C)`. This class-majority decoder uses the very labels it scores; applying the formula to pre-recorded truth-conditioned histories is an **oracle analysis**, not a generalization claim. + +## Dihedral orbit-count identity + +Let `n(T,w)` be the number of cyclic necklaces of T bits and fixed weight w. Reversal is a well-defined involution on the set of necklaces, since reversing a rotation is another rotation of the reversed word. Let `f(T,w)` count necklaces fixed by this involution. Every orbit under the involution has one or two necklaces, so the number `b(T,w)` of bracelets is exactly + +\[ +\boxed{b(T,w)=\frac{n(T,w)+f(T,w)}2.} +\] + +For T=8, w=4, exact enumeration gives `n=10`, `f=6`, `b=8`. For T=8, w=3 or 5, `n=7`, `b=5`. These finite counts are independently checked by the companion Python reference. Every equality above follows from elementary orbit partitioning and is separate from the cited OpenAI Math manuscripts. + +## Native empirical instantiation + +The prior `LoopedTransformers` 7M pretrained TRM correctness telemetry, a truth-conditioned oracle, has `E=1795` unequal-target-digit pairs among the 64 stalled Sudoku boards. At T=8: + +- `D(W)=1414`, `D(N)=1389`, `D(B)=1389`, `D(C)=1369`. +- The three lost/retained ledger entries are `(25, 0, 20)`. +- The descriptor-class majority-oracle numerators are `(30, 24, 24, 19)` out of 64 samples. + +At T=16 the pair scores are `(1447,1428,1428,1422)`, giving `(19,0,6)`. These numbers are independently replayed from immutable source receipts in `MoralityLabAI/LoopedTransformers/mechinterp/phase_gauge07/dihedral_replay.py`. SHA-256 of the pretrained checkpoint is `932b5e0df4e90021c21a064d4e716154086c46fda7afa676ea294484a30e38c3`; the original benchmark SHA is `59459ae0bb60b75db5be017e5f41adead391f2abb0b8fb043cd331c0ee043811`. + +## Formalization boundary + +`MathCan/DihedralPhaseGauge.lean` proves the subtraction ledger from nested natural-number collision counts, the two-label cross-pair expansion and two-class majority inequality as applicable, plus exact integer cells for the source replay. This is a **partial** Lean formalization. The general classifier collision formula, the orbit quotient theorem and its Burnside interpretation have the complete mathematical proofs above and independent finite tests; Lean does not import or trust model outputs. diff --git a/tests/test_dihedral_phase_gauge.py b/tests/test_dihedral_phase_gauge.py new file mode 100644 index 00000000..5ff04364 --- /dev/null +++ b/tests/test_dihedral_phase_gauge.py @@ -0,0 +1,56 @@ +"""Independent standard-library finite checks for the dihedral observer ledger.""" +from collections import Counter, defaultdict +from itertools import product, combinations +from math import comb +import unittest + + +def rot(word,T,j): + j %= T + return ((word << j) | (word >> (T-j))) & ((1 << T)-1) + +def rev(word,T): + return sum(((word >> i)&1) << (T-1-i) for i in range(T)) + +def neck(word,T):return min(rot(word,T,j) for j in range(T)) +def brace(word,T):return min(neck(word,T),neck(rev(word,T),T)) + +def exact_formula(words, labels, descriptor): + classes=defaultdict(list) + for word,label in zip(words,labels):classes[descriptor(word)].append(label) + eligible=sum(a!=b for a,b in combinations(labels,2)) + collisions=sum(comb(len(g),2)-sum(comb(v,2) for v in Counter(g).values()) + for g in classes.values()) + return eligible-collisions + + +class TestDihedralLedger(unittest.TestCase): + def test_burnside_count_at_eight_visits(self): + for weight,counts in ((3,(7,5)),(4,(10,8)),(5,(7,5))): + xs=[word for word in range(256) if word.bit_count()==weight] + n={neck(x,8) for x in xs};b={brace(x,8) for x in xs} + fixed=sum(neck(rev(x,8),8)==x for x in n) + self.assertEqual((len(n),len(b)),counts) + self.assertEqual(len(n)+fixed,2*len(b)) + + def test_all_labelled_small_quotients(self): + for words in product(range(4),repeat=3): + for labels in product((1,2),repeat=3): + T=2 + funcs=(lambda x:x,lambda x:neck(x,T),lambda x:brace(x,T),int.bit_count) + by=[exact_formula(words,labels,fn) for fn in funcs] + self.assertEqual(by,sorted(by,reverse=True)) + self.assertEqual(by[0]-by[3],sum(by[i]-by[i+1] for i in range(3))) + + def test_class_majority_merge(self): + for a,b,c,d in product(range(6),repeat=4): + self.assertLessEqual(max(a+c,b+d),max(a,b)+max(c,d)) + self.assertEqual((a+b)*(c+d),a*c+b*d+a*d+b*c) + + def test_pinned_arithmetic_cells(self): + for T,vals in ((8,(1414,1389,1389,1369)),(16,(1447,1428,1428,1422))): + o,c,d,h=vals + self.assertEqual(o-h,(o-c)+(c-d)+(d-h)) + self.assertTrue(1795>=o>=c>=d>=h) + +if __name__=='__main__':unittest.main()