From a9634c95a49e2ac10318abc35cfd981fc7a8e375 Mon Sep 17 00:00:00 2001 From: Ali Romman <226877337+aliromman@users.noreply.github.com> Date: Wed, 18 Nov 2026 17:13:44 -0500 Subject: [PATCH] Construct rank-exact dyadic quaternion factors --- .../.gitattributes | 1 + .../CREDITS.md | 43 ++ .../PROOF.md | 215 ++++++ .../README.md | 62 ++ .../RESULT.json | 670 ++++++++++++++++++ .../SOURCE-PINS.json | 50 ++ .../SOURCES.json | 18 + .../TASK.json | 90 +++ .../VALIDATION.md | 28 + .../VERIFY.json | 32 + .../factor.py | 140 ++++ .../retained/pr5803/volume-algebra.md | 262 +++++++ .../retained/pr7745/README.md | 117 +++ .../retained/pr7745/SOURCES.json | 25 + .../retained/pr7745/TASK.json | 90 +++ .../retained/pr7745/VERIFY.json | 34 + .../retained/pr7745/verify.py | 122 ++++ .../verify.py | 227 ++++++ 18 files changed, 2226 insertions(+) create mode 100644 research/dyadic-quaternion-rank-factorization/.gitattributes create mode 100644 research/dyadic-quaternion-rank-factorization/CREDITS.md create mode 100644 research/dyadic-quaternion-rank-factorization/PROOF.md create mode 100644 research/dyadic-quaternion-rank-factorization/README.md create mode 100644 research/dyadic-quaternion-rank-factorization/RESULT.json create mode 100644 research/dyadic-quaternion-rank-factorization/SOURCE-PINS.json create mode 100644 research/dyadic-quaternion-rank-factorization/SOURCES.json create mode 100644 research/dyadic-quaternion-rank-factorization/TASK.json create mode 100644 research/dyadic-quaternion-rank-factorization/VALIDATION.md create mode 100644 research/dyadic-quaternion-rank-factorization/VERIFY.json create mode 100644 research/dyadic-quaternion-rank-factorization/factor.py create mode 100644 research/dyadic-quaternion-rank-factorization/retained/pr5803/volume-algebra.md create mode 100644 research/dyadic-quaternion-rank-factorization/retained/pr7745/README.md create mode 100644 research/dyadic-quaternion-rank-factorization/retained/pr7745/SOURCES.json create mode 100644 research/dyadic-quaternion-rank-factorization/retained/pr7745/TASK.json create mode 100644 research/dyadic-quaternion-rank-factorization/retained/pr7745/VERIFY.json create mode 100644 research/dyadic-quaternion-rank-factorization/retained/pr7745/verify.py create mode 100644 research/dyadic-quaternion-rank-factorization/verify.py diff --git a/research/dyadic-quaternion-rank-factorization/.gitattributes b/research/dyadic-quaternion-rank-factorization/.gitattributes new file mode 100644 index 0000000000..130a3ecaa2 --- /dev/null +++ b/research/dyadic-quaternion-rank-factorization/.gitattributes @@ -0,0 +1 @@ +retained/** -text whitespace=cr-at-eol diff --git a/research/dyadic-quaternion-rank-factorization/CREDITS.md b/research/dyadic-quaternion-rank-factorization/CREDITS.md new file mode 100644 index 0000000000..3ff39c523b --- /dev/null +++ b/research/dyadic-quaternion-rank-factorization/CREDITS.md @@ -0,0 +1,43 @@ +# Credit and source roles + +Ali Romman supplied the source-specific general factorization proof, exact +Hurwitz row reducer, inverse and denominator certificates, and separate +rational block-rank checks, with substantial OpenAI Codex assistance in +research, implementation, verification and writing. Apache-2.0. + +Nick Petalas supplied the integral channel-gap response, proof, verifier and +explicit general dyadic-factorization handoff in +[PR #7745](https://github.com/CrocSwap/integer-mult-bounds/pull/7745), head +`b92ecb5f9579215dda5832fe604f4124b0198cde`. Its +[proof and next question](https://github.com/petalas/integer-mult-bounds/blob/b92ecb5f9579215dda5832fe604f4124b0198cde/research/lipschitz-channel-gap/README.md) +and all five package files are retained unchanged. The original basis, +parity and norm-two-divisor checks run unchanged. The separate certificate +checker also calls the retained multiplication formula. His source credits +Machiavelo and Roçadas for the classical nonassociate norm-two example; +that predecessor credit remains in the retained source. + +Dugongue supplied the odd-response factorization interface, split dyadic +comparison and nonsplit question RQ10 in +[PR #5803](https://github.com/CrocSwap/integer-mult-bounds/pull/5803), head +`0acda5ab421d28b98fdf916968696c8f9453376f`. The complete +[algebra volume](https://github.com/CrocSwap/integer-mult-bounds/blob/0acda5ab421d28b98fdf916968696c8f9453376f/research/frontier-mathematical-atlas/volume-algebra.md) +is retained byte for byte, including its attribution and physical limits. +R03-R07 and RQ10 are the relevant sections. We do not claim to review the +whole atlas or to supply its missing physical caller. + +The Hurwitz order, its half-integer lattice, Euclidean division and elementary +row reduction are classical. John Voight's +[The Hurwitz order](https://link.springer.com/chapter/10.1007/978-3-030-56694-4_11), +chapter 11 of *Quaternion Algebras* (2021), gives the order in section 11.1 +and left/right norm-Euclidean division in section 11.3, Lemma 11.3.2. +Paragraph 11.3.1 and Exercise 11.7 state the one-half squared covering bound. +The proof here derives that bound and the left-operation convention directly. +No global novelty is claimed for this classical algebra or its usual rank +factorization consequence. The contribution answers the repository's exact +open coefficient question and supplies a reproducible attaining algorithm. + +The external chapter is a mathematical reference, not executable input. +All six retained repository files have Git-blob and SHA-256 pins. The base +manifest records provenance only; no unmerged dependency ancestry is asserted. +Separate computational paths are not independent human or formal-kernel +acceptance. All source-specific notices and licenses remain in force. diff --git a/research/dyadic-quaternion-rank-factorization/PROOF.md b/research/dyadic-quaternion-rank-factorization/PROOF.md new file mode 100644 index 0000000000..501bbe240f --- /dev/null +++ b/research/dyadic-quaternion-rank-factorization/PROOF.md @@ -0,0 +1,215 @@ +# Rank-exact factors over dyadic Hamilton quaternions + +## 1. Statement and meaning + +Let `K=Q+Qi+Qj+Qk` be the Hamilton quaternion division ring, with +`i^2=j^2=k^2=-1` and `ij=k=-ji`. Let `L=Z+Zi+Zj+Zk`, and put +`D=L[1/2]`. For a nonempty finite `m` by `n` matrix `A` over `D`, define +its inner rank over `D` as the smallest `q` for which `A=C B`, with `C` +of size `m` by `q` and `B` of size `q` by `n`, both over `D`. + +**Theorem.** The inner rank of every such `A` equals its rank `r` over `K`. +There is a terminating exact algorithm for attaining factors. If `2^s A` +has integral coordinates, with `s>=0`, the factors can satisfy + +```text +A = C B, +C in Mat_(m,r)(O), 2^s B in Mat_(r,n)(O), +O = Z^4 union (Z+1/2)^4. +``` + +Thus each coordinate of `C` has denominator at most two, and each coordinate +of `B` has denominator dividing `2^(s+1)`. Matrix size and rank do not add +denominator bits to this bound. Rank zero has the usual empty-middle +factorization. The result concerns all finite sizes and coefficients in +this specified ring, not all rational quaternion entries or all orders. + +Here `O` is the classical Hurwitz order. Its Euclidean arithmetic is not +new. This proof applies that arithmetic to the open general-response +question in Nick Petalas's PR7745 and to RQ10 in Dugongue's atlas PR5803. +The atlas's split dyadic case R07 uses integer Smith reduction; this +nonsplit Hamilton component uses Hurwitz row reduction instead. See +`CREDITS.md` for exact sources and the classical reference. + +The theorem provides coefficient factors, not a physical query program. +It does not bound coefficient magnitudes or compilation time in the input +bit length. Reached-grid halving, storage, movement, ordinary coefficient +words, dirty restoration and the complete caller bill remain open. There +is no new kappa or selected-frontier change. + +## 2. The order and a norm-decreasing division + +Write `omega=(1+i+j+k)/2`. Then `O` has integer basis `1,i,j,omega`, since +`k=2omega-1-i-j`. This basis describes exactly the two coordinate cosets in +Section 1. Its nontrivial products are as follows; products with one are +unchanged. + +| Left / right | `i` | `j` | `omega` | +| --- | --- | --- | --- | +| `i` | `-1` | `-1-i-j+2omega` | `-1-j+omega` | +| `j` | `1+i+j-2omega` | `-1` | `i+j-omega` | +| `omega` | `i+j-omega` | `-1-i+omega` | `-1+omega` | + +The table and bilinearity prove closure under multiplication. Conjugation +preserves `O`. For `a=(a0,a1,a2,a3)`, its norm `N(a)=sum ai^2` is central, +positive on nonzero `a`, and multiplicative. The identity +`a conjugate(a)=N(a)` proves the inverse formula in `K`. The norm of a +Hurwitz integer is an integer: this is immediate for integral coordinates; +for four coordinates `zi+1/2`, the norm is `sum(zi^2+zi)+1`. + +For any rational quaternion `x`, round it in two ways: to the nearest point +of `Z^4`, and to the nearest point of `(Z+1/2)^4`. Choose the closer result +`q`, breaking equal-distance ties toward the integer lattice. Both are in +`O`. To bound the distance, let `ui` be the absolute residual from the +integer choice. Then `0<=ui<=1/2`, and the corresponding half-lattice +residual has absolute value `1/2-ui`. Hence + +```text +sum_i [ui^2 + (1/2-ui)^2] <= 1, +N(x-q) <= 1/2. +``` + +This includes ties and signed coordinates. The bound is attained at, for +example, `(1/2,1/2,0,0)`. It is the classical Hurwitz covering bound. + +Given `a,b` in `O` with `b!=0`, choose this `q` for `x=a b^(-1)` and set +`c=a-qb`. The multiplication order is essential. Closure gives `c` in `O`, +and norm multiplicativity gives + +```text +N(c) = N((a b^(-1)-q)b) <= N(b)/2 < N(b). +``` + +Computing the rational inverse for this offline rounding decision can use +odd denominators. The returned quotient `q` and remainder `c` are Hurwitz +integers. The claim excludes odd denominators from the emitted factors and +ordinary coefficient dictionary, not from all compiler arithmetic. + +## 3. Left row reduction and the inverse certificate + +First consider a matrix `M` over `O`. Start with `E=M` and `U=V=I_m`. +Maintain + +```text +U M = E, U V = V U = I_m. +``` + +Process columns from left to right, with the next pivot row `p`. If every +entry of the current column in rows `p..m-1` is zero, skip that column. +Otherwise swap a nonzero entry into row `p`. A row swap in `E` and `U` +requires the same column swap in `V`. + +For each nonzero lower entry `a=E[i,col]` and pivot `b=E[p,col]`, use the +division in Section 2. Perform these operations: + +```text +E[i,*] <- E[i,*] - q E[p,*] +U[i,*] <- U[i,*] - q U[p,*] +V[*,p] <- V[*,p] + V[*,i] q +``` + +The last multiplication is on the right. These are inverse elementary +matrix operations: if `T` has `-q` in position `(i,p)` and ones on its +diagonal, then `T^(-1)` has `q` in that position because `i!=p`. The updates +are `E<-TE`, `U<-TU`, and `V<-VT^(-1)`. They preserve both invariant +identities and keep every matrix entry in `O`. + +If the remainder is nonzero, swap rows `i` and `p`; the new pivot norm is +at most half the old norm. If it is zero, that lower entry has been cleared. +Nonzero pivot norms are positive integers. Thus only finitely many nonzero +remainders can occur at a fixed pivot. A zero remainder reduces the number +of nonzero lower entries. The column therefore terminates. Earlier pivot +columns stay zero in all active rows, so later operations preserve them. +There are finitely many columns. The whole algorithm terminates. + +At return, the first `r` rows of `E` have strictly increasing pivot columns +with nonzero pivots. Every later row is zero. The selected pivot minor is +upper triangular with nonzero diagonal, so it is invertible over `K` by +back substitution, with multiplication order preserved. Thus `E` has rank +`r` over `K`. Since `U` is invertible over `O`, `M` has the same rank. + +Let `C` be the first `r` columns of `V`, and let `B0` be the first `r` rows +of `E`. The invariant gives `M=V E=C B0`, with both factors over `O`. No +pivot is divided out of the emitted matrix. In particular, a nonunit pivot +does not force its inverse into a returned factor. + +## 4. Dyadic factors and the matching lower bound + +For a given dyadic input `A`, choose a common `2^s` that clears all its +coordinate denominators. Then `M=2^s A` is in `L`, hence in `O`. Apply +Section 3 and set `B=2^(-s) B0`. The scale is central. This proves `A=C B` +and the stated denominator bounds. It also proves that all factors lie in +`D`, since `O` is contained in `D` and `O[1/2]=D`. + +Conversely, any factorization through `q` dyadic quaternion columns remains +a factorization over the division ring `K`. Its image is contained in the +right `K`-span of those `q` columns. Therefore `rank_K(A)<=q`. The construction +uses `q=r`, so the lower bound is attained. This establishes exact inner +rank, not only an upper bound. + +This does not contradict PR7745's integral counterexample. There the +coefficient ring is the smaller Lipschitz order `L`. It need not contain a +norm-decreasing Euclidean quotient. For `a=1+j`, `b=1+i`, the exact left +quotient is `(1-i+j+k)/2`, in `O` but not in `L`. Coordinatewise integer +rounding leaves a remainder with the same norm as `b`; the integer-only +reduction has no strict progress at that step. + +On PR7745's exact response, this implementation returns + +```text +C = [1, (1-i+j+k)/2]^T, +B = [1+i, i+k]. +``` + +These multiply to the original matrix `[[1+i,i+k],[1+j,i+j]]`. This is a +rank-one dyadic factorization. The source supplies its separate proof that +no rank-one Lipschitz factorization exists; that obstruction is retained +and replayed, not claimed as a new result here. + +## 5. Relation to query channels + +Under the atlas's faithful even/odd operator split, its R03 theorem makes +any `q`-query word factor the full odd response through `q` ordinary-algebra +rows, including with feedback. Its R04 construction implements any explicit +factorization when the required ordinary coefficient words and query +commutation contract are supplied. For the full ordinary ring `D`, the +coefficient-existence part of that interface therefore has minimum channel +count `rank_K(A)`. + +Each fixed quaternion coefficient in the returned factors has a finite +formal word made from signed lane permutations, additions and dyadic halves. +That existence statement does not make a half exact on an actual reached +integer grid, place a query bank, preserve a physical borrowed field or +price cleanup. A smaller physical dictionary can again have a larger inner +rank. The theorem is about the full stated ring and complete response; +it does not authorize deleting unobserved outputs or changing a caller. + +## 6. Evidence and limits + +The exact checker replays all operation transcripts with Nick Petalas's +separate multiplication formula. It checks `UM=E`, both inverse identities, +`VE=M`, echelon pivots, returned products and both denominator bounds. A +separate rational Gaussian elimination computes the rank of the `4m` by +`4n` left-regular block matrix. That rank is four times the quaternion rank, +so it checks the factor width without using the Euclidean reducer. + +The retained receipt covers 625 matrices from the complete five-letter +`2x2` alphabet `{0,1,i,j,omega}`, 35 constructed rectangular cases of all +possible ranks for ten shapes, five dense rectangular cases, and four +explicit witnesses. In total it covers 669 matrices and 947 Euclidean +divisions, with ranks zero through five. The 4,096-point eighth-grid check +corroborates the sharp rounding bound. Sixteen Hamilton basis products and +sixteen Hurwitz basis products check signs and order closure. + +Eight malformed/order-domain inputs reject. Three changed operation/factor +certificates reject. A reversed quotient order fails the norm bound, and +integer-only rounding detects the source stagnation. The original source's +eight basis responses, sixteen parity classes and twenty-four norm-two +divisors replay unchanged. These are finite checks of the all-size written +proof, not an exhaustive enumeration of all matrices or formal acceptance. + +No coefficient-height bound, compiler bit-complexity bound, live physical +query, reached-grid realization, ownership restoration or complete supplier +invoice is supplied. Historical full suites, selected cold replay, Lean and +Docker were not run. All five framework assumptions remain. Prepared by +Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. diff --git a/research/dyadic-quaternion-rank-factorization/README.md b/research/dyadic-quaternion-rank-factorization/README.md new file mode 100644 index 0000000000..e41e68bc05 --- /dev/null +++ b/research/dyadic-quaternion-rank-factorization/README.md @@ -0,0 +1,62 @@ +# Exact dyadic quaternion channel factors + +Every finite rectangular matrix over the dyadic Hamilton quaternion ring +factors through exactly its rational quaternion rank. The exact algorithm +uses Hurwitz Euclidean row reduction and tracks its inverse operations. +If `2^s A` has integral coordinates, its attaining factors `A=C B` satisfy +`C in O` and `2^s B in O`, entrywise, where `O` is the Hurwitz order. +Thus left coordinates need at most one half; right denominators divide +`2^(s+1)`. No odd denominator appears in either emitted factor. + +This answers the general-response question in PR7745 and the coefficient +part of the atlas's RQ10. The Euclidean method is classical. Read +[PROOF.md](PROOF.md), [factor.py](factor.py), [RESULT.json](RESULT.json), +[SOURCE-PINS.json](SOURCE-PINS.json) and [CREDITS.md](CREDITS.md). +There is no new kappa or physical query implementation. + +## Reproduce + +Use Python 3.12 and the standard library: + +```sh +python3.12 -B scripts/research_package.py --package research/dyadic-quaternion-rank-factorization +``` + +Both registered commands print: + +```text +PASS_DYADIC_QUATERNION_RANK_FACTORIZATION exact rank and denominator certificates +``` + +The checker verifies 669 matrices, 947 Euclidean reductions, 4,096 rounding +points, complete inverse/factor identities, denominator bounds and a separate +rational block rank. It replays the original channel-gap evidence unchanged. +Eight domain rejections, three altered certificates and two order/stagnation +controls test the stated boundaries. See [VALIDATION.md](VALIDATION.md). + +## Scope + +The theorem concerns the full dyadic Hamilton coefficient ring. A smaller +ordinary dictionary can have a larger inner rank. Exact rational arithmetic +may use odd denominators while choosing a rounded quotient; the emitted +quotients and factors have the promised Hurwitz/dyadic coefficients. +Coefficient magnitudes and compiler bit complexity are not bounded here. +Actual reached-grid halving, source preservation, queries, movement, storage +and cleanup still need a complete caller. All five framework assumptions +and the selected frontier remain unchanged. + +## Open next questions + +1. Can an attaining factorization have a useful coefficient-height bound? + Start with Euclidean row operations on a fixed rank-one rectangular family. + The denominator theorem alone does not control numerators or conditioning. +2. Can a reached caller use these factors with a charged ordinary dictionary? + Start with PR7745's two-by-two response and its changed half placement. + The exact input grid, coefficient words, query boundary, preservation and + scratch restoration must be supplied together. + +Prepared by Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. +Nick Petalas, Dugongue and the classical Hurwitz arithmetic sources retain +credit. No independent human or formal-kernel acceptance is claimed. + +[Canonical claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19719542). diff --git a/research/dyadic-quaternion-rank-factorization/RESULT.json b/research/dyadic-quaternion-rank-factorization/RESULT.json new file mode 100644 index 0000000000..f15e37f313 --- /dev/null +++ b/research/dyadic-quaternion-rank-factorization/RESULT.json @@ -0,0 +1,670 @@ +{ + "certificate_mutations": 3, + "certificate_trace_sha256": "6a08baf44adedbbed42031921af5e94b4f997cdc15a73ccc9e81bb68b803ff40", + "dense_rectangular": 5, + "euclidean_divisions": 947, + "exhaustive_two_by_two": 625, + "multiplication_basis_pairs": 16, + "order_and_integral_stagnation_controls": 2, + "order_basis_products": 16, + "rank_histogram": { + "0": 12, + "1": 121, + "2": 525, + "3": 6, + "4": 4, + "5": 1 + }, + "rejection_controls": 8, + "rounding_distance_histogram": { + "0": 2, + "1/16": 48, + "1/2": 6, + "1/32": 48, + "1/4": 24, + "1/64": 16, + "1/8": 48, + "11/32": 192, + "11/64": 192, + "13/32": 96, + "13/64": 224, + "15/64": 384, + "17/64": 240, + "19/64": 256, + "21/64": 192, + "25/64": 48, + "3/16": 192, + "3/32": 192, + "3/64": 64, + "3/8": 48, + "5/16": 144, + "5/32": 288, + "5/64": 96, + "7/32": 384, + "7/64": 128, + "9/32": 336, + "9/64": 208 + }, + "rounding_grid": 4096, + "source_replay": { + "divisors": [ + 24, + 8, + 8, + 0 + ], + "parity": 16, + "responses": [ + 8, + 4 + ] + }, + "structured_rectangular": 35, + "total_matrices": 669, + "witnesses": { + "odd_pivot": { + "certificate": { + "echelon": [ + [ + [ + "-3", + "0", + "0", + "0" + ], + [ + "-5", + "0", + "0", + "0" + ] + ], + [ + [ + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0" + ] + ] + ], + "input_scale": 0, + "inverse_transform": [ + [ + [ + "-3", + "0", + "0", + "0" + ], + [ + "1", + "0", + "0", + "0" + ] + ], + [ + [ + "-5", + "0", + "0", + "0" + ], + [ + "2", + "0", + "0", + "0" + ] + ] + ], + "left": [ + [ + [ + "-3", + "0", + "0", + "0" + ] + ], + [ + [ + "-5", + "0", + "0", + "0" + ] + ] + ], + "left_transform": [ + [ + [ + "-2", + "0", + "0", + "0" + ], + [ + "1", + "0", + "0", + "0" + ] + ], + [ + [ + "-5", + "0", + "0", + "0" + ], + [ + "3", + "0", + "0", + "0" + ] + ] + ], + "pivots": [ + 0 + ], + "rank": 1, + "right": [ + [ + [ + "-3", + "0", + "0", + "0" + ], + [ + "-5", + "0", + "0", + "0" + ] + ] + ], + "steps": [ + [ + "reduce", + 1, + 0, + 0, + [ + "2", + "0", + "0", + "0" + ], + "81", + "9" + ], + [ + "swap", + 0, + 1 + ], + [ + "reduce", + 1, + 0, + 0, + [ + "-3", + "0", + "0", + "0" + ], + "9", + "0" + ] + ] + }, + "input": [ + [ + [ + 9, + 0, + 0, + 0 + ], + [ + 15, + 0, + 0, + 0 + ] + ], + [ + [ + 15, + 0, + 0, + 0 + ], + [ + 25, + 0, + 0, + 0 + ] + ] + ] + }, + "quarter_scalar": { + "certificate": { + "echelon": [ + [ + [ + "1", + "0", + "0", + "0" + ] + ] + ], + "input_scale": 2, + "inverse_transform": [ + [ + [ + "1", + "0", + "0", + "0" + ] + ] + ], + "left": [ + [ + [ + "1", + "0", + "0", + "0" + ] + ] + ], + "left_transform": [ + [ + [ + "1", + "0", + "0", + "0" + ] + ] + ], + "pivots": [ + 0 + ], + "rank": 1, + "right": [ + [ + [ + "1/4", + "0", + "0", + "0" + ] + ] + ], + "steps": [] + }, + "input": [ + [ + [ + "1/4", + 0, + 0, + 0 + ] + ] + ] + }, + "source_gap": { + "certificate": { + "echelon": [ + [ + [ + "1", + "1", + "0", + "0" + ], + [ + "0", + "1", + "0", + "1" + ] + ], + [ + [ + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0" + ] + ] + ], + "input_scale": 0, + "inverse_transform": [ + [ + [ + "1", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0" + ] + ], + [ + [ + "1/2", + "-1/2", + "1/2", + "1/2" + ], + [ + "1", + "0", + "0", + "0" + ] + ] + ], + "left": [ + [ + [ + "1", + "0", + "0", + "0" + ] + ], + [ + [ + "1/2", + "-1/2", + "1/2", + "1/2" + ] + ] + ], + "left_transform": [ + [ + [ + "1", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0" + ] + ], + [ + [ + "-1/2", + "1/2", + "-1/2", + "-1/2" + ], + [ + "1", + "0", + "0", + "0" + ] + ] + ], + "pivots": [ + 0 + ], + "rank": 1, + "right": [ + [ + [ + "1", + "1", + "0", + "0" + ], + [ + "0", + "1", + "0", + "1" + ] + ] + ], + "steps": [ + [ + "reduce", + 1, + 0, + 0, + [ + "1/2", + "-1/2", + "1/2", + "1/2" + ], + "2", + "0" + ] + ] + }, + "input": [ + [ + [ + 1, + 1, + 0, + 0 + ], + [ + 0, + 1, + 0, + 1 + ] + ], + [ + [ + 1, + 0, + 1, + 0 + ], + [ + 0, + 1, + 1, + 0 + ] + ] + ] + }, + "zero_rectangular": { + "certificate": { + "echelon": [ + [ + [ + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0" + ] + ], + [ + [ + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0" + ] + ] + ], + "input_scale": 0, + "inverse_transform": [ + [ + [ + "1", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0" + ] + ], + [ + [ + "0", + "0", + "0", + "0" + ], + [ + "1", + "0", + "0", + "0" + ] + ] + ], + "left": [ + [], + [] + ], + "left_transform": [ + [ + [ + "1", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0" + ] + ], + [ + [ + "0", + "0", + "0", + "0" + ], + [ + "1", + "0", + "0", + "0" + ] + ] + ], + "pivots": [], + "rank": 0, + "right": [], + "steps": [] + }, + "input": [ + [ + [ + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0" + ] + ], + [ + [ + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0" + ] + ] + ] + } + } +} diff --git a/research/dyadic-quaternion-rank-factorization/SOURCE-PINS.json b/research/dyadic-quaternion-rank-factorization/SOURCE-PINS.json new file mode 100644 index 0000000000..964239dd95 --- /dev/null +++ b/research/dyadic-quaternion-rank-factorization/SOURCE-PINS.json @@ -0,0 +1,50 @@ +[ + { + "path": "retained/pr7745/README.md", + "source_repository": "petalas/integer-mult-bounds", + "source_commit": "b92ecb5f9579215dda5832fe604f4124b0198cde", + "source_path": "research/lipschitz-channel-gap/README.md", + "git_blob": "7c11da33810bbffc1cec14c5753dc44b29e6fb55", + "sha256": "fc90a65d4e5490a4260e56b6b9e91b1f213c96cf6bd54fb10b19011814062ae8" + }, + { + "path": "retained/pr7745/SOURCES.json", + "source_repository": "petalas/integer-mult-bounds", + "source_commit": "b92ecb5f9579215dda5832fe604f4124b0198cde", + "source_path": "research/lipschitz-channel-gap/SOURCES.json", + "git_blob": "07d3771ad1ecdfc496895d0896f87fa6cb160de1", + "sha256": "baa94784be8ab104394fadb2485d3bf85f31048926c14706ee7242f7281f7770" + }, + { + "path": "retained/pr7745/TASK.json", + "source_repository": "petalas/integer-mult-bounds", + "source_commit": "b92ecb5f9579215dda5832fe604f4124b0198cde", + "source_path": "research/lipschitz-channel-gap/TASK.json", + "git_blob": "25ce8c05ed009cff310c398b5871813d9f03f41f", + "sha256": "e7df5ae016223b3a462e969768e88cda0d0d8271567069cdd982673ebb7519e8" + }, + { + "path": "retained/pr7745/VERIFY.json", + "source_repository": "petalas/integer-mult-bounds", + "source_commit": "b92ecb5f9579215dda5832fe604f4124b0198cde", + "source_path": "research/lipschitz-channel-gap/VERIFY.json", + "git_blob": "413416f0e3d47c6c53fd7e2b687643ffae7c9adc", + "sha256": "d26d87134f46e07eebe97b67069f57e3b1e361552198bae23aebe333f2c5ff10" + }, + { + "path": "retained/pr7745/verify.py", + "source_repository": "petalas/integer-mult-bounds", + "source_commit": "b92ecb5f9579215dda5832fe604f4124b0198cde", + "source_path": "research/lipschitz-channel-gap/verify.py", + "git_blob": "ff2002170a88a2a50ce4bbbee376761e82a8c5a3", + "sha256": "e840fa450be5ff3da53f5acf618ac3beb899d5b65d44a8b45d540744db2e78d2" + }, + { + "path": "retained/pr5803/volume-algebra.md", + "source_repository": "CrocSwap/integer-mult-bounds", + "source_commit": "0acda5ab421d28b98fdf916968696c8f9453376f", + "source_path": "research/frontier-mathematical-atlas/volume-algebra.md", + "git_blob": "d59eb69c8ae48d38372143b941041f855138eb64", + "sha256": "54dfbecebf2986ad677295976ff951e6b600ef586cbb6a0f56b5653d85f9d243" + } +] diff --git a/research/dyadic-quaternion-rank-factorization/SOURCES.json b/research/dyadic-quaternion-rank-factorization/SOURCES.json new file mode 100644 index 0000000000..5335fa97d9 --- /dev/null +++ b/research/dyadic-quaternion-rank-factorization/SOURCES.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + } + ] +} diff --git a/research/dyadic-quaternion-rank-factorization/TASK.json b/research/dyadic-quaternion-rank-factorization/TASK.json new file mode 100644 index 0000000000..1be02e2e61 --- /dev/null +++ b/research/dyadic-quaternion-rank-factorization/TASK.json @@ -0,0 +1,90 @@ +{ + "schema_version": 1, + "task_id": "joint-query-controller", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "joint-query-controller", + "question": "Can a changed query demand or caller remove real work while satisfying native chronology and restoration?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "A source-bound arbitrary-input identity and legal producer/consumer boundary with the complete paid and productive target invoice, including restoration, ownership, native alignment and extra charges. Price under the actual current model; historical ceiling.py assumptions must be established before use. A favorable optimistic relaxation keeps a route open but is not a completed supplier. A scoped local result remains useful; expansion requires the family-level budget gate.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Choose an exact caller and a new demand/interface hypothesis. Read the scoped #5617/#5631/#5649/#5747 and #5720/#5745 objections before rebuilding an excluded schedule. Compare the complete matched source/consumer protocols including all retained helper outputs. For an active-mode injection, first check #5745: its canonical delivery claim repays the eight removed centre jobs. Audit that exact claim or change its channel/feedback hypothesis; do not repeat the same free-injection search. Stop if the full favorable budget fails or the required restored output is unobservable.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "query demand", + "active mode", + "5720", + "5745", + "5747", + "caller" + ], + "existing_checks": [ + { + "scope": "PR #4166: author-checked installed producer/service/return/bridge connection; native-component comparison loses.", + "evidence": "research/qq16-caller-install/README.md", + "remaining": "Complete matched physical protocol bill, or changed source-compatible demand/circuit; no affordable supplier yet.", + "status": "author-checked", + "source_commit": "0b082d22a0e9a442d264ab0633e35ef26c790630", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Constructive rank-exact factors for every finite rectangular dyadic Hamilton-quaternion matrix, with Hurwitz inverse-operation and denominator certificates", + "scope_change_reason": "Answer PR7745 first open question and the coefficient-existence part of atlas RQ10; not a physical joint-query caller.", + "bottleneck_link": "Remove odd-denominator artifacts from attaining nonsplit coefficient factors while retaining the exact full response and explicit physical obligations.", + "budget_minutes": 60, + "stop_rule": "Finish the general proof, exact algorithm and separate rank/product checks; stop before coefficient-height optimization or physical caller construction.", + "outcome": "completed", + "evidence": "PROOF.md, factor.py, verify.py, RESULT.json and SOURCE-PINS.json", + "author": "Ali Romman", + "ai_assistance": "Substantial OpenAI Codex assistance in research, implementation, verification and writing.", + "open_questions": [ + { + "question": "Can an attaining factorization have a useful coefficient-height bound?", + "why_it_matters": "Dyadic denominator control does not bound numerators or conditioning.", + "first_step": "Analyze Euclidean operations on a fixed rank-one rectangular family.", + "blocked_by": "No coefficient-height or compiler bit-complexity bound is supplied." + }, + { + "question": "Can a reached caller implement the factors with a charged ordinary dictionary?", + "why_it_matters": "Formal channel width is not a complete physical bill.", + "first_step": "Bind the source response input grid, coefficient words, query boundary and final restoration.", + "blocked_by": "No live caller or reached-grid exact-halving proof is supplied." + } + ] +} diff --git a/research/dyadic-quaternion-rank-factorization/VALIDATION.md b/research/dyadic-quaternion-rank-factorization/VALIDATION.md new file mode 100644 index 0000000000..8a189d20f1 --- /dev/null +++ b/research/dyadic-quaternion-rank-factorization/VALIDATION.md @@ -0,0 +1,28 @@ +# Validation + +Author checks use CPython 3.12.16 on macOS arm64 and the standard library. +The normal and optimized registered commands treat warnings as errors. +Scientific checks use explicit exceptions, so optimization does not remove +any assertion. The release record reports their actual pass state. + +The finite domain has 625 matrices from the complete five-letter `2x2` +alphabet, 35 constructed rectangular cases, five dense rectangular cases, +and four explicit witnesses. Each factor product and both inverse identities +are checked using the retained source multiplication formula. Independent +rational Gaussian elimination of the left-regular block matrix checks rank. +Every operation transcript, pivot and denominator promise is checked. + +The complete source response/parity/divisor checks run unchanged. Source +hashes are checked before import. Rounding covers all 4,096 eighth-grid +points in a unit cube. The written rounding, termination and factorization +proofs cover the infinite domain; finite checks do not replace those proofs. + +Release checks use committed bytes/source history/modes, a package export, +and both registered commands in a read-only tree without Git or tools on +PATH. The PR and canonical handoff record actual release and hosted outcomes. +Exact-source pins establish provenance, not scientific acceptance. + +No historical full suite, selected cold replay, Lean or Docker was run. +The certificate paths share the quaternion definitions and source response; +there is no independent human or formal-kernel acceptance. No source patch, +coefficient monkey patch or physical caller workaround is used. diff --git a/research/dyadic-quaternion-rank-factorization/VERIFY.json b/research/dyadic-quaternion-rank-factorization/VERIFY.json new file mode 100644 index 0000000000..e494069ecb --- /dev/null +++ b/research/dyadic-quaternion-rank-factorization/VERIFY.json @@ -0,0 +1,32 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Exact Hurwitz reduction transcripts, two-sided inverse and factor identities, independent rational block rank, dyadic denominator bounds, complete source witness replay and boundary/mutation controls" + }, + { + "argv": [ + "{python}", + "-W", + "error", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Exact Hurwitz reduction transcripts, two-sided inverse and factor identities, independent rational block rank, dyadic denominator bounds, complete source witness replay and boundary/mutation controls" + } + ] +} diff --git a/research/dyadic-quaternion-rank-factorization/factor.py b/research/dyadic-quaternion-rank-factorization/factor.py new file mode 100644 index 0000000000..bb77dce0ff --- /dev/null +++ b/research/dyadic-quaternion-rank-factorization/factor.py @@ -0,0 +1,140 @@ +"""Construct exact minimum-width factors over dyadic Hamilton quaternions. + +Prepared by Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. +Hurwitz rounding and Euclidean reduction are classical. See CREDITS.md. +""" + +from fractions import Fraction as F + +ZERO = (F(0),) * 4 +ONE = (F(1), F(0), F(0), F(0)) + + +def add(a, b): + return tuple(x+y for x, y in zip(a, b)) + + +def sub(a, b): + return tuple(x-y for x, y in zip(a, b)) + + +def scale(a, q): + return tuple(q*x for x in a) + + +def multiply(a, b): + w, x, y, z = a + t, u, v, r = b + return (w*t-x*u-y*v-z*r, w*u+x*t+y*r-z*v, + w*v-x*r+y*t+z*u, w*r+x*v-y*u+z*t) + + +def norm(a): + return sum(x*x for x in a) + + +def inverse(a): + n = norm(a) + if not n: + raise ValueError('zero quaternion inverse') + return (a[0]/n, -a[1]/n, -a[2]/n, -a[3]/n) + + +def hurwitz(a): + return all(x.denominator == 1 for x in a) or all(x.denominator == 2 for x in a) + + +def dyadic(a): + return all(x.denominator & (x.denominator-1) == 0 for x in a) + + +def matrix(value, predicate): + if (not isinstance(value, (list, tuple)) or not value + or not isinstance(value[0], (list, tuple)) or not value[0]): + raise ValueError('nonempty rectangular matrix required') + width = len(value[0]); result = [] + for row in value: + if not isinstance(row, (list, tuple)) or len(row) != width: + raise ValueError('ragged matrix') + new = [] + for entry in row: + if (not isinstance(entry, (list, tuple)) or len(entry) != 4 + or any(type(x) not in (int, F) for x in entry)): + raise ValueError('four exact rational coordinates required') + q = tuple(F(x) for x in entry) + if not predicate(q): + raise ValueError('coefficient outside the declared order') + new.append(q) + result.append(new) + return result + + +def nearest_hurwitz(value): + """Choose the nearer integer or uniform half-integer lattice point.""" + candidates = [] + for offset in (F(0), F(1, 2)): + rounded = [] + for x in value: + y = x-offset+F(1, 2) + rounded.append(F(y.numerator // y.denominator)+offset) + candidates.append(tuple(rounded)) + return min(candidates, key=lambda q: norm(sub(value, q))) + + +def identity(size): + return [[ONE if i == j else ZERO for j in range(size)] for i in range(size)] + + +def reduce_hurwitz(value): + """Return U A=E, U V=V U=I, with E in row echelon form.""" + e = matrix(value, hurwitz); m, n = len(e), len(e[0]) + u, v = identity(m), identity(m) + pivot = 0; pivots = []; steps = [] + + def swap(i, j): + if i == j: + return + e[i], e[j] = e[j], e[i]; u[i], u[j] = u[j], u[i] + for row in v: + row[i], row[j] = row[j], row[i] + steps.append(('swap', i, j)) + + for col in range(n): + first = next((i for i in range(pivot, m) if norm(e[i][col])), None) + if first is None: + continue + swap(pivot, first) + while True: + i = next((i for i in range(pivot+1, m) if norm(e[i][col])), None) + if i is None: + break + before = norm(e[pivot][col]) + q = nearest_hurwitz(multiply(e[i][col], inverse(e[pivot][col]))) + e[i] = [sub(a, multiply(q, b)) for a, b in zip(e[i], e[pivot])] + u[i] = [sub(a, multiply(q, b)) for a, b in zip(u[i], u[pivot])] + for row in v: + row[pivot] = add(row[pivot], multiply(row[i], q)) + after = norm(e[i][col]) + if after > before/2: + raise ArithmeticError('Euclidean norm bound failed') + steps.append(('reduce', i, pivot, col, q, before, after)) + if after: + swap(pivot, i) + pivots.append(col); pivot += 1 + if pivot == m: + break + return dict(echelon=e, left_transform=u, inverse_transform=v, + rank=pivot, pivots=pivots, steps=steps) + + +def factor_dyadic(value): + a = matrix(value, dyadic) + exponent = max(x.denominator.bit_length()-1 for row in a for entry in row for x in entry) + cleared = [[scale(q, 1 << exponent) for q in row] for row in a] + result = reduce_hurwitz(cleared) + r = result['rank'] + result.update(input_scale=exponent, + left=[row[:r] for row in result['inverse_transform']], + right=[[scale(q, F(1, 1 << exponent)) for q in row] + for row in result['echelon'][:r]]) + return result diff --git a/research/dyadic-quaternion-rank-factorization/retained/pr5803/volume-algebra.md b/research/dyadic-quaternion-rank-factorization/retained/pr5803/volume-algebra.md new file mode 100644 index 0000000000..d59eb69c8a --- /dev/null +++ b/research/dyadic-quaternion-rank-factorization/retained/pr5803/volume-algebra.md @@ -0,0 +1,262 @@ +# Algebraic query bundling beyond commuting sectors + +This volume gives twenty informal results and twelve research questions. The main construction computes a prescribed odd response through the smallest number of full ordinary-algebra channels. It extends the commuting Boolean-sector interface of PR5626 to explicit noncommutative matrix blocks, while charging all routing, initialization, clearing and source matching. It does not assert that a current full caller has been improved. + +Status: the ring, rank, module and query-model ingredients are classical. Their assembled noncommutative Gaussian application is a proposed project extension; it was not located in the bounded recent-PR review. That is not proof of worldwide novelty. The concrete spectator implementation is proved separately in volume-geometry.md. The earlier pure-math atlas's semisimple diagram decomposition, especially its A050, supplies a recovered precedent rather than a new discovery. + +## Route R1 Odd responses over an ordinary operator algebra + +Fix a unital algebra A of explicitly implementable ordinary payload operators, an invertible query Q, an explicitly specified automorphism sigma of A, and a unit j in A, with + + Q a=sigma(a) Q, Q^2=j. + +Assume the physical operator space A+A Q is a DIRECT sum as an A-module: equality of operators a+bQ determines a and b separately. All coefficients and operations used below are fixed before payload width grows. For a particular machine application, each chosen coefficient has a finite ordinary word in its actual allowed alphabet. A general algebraic factorization is not automatically a dyadic or native implementation. + +The query contract is an input-preserving shear on arbitrary independent source fields x and receiver fields y: + + x stays x; y becomes y+(A0+BQ)x. + +Q acts on each payload field, and BQ means entries B_ij Q. Owned query and work fields begin scrubbed and return zero. Inverse Q calls count as queries too. Arbitrary interleaving, retention and linear feedback are allowed in the lower-bound model. + +### R01 Unique even and odd coefficient propagation + +**Statement.** Every field in a finite word built from ordinary A-linear operations and Q has a unique representation Ux+VQx in the independent original inputs. Ordinary operations take A-linear combinations of both rows. Applying Q replaces the coefficient pair by (sigma(V)j,sigma(U)). + +**Proof.** Initial input fields have pairs (coordinate row,0), and owned zero has pair (0,0). Ordinary linear operations preserve the stated form. For a row Ux+VQx, use Qa=sigma(a)Q and Q^2=j term by term. The direct-sum assumption makes the coefficient representation unique. Induction proves the claim. Inputs y and any borrowed arbitrary fields may be appended to x for this argument. Their desired final odd coefficients are included rather than forgotten. + +**Use.** Export the actual odd coefficient matrix of a proposed query window. The source of any gain is its algebraic rank, not a static count of field names. + +### R02 Normalize inverse queries without extra queries + +**Statement.** A Q^(-1) occurrence can be replaced by one Q occurrence and an ordinary j^(-1) application. + +**Proof.** Q commutes with Q^2=j. Thus Q^(-1)=j^(-1)Q=Qj^(-1). The supplied ordinary unit word for j^(-1) implements the additional application. Its phase and finite cost are retained. This does not mean the old inverse ordinary wrapper remains unchanged. + +**Use.** Bind both source orientations to one query-count theorem without treating negative Gaussian calls as free. + +### R03 The complete odd output factors through the query outputs + +**Statement.** If a word uses q queries, its final odd matrix B factors as B=L R through q rows over A. Consequently its inner rank over A is at most q, where inner rank is the least q admitting such a factorization. + +**Proof.** Retain, for the proof only, the odd row created at each query output. There are q such rows. Initial odd rows are zero. Every ordinary instruction takes A-linear combinations of available odd rows. Each next query contributes one new odd row, whether it overwrites a field or writes an owned copy. Induction shows every final odd row lies in the A-span of those q rows. Stack the q rows as R and their final combination coefficients as L. This proof does not presume a runtime cache of all outputs and permits feedback. Restricting borrowed arbitrary inputs to zero proves the same bound on the requested x submatrix. + +**Use.** A proposed lower bound needs the actual ordinary algebra. The Boolean-sector rank bound cannot simply be reused after adding noncommuting matrix units. + +### R04 A factorization emits exactly q queries + +**Statement.** Given explicit B=L R through q A-rows, the prescribed shear has a finite q-query implementation. + +**Proof.** In q separately owned fields compute the rows sigma^(-1)(R)x using ordinary coefficient words. Apply Q once to each. The resulting bank is RQx. Add L times this bank and A0x to the receiver fields y. The original x fields are untouched. Clear every query and temporary field after last use. Each input is arbitrary; no source value is assumed zero. All operations are explicit given L,R and the ordinary sigma inverse images. A scratch evaluator for coefficient words is detailed in R14. + +**Use.** The factorization is a physical recipe, not just a numerical rank certificate. The coefficient words and sigma inverse images belong in the witness. + +### R05 Exact query complexity in the stated algebra + +**Statement.** Under the stated faithful operator and ordinary-word contract, the minimum query count for the shear is inner-rank_A(B). + +**Proof.** R03 gives the lower bound for every allowed word, including interleaved and retained-query words. R04 attains any explicit minimum factorization. The coefficient existence question is algebraic; an implementation must exhibit the attaining factorization and its ordinary words. + +**Use.** This is an interface theorem for the specified alphabet. It supplies no Gaussian productive-target credit on its own. + +## Route R2 Matrix blocks create larger channels + +### R06 Inner rank over a split semisimple algebra + +**Statement.** Suppose a finite nonempty component set and an explicit algebra isomorphism give A=product_chi Mat_(d_chi)(D_chi), where each d_chi is a positive integer and each D_chi is a division ring. Expand a matrix B over A into component matrices B_chi of size m d_chi by n d_chi. Then + + inner-rank_A(B)=max_chi ceil(rank_Dchi(B_chi)/d_chi). + +**Proof.** A factorization through q A-rows expands in component chi to a factorization through q d_chi division-ring coordinates, so its rank is at most q d_chi. Conversely choose an ordinary rank factorization of each B_chi through r_chi=rank(B_chi) coordinates. Pad its middle dimension to q d_chi, where q is the displayed maximum. Divide rows and columns into d_chi-sized blocks and assemble the components using the supplied product isomorphism. This gives B=L R through q A-rows. All operations in this proof are on finite supplied matrices; a decomposition oracle is not assumed as a physical primitive. + +**Use.** A noncommutative degree-d block can carry d independent row modes in one queried field, rather than one scalar mode. + +### R07 Dyadic factors do not require an odd denominator + +**Statement.** For R=Z[1/2] and an explicit ordinary algebra A=product_chi Mat_(d_chi)(R), the formula in R06 remains valid with component rank computed over Q. An attaining factorization can have only dyadic coefficients. + +**Proof.** Clear the finitely many powers of two in a component B_chi. Its integer Smith form has unimodular left and right factors and r nonzero diagonal entries. Split that form through r coordinates, then restore the cleared power of two to one factor. Every entry is dyadic. Pad to q d_chi and reassemble as in R06. The rational-rank lower bound follows by extending any dyadic factorization to Q. Smith invariant factors need not be units because this construction computes a prescribed response; it is not extracting independent canonical Gaussian targets. + +**Use.** Avoid introducing unsupported odd scalar division solely because a rational elimination routine selected an inconvenient pivot. Actual matrix units and their product isomorphism must themselves be dyadically realizable. + +### R08 Commuting sectors are the degree-one special case + +**Statement.** If A is a product of scalar fields, R06 reduces to the maximum of the sector ranks. If B is scalar on every degree-d multiplicity, B_chi=R_chi tensor I_d, its required number of channels is rank(R_chi). + +**Proof.** Set d_chi=1 in R06 for the first assertion. For the second, division-ring rank of the repeated identity block is d times rank(R_chi), so its ceiling divided by d is rank(R_chi). + +**Use.** This identifies precisely what changes relative to PR5626. A fixed scalar role boundary does not gain merely by renaming its spectator factor as a matrix algebra. The profitable demand must actually have noncentral ordinary coefficients or a changed producer/consumer. + +### R09 Stack output requests before factoring + +**Statement.** If the same unchanged source bank x must provide several shears y_a+=(A_a+B_aQ)x within one admissible window, they can share + + max_chi ceil(rank_Dchi(stack_a B_a,chi)/d_chi) + +queries, with separate receivers arbitrary and independent. + +**Proof.** Stack the A_a and B_a row blocks and apply R04–R06 once. The query bank is formed from x and retained until all requested receiver updates finish. Each output uses its actual corresponding block of L. The source x is never changed. All query retention, routing and work fields are paid. The lower bound follows by treating the entire output tuple as one shear. + +**Use.** Search a whole family of compatible demands; a sum of separately optimal query counts can overcharge shared acquisition. + +### R10 Ordinary changes of the source epoch can be transported + +**Statement.** Suppose at demand a the source bank is x_a=U_a x_0 with U_a an explicitly known invertible matrix over A, and no unrepresented new inputs enter the epoch. Then its odd request B_a Q x_a equals B_a sigma(U_a)Qx_0. The stacked matrices B_a sigma(U_a) may be factored once at the common earlier epoch. + +**Proof.** Move Q through the A-valued matrix using the automorphism. Acquire the common factor's queried rows from x_0 before the updates and retain them in owned fields. At each later demand use its actual L block. If the original state is needed for an even contribution, U_a^(-1) gives its explicit ordinary reconstruction; its word is charged. Any added independent input must be included in a larger original bank and in every coefficient matrix. + +**Use.** The algebraic part of asynchronous query reuse has a precise invariant. Timing, frames and delivery still determine whether an actual source window permits it. + +## Route R3 Compress a whole response epoch + +### R11 Replace a complete single-query-algebra window + +**Statement.** A fixed finite window using only the ordinary A alphabet, Q and Q inverse, with N arbitrary original live fields and zero-return owned storage, has an exact replacement with inner-rank_A(B) queries, where its full original-field endpoint is M=A0+BQ. All original-field outputs, not just an observed row, are preserved. + +**Proof.** R01 and R02 give the full endpoint matrix. Factor B through q rows and acquire its queried bank by R04. While all originals are unchanged, compute N owned difference fields delta_i=((A0-I)x+L RQx)_i. Then add delta_i to each original field and clear the difference/query/work fields. The actual resulting original vector is Mx. This schedule never clears an original input or assumes an observed quotient equals the full endpoint. R03 gives the lower bound. Any live borrowed field crossing the window must be one of the arbitrary originals and its unchanged or changed output must be included in M. + +**Use.** A matrix endpoint can nominate a cheaper complete query window even when its original word uses feedback. It is not permissible to treat other nonordinary query types as coefficients in A. + +### R12 A strict two-query versus one-query example + +**Statement.** Let W=K^2 tensor V, S=diag(1,-1) on the first factor, T swap that factor, and Q=I_2 tensor q. Put P0=(I+S)/2, P1=(I-S)/2. The two independent conditional updates + + x -> (P1+Q P0)x, + y -> (P1+Q P0)y + +can be implemented with one Q query and dyadic ordinary operations generated by S,T. In the faithful commuting alphabet generated only by S, the sector-rank query minimum for this same response is two. + +**Proof.** In the enlarged algebra Mat_2(K), the odd coefficient is diag(P0,P0), whose expanded scalar rank is two. Within the faithful quadratic model, R06 predicts one full matrix-algebra channel. The following explicit upper construction does not require that quadratic premise. Put h=P0x+T P0y in owned storage, query h once, and update originals by the owned differences P0h-P0x and T P1h-P0y. Commutation with Q and P0T=TP1 give exactly the displayed updates. Clear both work fields. With only the commuting sector algebra, the P0 sector has a two-by-two identity odd coefficient, so PR5626's faithful-sector lower bound is two. The upper construction requires no quadratic identity for q; the lower comparison needs the stated faithful-sector model. + +**Use.** This is a concrete changed ordinary alphabet, not a proposed numerical profile. Find an actual conditional demand of this form inside the full source. Volume-geometry.md supplies its detailed safe word and larger spectator constructions. + +### R13 Transfer a query bundle by an ordinary intertwiner + +**Statement.** Suppose an explicitly implemented ordinary isomorphism Phi conjugates A onto A' and Phi Q Phi^(-1)=u Q', with u a supplied ordinary unit. Then any constructed query bundle transfers to the new interface with the same query count and fully specified ordinary wrappers. + +**Proof.** Conjugate each field-level coefficient by Phi. Replace each conjugated query by ordinary u followed by Q'. Conjugate the boundary source and receiver charts too. The full endpoint is the literal conjugate of the old one. The required coefficient relation and phases are checked as operator identities, not inferred from a symplectic similarity alone. Each added wrapper has finite positive cost. The inverse dictionary transfers a lower bound when it is also admitted in the two alphabets. + +**Use.** Reuse a proved spectator bundle at a real native interface only after an ordinary transporter is exhibited. TI or symplectic equivalence without that implementation is insufficient. + +## Route R4 Emit the ordinary words without hiding resources + +### R14 Evaluate a dyadic ordinary coefficient on owned storage + +**Statement.** If a=sum_g c_g U_g is a fixed finite dyadic combination of admitted ordinary signed permutations U_g, one can compute a x in an owned field, preserving arbitrary x, with a finite ADD/monomial/dyadic-unit word and a constant number of additional owned fields. + +**Proof.** Initialize the accumulator to zero. For each term copy x to a work field, apply the literal U_g word, and form its integer numerator multiple by a binary doubling-and-addition procedure using an immutable owned copy. Apply its power-of-two denominator and add the result to the accumulator. Clear the term fields and reuse them. Negative numerators use a sign change. Integer multiplication is produced by additions; no unsupported nonunit original-field overwrite or odd denominator is assumed. Each term has a finite explicit word and all owned fields are scrubbed before first use. + +**Use.** Matrix units are linear combinations of ordinary operators. They must be evaluated as such; a projector is not a free in-place map on an arbitrary original. + +### R15 Bound the simultaneous owned query bank + +**Statement.** The shear implementation of R04 can use q owned query fields and a fixed number of coefficient-evaluation work fields, in addition to the original source and receiver banks. No new original productive input is introduced. + +**Proof.** Form the q rows one at a time, reusing the evaluator's temporary fields. Retain their q queried outputs. To update receiver y_i, accumulate A0_i x+L_i h in one owned work field, add it to y_i, then clear and reuse that field. No receiver update changes the fixed source bank or the query bank. At the end clear all q query fields. Initial scrubs and each CLEAR are explicit. A full-window in-place replacement R11 additionally reserves its N difference fields until every difference has been computed. + +**Use.** A lower query count can still require more live storage. Include these separate reserves for every suspended caller instance. + +### R16 Coefficient words have explicit norm and error budgets + +**Statement.** For unit-norm ordinary U_g, the coefficient operator a in R14 obeys norm(a)<=sum_g |c_g|. Every finite emitted query word admits an explicit error budget obtained from its actual prefix/suffix norms. + +**Proof.** The triangle inequality and norm(U_g)=1 prove the first assertion. For a word F_s ... F_1 and approximations F_i+E_i, telescope by changing one factor at a time. Each difference is bounded by its surrounding exact/approximate factor norms times norm(E_i). The finite sum bounds total error. The ordinary coefficient evaluator's intermediate integer/dyadic accumulations have explicit bounds from their literal partial sums and doubling steps. Actual query norms and normalizations must be inserted at the payload width in question; they are not assumed to be one if the source convention is unnormalized. + +**Use.** Derive fresh precision constants for a packed word. Do not transplant a predecessor's guard solely because the main endpoint is identical. + +### R17 Algebraic word identities are uniform over valid representations + +**Statement.** The endpoint proof for R04 holds in every representation satisfying the same coefficient, automorphism and Q relations, at every width where its ordinary words and query service are supplied. + +**Proof.** Its proof is a finite sequence of additions and products using only those relations and the identity B=L R. Evaluation into any operator algebra is a homomorphism, so it preserves each equality. No finite-width numerical equality is promoted to a universal tensor identity. To use a family of payloads, provide the representation and phase/matcher equations for each admitted width, or one theorem constructing that family. + +**Use.** This is the appropriate all-column proof target. The source's finite small matrix tests do not establish the family premise. + +## Route R5 Install and certify a real replacement + +### R18 Literal context substitution preserves all external semantics + +**Statement.** An exact query-window replacement with the same full original-field endpoint can be inserted between arbitrary fixed source prefix and suffix words, provided it preserves all live external fields and uses separately reserved owned storage. + +**Proof.** Let P,S be the actual outside words and M,M' the two complete live-field endpoint matrices. M'=M implies S M' P=S M P without any commutation assumption. The new owned fields are scrubbed and return zero, so they contribute a zero block with no external dependence. Original helpers retain their endpoint status only because they were included in the equality, not because their names survived. The instruction sequence and fresh precision/stock bounds still change. + +**Use.** Obtain a source-bound proof of installation without rerunning unrelated mathematical arguments. Physical matching and the complete source invoice remain part of the witness. + +### R19 Exact complete-invoice saving from a bundle + +**Statement.** Suppose R18 replaces q_old calls of one canonical rank-k query by q_new such calls. It retains every original productive target and adds a specified list E of other paid Gaussian children. At t=1-C, the whole caller's signed moment changes by + + (q_old-q_new) k^t - sum_(e in E) rank(e)^t. + +Thus strict positivity of this exact expression is sufficient for a strict whole-invoice improvement at the same tested C. + +**Proof.** The full external endpoint equality retains all productive credits. Owned query and work fields add none. Subtract the removed and added paid lists, including every connector and decoder query in E. All unrelated caller terms cancel. Purely ordinary extra work has positive machine cost and changes finite compiler constants even though it adds no Gaussian moment term. + +**Use.** This is the bridge from the exact query construction to a genuine improvement. It does not claim the improved complete moment is itself positive or that either supplier is admitted. + +### R20 A short exact certificate can prove the minimum bundle size + +**Statement.** A q-query factorization B=L R together with one component witness U B_chi V=I_s, where s>(q-1)d_chi, certifies that q is the minimum. Matrix products suffice to check these two sides, once the ordinary algebra and faithful query contract are bound. + +**Proof.** The factorization proves the upper bound by R04. The identity submatrix factor proves rank(B_chi)>=s; otherwise rank of the product could not be s. Any (q-1)-query word would give rank(B_chi) 0, 'division premise') + for rows in (e, u): + rows[i] = [tuple(x-y for x, y in zip(left, source.multiply(q, right))) + for left, right in zip(rows[i], rows[j])] + for row in v: + row[j] = source.add(row[j], source.multiply(row[i], q)) + need(f.norm(e[i][col]) == after and 0 <= after <= before/2, 'division remainder') + need((e, u, v) == (result['echelon'], result['left_transform'], result['inverse_transform']), 'operation replay') + need(all(f.hurwitz(q) for rows in (e, u, v) for row in rows for q in row), 'Hurwitz closure') + mul = source.multiply + need(matmul(u, cleared, n, mul) == e, 'left transform product') + need(matmul(u, v, m, mul) == f.identity(m) == matmul(v, u, m, mul), 'two-sided inverse') + need(matmul(v, e, n, mul) == cleared, 'inverse reconstruction') + pivots = result['pivots']; need(len(pivots) == r and pivots == sorted(set(pivots)), 'pivot list') + for i, col in enumerate(pivots): + need(f.norm(e[i][col]) > 0 and not any(f.norm(q) for q in e[i][:col]), 'pivot row') + need(not any(f.norm(e[j][col]) for j in range(i+1, m)), 'pivot column') + need(not any(f.norm(q) for row in e[r:] for q in row), 'zero row tail') + left, right = result['left'], result['right'] + need(len(left) == m and all(len(row) == r for row in left), 'left factor shape') + need(len(right) == r and all(len(row) == n for row in right), 'right factor shape') + need(matmul(left, right, n, mul) == a, 'factor product') + need(all(f.hurwitz(q) for row in left for q in row), 'left denominator') + need(all(f.hurwitz(f.scale(q, 1 << s)) for row in right for q in row), 'right denominator') + need(r == block_rank(a, source), 'independent rational block rank') + return sum(step[0] == 'reduce' for step in result['steps']) + + +def calculate(): + source = load_source() + old = dict(responses=source.check_responses(), parity=source.check_parity(), divisors=source.check_right_divisors()) + basis = [tuple(F(i == j) for i in range(4)) for j in range(4)] + omega = (F(1, 2),)*4 + for a, b in product(basis, repeat=2): + need(f.multiply(a, b) == source.multiply(a, b), 'Hamilton multiplication table') + order_basis = basis[:3]+[omega] + for a, b in product(order_basis, repeat=2): + need(f.hurwitz(f.multiply(a, b)), 'Hurwitz basis closure') + rounding = Counter() + for numerators in product(range(8), repeat=4): + x = tuple(F(v, 8) for v in numerators); q = f.nearest_hurwitz(x) + distance = f.norm(f.sub(x, q)); need(f.hurwitz(q) and distance <= F(1, 2), 'rounding radius') + rounding[str(distance)] += 1 + need(rounding['1/2'] > 0, 'sharp rounding witness') + trace = hashlib.sha256(); ranks = Counter(); cases = divisions = 0 + + def check(a): + nonlocal cases, divisions + result = f.factor_dyadic(a); divisions += check_certificate(a, result, source) + cases += 1; ranks[result['rank']] += 1 + trace.update(encoded([a, result]).encode()) + return result + + alphabet = [f.ZERO, f.ONE, basis[1], basis[2], omega] + for entries in product(alphabet, repeat=4): + check([list(entries[:2]), list(entries[2:])]) + exhaustive = cases + rng = random.Random(20261118) + + def random_q(): + return tuple(F(rng.randrange(-7, 8), 1 << rng.randrange(4)) for _ in range(4)) + + structured = 0 + for m, n in [(1, 1), (1, 5), (5, 1), (2, 3), (3, 2), (3, 4), (4, 3), (4, 4), (5, 4), (4, 5)]: + for r in range(min(m, n)+1): + c = [[(f.ONE if i == k else f.ZERO) if i < r else random_q() for k in range(r)] for i in range(m)] + b = [[(f.ONE if k == j else f.ZERO) if j < r else random_q() for j in range(n)] for k in range(r)] + a = matmul(c, b, n, source.multiply) + for _ in range(3): + if m > 1: + i, j = rng.sample(range(m), 2); q = random_q() + a[i] = [source.add(x, source.multiply(q, y)) for x, y in zip(a[i], a[j])] + if n > 1: + i, j = rng.sample(range(n), 2); q = random_q() + for row in a: + row[i] = source.add(row[i], source.multiply(row[j], q)) + result = check(a); need(result['rank'] == r, 'constructed rank family'); structured += 1 + dense = 0 + for m, n in [(2, 5), (5, 2), (3, 3), (4, 4), (5, 5)]: + check([[random_q() for _ in range(n)] for _ in range(m)]); dense += 1 + witness_inputs = dict(source_gap=source.RESPONSE, + odd_pivot=[[(9,0,0,0),(15,0,0,0)],[(15,0,0,0),(25,0,0,0)]], + zero_rectangular=[[f.ZERO]*3 for _ in range(2)], + quarter_scalar=[[(F(1,4),0,0,0)]]) + witnesses = {name: dict(input=a, certificate=check(a)) for name, a in witness_inputs.items()} + a, b = (F(1),F(0),F(1),F(0)), (F(1),F(1),F(0),F(0)) + quotient = f.multiply(a, f.inverse(b)); q = f.nearest_hurwitz(quotient) + need(f.norm(f.sub(a, f.multiply(q, b))) == 0, 'left quotient witness') + wrong = f.nearest_hurwitz(f.multiply(f.inverse(b), a)) + need(f.norm(f.sub(a, f.multiply(wrong, b))) > f.norm(b)/2, 'wrong product order not detected') + integral = tuple(F((x+F(1,2)).numerator//(x+F(1,2)).denominator) for x in quotient) + need(f.norm(f.sub(a, f.multiply(integral, b))) == f.norm(b), 'integral-only stagnation') + bad = [[], [[]], [1], [[(1,0,0)]], [[(1.0,0,0,0)]], [[(F(1,3),0,0,0)]], [[f.ONE],[f.ONE,f.ZERO]]] + for value in bad: + try: + f.factor_dyadic(value) + except ValueError: + pass + else: + raise ValueError('invalid factor input accepted') + try: + f.reduce_hurwitz([[(F(1,2),0,0,0)]]) + except ValueError: + pass + else: + raise ValueError('mixed half-integer order accepted') + for kind in ('quotient', 'factor', 'width'): + item = deepcopy(witnesses['source_gap']['certificate']) + if kind == 'quotient': + i = next(i for i, step in enumerate(item['steps']) if step[0] == 'reduce') + step = list(item['steps'][i]); step[4] = f.scale(step[4], -1); item['steps'][i] = tuple(step) + elif kind == 'factor': + item['left'][0][0] = f.add(item['left'][0][0], f.ONE) + else: + item['rank'] = 0; item['left'] = [[] for _ in item['left']]; item['right'] = [] + try: + check_certificate(witness_inputs['source_gap'], item, source) + except ValueError: + pass + else: + raise ValueError('changed certificate accepted') + return dict(exhaustive_two_by_two=exhaustive, structured_rectangular=structured, + dense_rectangular=dense, total_matrices=cases, rank_histogram=dict(sorted(ranks.items())), + euclidean_divisions=divisions, certificate_trace_sha256=trace.hexdigest(), + rounding_grid=4096, rounding_distance_histogram=dict(sorted(rounding.items())), + multiplication_basis_pairs=16, order_basis_products=16, source_replay=old, + rejection_controls=len(bad)+1, certificate_mutations=3, + order_and_integral_stagnation_controls=2, witnesses=witnesses) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__); parser.add_argument('--write-result', action='store_true') + args = parser.parse_args(); result = json.loads(encoded(calculate())) + if args.write_result: + (PACKAGE/'RESULT.json').write_text(json.dumps(result, indent=2, sort_keys=True)+'\n') + else: + need(result == json.loads((PACKAGE/'RESULT.json').read_text()), 'receipt mismatch') + print('PASS_DYADIC_QUATERNION_RANK_FACTORIZATION exact rank and denominator certificates') + + +if __name__ == '__main__': + main()