Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions research/p104-tensor-code/PREDECESSORS.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"credit": "See README; substantial OpenAI Codex assistance.",
"context_only_pending_heads": {
"3961": "afd6bb0a701e9ffd685f27674adaac86687e5f02",
"3954": "f1e2839819959cd0534d008be91ed5b79ec55a6a",
"3966": "75785ae0d1c4a8b1be00b30a07ec31106bb28937"
},
"canonical_inputs": "SOURCES.json; no pending source dependency",
"new_scope": "One global invertible dyadic tensor code; explicit repeated-Gram scalar word, identity-side repayment and modulo13 spectral normalization boundary."
}
201 changes: 201 additions & 0 deletions research/p104-tensor-code/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
# One dyadic code across both P104 axes

## Question and exact scope

PR3961 found that separately chosen row and reversed-column residual encodings
need not match. This package changes that premise: use **one invertible code on
all 21,632 data fields**, kept through both logical stages. The code is explicit,
dyadic, determinant one, preserves every independent syndrome/payload coordinate,
and has fixed X/Y return slots. It never divides by 13 or projects away a kernel.

The canonical native-channel proof supplies the exact uncorrected endpoint
`Y += A X`, where `A=Gram/2`, sources and all 72 dirty helpers restored. The
retained copied-center caller requires an identity shear, followed by an inverse
identity shear and its physical correction/wrappers. Therefore the uncorrected
Gram experiment below is a **changed intermediate protocol**, not that completed
caller. Its scalar savings for repeated Gram pairs are not full-caller savings.
We derive the missing identity corrections explicitly rather than price them zero.

## Dyadic triangular congruence and a global payload code

Order the eight pivot ports `0,1,3,6,22,31,93,103` before the other 96. The pinned
fixture reconstructs `B` with 384 signed-half entries and `BB^t=12I_8`. Put

```
U = [ I B ] P = [ I 0 ] A = U^t P U.
[ 0 I ] [ 0 0 ]

U^-1 = [ I -B ] M = U U^t = [ 13I B ]
[ 0 I ] [ B^t I ].
```

All these U changes and inverses are over `R=Z[i,1/2]`; `det U=1`. Write
`U_r=U tensor I`, `U_c=I tensor U`, and similarly for A/P/M. On two 104 by 104
banks define

```
L = U_r U_c^-t,
C = diag(L,L^-t),
Xhat=L X, Yhat=L^-t Y.
```

Row and column operators commute because they act on different port factors.
Neither code changes the bank names nor uses PR3882's cross-bank Pi permutation.
This is a replacement protocol; it cannot be inserted after the old literal
Pi occupancy without an additional derived and paid bridge.

For lower and upper uncorrected Gram shears,

```
S_r = [I 0; A_r I], R_c = [I -A_c; 0 I],

C S_r C^-1 = [I 0; P_r M_c I],
C R_c C^-1 = [I -M_r P_c; 0 I].
```

For example,
`L^-t A_r L^-1=(U_r^-t A_r U_r^-1)(U_c U_c^t)=P_r M_c`.
The upper identity follows from `U_c^-t A_c U_c^-1=P_c`.
The same C occurs at both sides of the internal boundary: there is no row-code
to column-code transition there. This is an exact Gaussian-dyadic logical
protocol, including arbitrary real and imaginary input components.

All data are retained. In one axis, a kernel input `(-B z,z)` becomes `(0,z)`
under U, so zero query does not mean zero payload. The decoder restores this
input exactly. Both 72-per-fiber auxiliary banks may be appended as independent
identity blocks. No helper initialization, erasure, borrowing or return is used
by this scalar code. Their required physical completion remains separate.

## Physical operator order and fixed returns

Let `G_0,G_1,G_2` be the actual all-role chart maps at the entrance, shared
interstage cut and exit of a proposed implementation. The retained caller gives
`G_0=diag(T,I)` and `G_2=diag(F,E)` on data, with `E=F T^-1`; its actual
intermediate owner/chart schedule is not supplied for this changed P104 protocol.
Define the physical coding map at a cut by

```
C_t = G_t C G_t^-1.
```

For a physical first stage `W1=G_1 S_r G_0^-1` and second stage
`W2=G_2 R_c G_1^-1`, the exact coded replacements are

```
W1hat = C_1 W1 C_0^-1 = G_1 C S_r C^-1 G_0^-1,
W2hat = C_2 W2 C_1^-1 = G_2 C R_c C^-1 G_1^-1.
```

For the retained data entrance and exit charts specifically,

```
C_0 = diag(T L T^-1, L^-t),
C_2 = diag(L, T^-1 L^-t T),
C_2^-1 = diag(L^-1, T^-1 L^t T).
```

Here F is common to every port and commutes with scalar port coefficients and
the positive T family. For instance, the X entry block has matrix coefficient
`T_i L_ij T_j^-1`; it is not a free scalar L_ij read across unequal charts.
At a genuinely common FULL cut, `G=diag(F,F)` and `C_t=C`; this is a useful
special case, but does not supply the missing intrinsic-source entrance.

Their internal factors cancel in their displayed order. Port-dependent T need
not commute with U or L; no such commutation is used. The independent checker
uses noncommuting chart matrices as a control. Entry coding `C_0` and final
decoding `C_2^-1` restore the original named physical X/Y slots. Helpers are
identity blocks in C; their G maps are retained, not silently completed for free.

These formulas specify a physical changed-caller contract. They do **not**
provide legal native recipes, shared ownership, a concrete G_1, paid cross-port
routes, or an actual adjacent completed P104 pair. Applying the bare scalar C
in physical storage would generally be wrong. Native lowering must implement
these ordered conjugates or derive an equivalent paid schedule.

## Constructive scalar words and their complete comparison

All counts in this section assume a common full chart, arbitrary Gaussian-dyadic
payloads, and temporarily writable donors restored after each sweep. A U or
U^-1 sweep halves 96 nonpivot donors, performs 384 signed unit ADD/SUBs and
restores by doubling. A transposed sweep uses eight pivot donors. There are no
fresh scratch arrays, cross-bank swaps, or discarded payloads.

To encode both banks, execute four sweeps across 104 fibers each. Decode by
reversing and negating the sweeps. To apply `P_r M_c`, only eight pivot row fibers
are active: transform the source by `M=UU^t` (two sweeps), add its 104 fields
to the target row, and reverse the two sweeps. Apply `M_r P_c` analogously on
eight pivot column fibers. Every modified source is restored before the next
stage. An explicit uncoded reference computes `A=U^t P U` by a query sweep,
eight pivot deliveries, a B^t delivery, and inverse query sweep for each of
104 fibers. It is a specified constructive comparator, not an optimal word.

| Exact scalar word | Unit ADD/SUB | Halves | Restoring doubles |
|---|---:|---:|---:|
| Global entry plus exit code | 319,488 | 43,264 | 43,264 |
| One coded **uncorrected Gram** pair | 26,240 | 3,328 | 3,328 |
| One uncoded reference Gram pair | 241,280 | 41,600 | 41,600 |

For k repeated identical uncorrected Gram pairs, encoded ADD cost is
`319488+26240k`, compared with `241280k`; halve and double counts are each
`43264+3328k`, compared with `41600k`. One pair costs 104,448 more additions.
The first integer k giving savings in all three columns is k=2, saving 110,592
additions and 33,280 halves and doubles each. This example demonstrates what
an amortized common code can remove: repeated query traversals on 96 nonpivot
fibers, with all entry/exit work charged. An actual repeated physical consumer
has not been identified. Other uncoded factorizations can amortize as well;
no scalar optimum, runtime speedup or native rank saving follows.

## Identity completion restores a full-dimensional obligation

Let `N=M^-1=U^-t U^-1`. The corrected identity shears require

```
C [I 0; I I] C^-1 = [I 0; N_r M_c I],
C [I -I; 0 I] C^-1 = [I -M_r N_c; 0 I].
```

Hence the omitted lower/upper side terms are
`(N_r-P_r)M_c` and `M_r(N_c-P_c)`. Since
`N-P=U^-t (I-A) U^-1`, and A has eigenvalues 13 (multiplicity eight) and
zero (multiplicity 96), `I-A` is invertible. Each global side term therefore
has full rational rank **10,816**. That is algebraic rank, not a native-child
cost lower bound. In particular, compressing the Gram query to eight pivot
coordinates does not complete the required identity shear on the other 96
independent payload coordinates.

The complete physical bill remains

```
entry/exit native code + coded Gram stages + identity-side completion
+ copied-center physical endpoint correction and wrappers
+ dirty-helper completion + ownership/holding/routing/control
+ precision/recovery/admission costs.
```

Only the formal scalar code/Gram terms above are constructively counted here.
Every other displayed term is unresolved; none is zero by default. Reusing
PR3954's unchanged 208 mass-2576 local calls and progress assumptions retains
its 44,096 excess before added code costs. Replacing those words by this code
changes their native profile and needs a newly derived full gate. The scalar
k=2 comparison does not certify such a gate. Stop dependent native expansion
until one physical repeated consumer and its complete allowance are specified.

## Why a free 13-eigenvalue split is invalid over the dyadic ring

The congruence does not give a dyadic similarity to `13P`. Reduce R into F_13
by `i -> 5` and `1/2 -> 7`. Invertible matrices over R remain invertible after
this reduction because their inverses reduce too. The Gram matrix satisfies
`A^2=13A` but has rank eight modulo 13: `V=[I B]` is surjective and V^t
injective, so `A=V^t V` has rank eight even though its square is zero.
Consequently `A_r A_c=A tensor A` has rank 64 modulo 13 and is nonzero.

For any invertible bank-separate code `(Xhat,Yhat)=(Q X,R Y)`, the two shear
coefficients become `R A_r Q^-1` and `Q A_c R^-1`; their product is similar
to `A_r A_c`. They cannot both become scaled coordinate projectors
`alpha P_r`, `beta P_c` with `alpha beta=169`: that product reduces to zero
modulo 13, contradicting rank 64. The product 169 is forced if these are the
claimed nonzero spectral blocks. This obstruction covers bank-separate
R-invertible codes and this specific full spectral-normalization target.
It does not prohibit all joint codes, general bank-mixing programs, paid
non-dyadic primitives, or other changed graphs. Our explicit U code succeeds
by retaining the nontrivial M couplings.
78 changes: 78 additions & 0 deletions research/p104-tensor-code/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# One dyadic tensor code across both P104 axes

This package constructs one invertible code on all **21,632 data fields**:
`L=U_r U_c^-t`, `(Xhat,Yhat)=(L X,L^-t Y)`, with
`U=[[I,B],[0,I]]`. The same code is retained across both logical Gram stages,
so the row/column representation mismatch in [PR3961](https://github.com/CrocSwap/integer-mult-bounds/pull/3961)
is replaced by a matched shared representation. Every independent payload,
including the Gram kernel, is retained; entry and exit return fixed X/Y slots.
No division by 13, scratch array, helper erasure or free owner relabel is used.

The exact transformed Gram coefficients are `P_r M_c` and `M_r P_c`, where
`M=UU^t`. Literal scalar words and both code boundaries are fully counted.
For two **repeated uncorrected Gram pairs** they save 110,592 unit additions
and 33,280 halves/restoring doubles each against the specified uncoded word.
One pair loses 104,448 additions. This is an exact common-chart protocol
comparison, **not a full-caller, native-rank or runtime improvement**.

The actual retained caller requires identity shears. With `N=M^-1`, their
coded coefficients become `N_r M_c` and `M_r N_c`; the omitted side terms each
have full rational rank 10,816. Algebraic rank is not native tariff. Native
transport, actual repeated consumer, identity completion, helpers, ownership
and precision remain unpriced. No complete gate passes on the present evidence.

A separate coefficient-ring result explains why M cannot simply be discarded:
`A tensor A` has rank 64 modulo 13, while a proposed fully normalized spectral
projector product `169 P_r P_c` is zero there. Thus invertible bank-separate
Gaussian-dyadic codes cannot perform that particular free spectral split.
This does not prohibit arbitrary joint codes or programs with a changed alphabet.

See [PROOF.md](PROOF.md) for the physical chart-conjugation order, constructive
words, full obligation ledger and scoped module proof. [RESULT.json](RESULT.json)
contains finite counts; [TASK.json](TASK.json) records the changed premise and
next questions. Selected frontier and frozen predecessors are unchanged.

## Reproduce

Standard-library Python 3.12:

```
python3.12 -B scripts/research_package.py --package research/p104-tensor-code
python3.12 -B scripts/check_research_commit.py --package research/p104-tensor-code --check-source-history
```

The primary verifier authenticates three canonical-main inputs, reconstructs
the P104 matrix, executes the complete encoder/two-pair/decoder scalar word on
an arbitrary dense fixture with dirty-helper sentinels, enumerates every charged
operation, and checks the modular ranks. The separate Fraction oracle imports
only the word builders, evaluates them independently on every basis column of
two small whole-grid fixtures, and checks the tensor and physical-chart formulas.
It does not import the primary evaluator or claimed receipt. Destructive tests
cover optimized execution, false typed receipts, corrupted/missing source,
readonly Git-free replay and altered operation/return behavior. Finite evidence
supports the displayed algebra; no human or kernel theorem review is claimed.

## Open next questions

Find one actual repeated producer/consumer pair that can retain this shared code
through the **identity completion**, and specify every intermediate physical
chart/owner. Begin with the explicit `N-P` side maps, not an eight-coordinate
restriction of the input domain. Alternatively, derive one native triangular
code sweep with exact chart transport, fixed returns and a complete allowance.
Do not expand native construction until that allowance is favorable. A new
non-dyadic alphabet or general bank-mixing code must state its changed contract
before invoking the modulo-13 result.

## Credit

Chris R / Clear1nsight, with substantial OpenAI Codex assistance. Apache-2.0.
PR3961 supplies the preceding mismatch question; its source authentication/root
constructor is reused here with credit. PR3882/3940/3943/3954 retain the residual,
caller, cleanup and gate lineage. ToikY/PR3956 owns the adapter comparison and
PR3966 the independent uniform-phase gauge; neither is a premise of this replay.
Rohan Arun/PR1972, Chafik Boukhalfa/PR1991, Adam Gall/PR1940, Josie Elliston/E8,
Sagar Thakrar/PR1012, Douglas Colkitt, Dominik Scholz and the retained native,
compiler, occupancy and terminal-floor sources retain their original credit.
The code is newly derived; it does not claim their native word as implemented
in coded coordinates. Pending PRs are context only: all replay inputs and
provenance are on canonical main, so no unmerged Git object is required.
33 changes: 33 additions & 0 deletions research/p104-tensor-code/RESULT.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"arithmetic_scope": "exact common-chart Gaussian dyadic word; formal scalar counts, not physical/native upper bill",
"boundary_invoice": {
"add": 319488,
"double": 43264,
"half": 43264
},
"code": "L=U_r U_c^-t; (Xhat,Yhat)=(L X,L^-t Y)",
"coded_pair_invoice": {
"add": 26240,
"double": 3328,
"half": 3328
},
"data_degrees": 21632,
"first_add_break_even_integer": 2,
"first_half_break_even_integer": 2,
"full_identity_side_rank": 10816,
"mod13_gram_rank": 8,
"mod13_tensor_product_rank": 64,
"one_pair_add_difference": 104448,
"reference_pair_invoice": {
"add": 241280,
"double": 41600,
"half": 41600
},
"remaining": "physical chart recipes, actual repeated consumer, identity-side correction, helpers/owners, full native moment and precision",
"schema": "p104-tensor-code/1",
"source_rank": 8,
"transformed_lower": "P_r M_c",
"transformed_upper": "M_r P_c",
"two_pair_add_saving": 110592,
"two_pair_half_saving": 33280
}
36 changes: 36 additions & 0 deletions research/p104-tensor-code/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"schema_version": 1,
"base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90",
"files": [
{
"path": "certificates/selected-result.json",
"usage": "provenance",
"git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81",
"sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129"
},
{
"path": "docs/research/agent-task-catalog.json",
"usage": "provenance",
"git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5",
"sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0"
},
{
"path": "notes/copied-centers-complex.tex",
"usage": "input",
"git_blob": "fddd7bc7f2a2f749ba6eada19d153bf9243ee31c",
"sha256": "18eac6d5c5755e53230c0c12a633f38b6ce9666ef0322c1aff79394f2952af72"
},
{
"path": "research/p104-native-channel/PROOF.md",
"usage": "input",
"git_blob": "a69311b74f74a2f8e8f411c1451baacd9bacddce",
"sha256": "5d743145d389ffdfaffc66096fa7e32c7155b18f73d74755403151d0435bb94c"
},
{
"path": "research/p104-native-channel/inputs/P104-FIXTURE.json",
"usage": "input",
"git_blob": "2e16f99b295bb386fd13bd8fbd57b42ef54143a9",
"sha256": "516c06f6ec3cb84be588c546108de897650288576dd5fbf5fe44b9c5546ad8a4"
}
]
}
Loading