diff --git a/research/p104-translated-progress/PROOF.md b/research/p104-translated-progress/PROOF.md new file mode 100644 index 000000000..6ea34f436 --- /dev/null +++ b/research/p104-translated-progress/PROOF.md @@ -0,0 +1,219 @@ +# Symplectic width, translated progress and the P104 adapter boundary + +## 1. Question and exact scope + +PR3954 and PR3962 condition their two-axis cost screens on at most 2312 units +of persistent progress per unchanged P104 call. This study supplies a proof +for a named, broad class of **matched translations of the intrinsic endpoints**, +and an actual canonical-frame counterexample showing why the intrinsic +endpoint qualification cannot be omitted. It does not prove that every +translated program retains the old paid profile, preserves the caller's +initial credit, or implements a new supplier. + +The argument combines the binary symplectic description of Clifford address +operators with elementary rank-distance inequalities. These are standard +linear-algebra tools; the source-bound endpoint application and adapter +counterexample are the contribution. All matrix ranks in this note are over +F2. They are not rational operator ranks on arrays, tensor rank, or arbitrary +scalar-operation lower bounds. + +## 2. The native width and a progress potential + +Use Pauli coordinates (x,z), with X^x Z^z, and the unsigned symplectic matrix + + M = [A B; C D], phi(M)=rank(B). + +The pinned native compiler `vendor/clifford_exact.py:lower_child` sets its +positive child width to the rank of the X parts of the images of the Z +Paulis, exactly phi. Its `monomial` class has B=0. A child C on r independent +address bits has B of rank r. Binary address permutations, quadratic +fourth-root diagonal phases, Pauli translations and scalar phases have B=0. +Their physical work is still paid; saying phi=0 does not make them free. +The source compiler supplies a one-child normal form. For the bound below, +only the lower-bound direction is needed: any factorization into these +monomials and rank-r children has sum r >= phi of its product. + +Indeed, + + B(MN)=A(M) B(N)+B(M) D(N), + phi(MN)<=phi(M)+phi(N). + +For a symplectic matrix, M^-1=[D^t B^t; C^t A^t] in characteristic two, so +phi(M^-1)=phi(M). Thus + + |phi(M)-phi(N)| <= phi(M N^-1). + +One can instead use N^-1 M by factoring on the other side. A monomial factor +on either side preserves phi exactly: its relevant A or D block is +invertible. In contrast, arbitrary Clifford conjugation need not preserve +phi. Conjugating an X rotation by a Hadamard turns it into a diagonal Z +rotation, changing positive width from one to zero. The Hadamard and any +other inserted transformations require their own invoice. + +For a program with a separate invertible Clifford chart Gamma_r on each +persistent physical role, use Phi=sum_r phi(Gamma_r). Native transports pay +at least each signed increment of Phi. Scalar additions in an identical +chart do not change charts or Phi, regardless of the logical row coefficients. +A role permutation preserves the sum, but its realization/return is not +thereby free. Summing the signed increments telescopes; decreases cannot be +credited twice. Remaining work made from this named grammar therefore pays +at least max(0,Phi_final-Phi_current). For the required full tensor endpoint, +phi(F_m)=m on each original role. This proves the relevant native-progress +inequality when the role-local/common-chart invariant actually holds. + +This statement does not cover a general matrix of address operators coupling +several physical roles, a non-Clifford scalar algorithm, unproved owner +relabeling, or changed initial/final contracts. Those need a new potential or +an explicit comparison. Arbitrary dirty inputs cannot simply be deleted from +the endpoint sum. + +## 3. A matched-translation theorem + +Let Gamma_in and Gamma_out be two endpoint charts in the same ambient +Clifford space. Put K=Gamma_out Gamma_in^-1 and let + + delta(K)=rank(M(K)-I). + +This full symplectic defect is conjugacy invariant. It is only an upper +bound on phi, not a native tariff: B is a submatrix of M-I, giving +phi(M)<=delta(M). For arbitrary fixed Clifford L and R, set + + Gamma_in'=L Gamma_in R, + Gamma_out'=L Gamma_out R. + +Then Gamma_out' (Gamma_in')^-1=L K L^-1, and consequently + + |phi(Gamma_out')-phi(Gamma_in')| <= phi(L K L^-1) + <= delta(K). (1) + +Equation (1) permits arbitrary ambient symplectic L/R, spectator coordinates, +inverse orientation, phases, and nonorthogonal binary address descriptions. +It is a theorem about matched endpoints. It does not assert that every such +translation is legal at every internal addition, has the same native cost, +or supplies the prescribed global endpoint. Different translations at the +two ends introduce another operator and are outside (1) until that operator +is included and paid. + +If only one side is translated, the sharper phi(K) or phi(Gamma_in^-1 +Gamma_out) triangle can suffice. The conjugacy-invariant defect is useful +when both sides vary. No claim is made that a large defect lower-bounds the +cost of a translation; the inequality is in the opposite direction. + +## 4. Intrinsic P104 endpoints and sharpness + +The source native proof and compiler specify, for each odd physical root +label q in F2^9, + + C_q=((1+i)I+(1-i)X_q)/2, + F_9=product_j C_ej, + M(C_q)=[I q q^t; 0 I], M(F_9)=[I I;0 I]. + +The scalar sign of C_q or its inverse does not affect its unsigned +symplectic action. Since q^t q=1, I+q q^t has kernel exactly span(q) and rank +8. The 280 intrinsic chart endpoints are therefore: + +| Roles | Entrance | Exit | Relative symplectic defect | +|---|---|---|---:| +| 104 X | C_q | F_9 | 8 | +| 104 Y | I | F_9 C_q^-1 | 8 | +| 72 dirty helpers | I | F_9 | 9 | + +Each relative matrix has just the displayed upper-right block, so its defect +is exactly 8, 8 or 9. Applying (1) separately to every legally retained role +bounds total signed progress by + + 104*8+104*8+72*9=2312. + +The original intrinsic endpoints attain equality, proving sharpness for this +endpoint specification. Inverse-oriented calls have the same absolute cap; +this is not a proof that the required opposite-oriented physical caller +exists. Phase/global-sign equality remains a separate implementation +obligation; unsigned rank checks do not certify it. + +For a nondegenerate active space E with column basis V and nonsingular Gram +G=V^t V, the orthogonal projector is P_E=V G^-1 V^t. It is symmetric, +idempotent, and has rank dim(E). The quadratic Fourier phase defining C_E +has polarization 2 x^t P_E y, hence M(C_E)=[I P_E;0 I]. This includes +alternating nondegenerate spaces, without requiring an orthonormal basis. +For nested nondegenerate spaces, projector subtraction has rank equal to +the dimension difference. Tensor-axis embedding into a larger ambient space +and mixed inverse signs do not alter these defect ranks. The independent +control uses the alternating plane with basis (011,110) in F2^3, whose +projector has rank two. + +**Changed endpoints can reopen the gate.** If an actual new word leaves every +Y in F_9 instead of F_9 C_q^-1, its Y cap is nine. With the same X and helper +endpoints, (1) gives the sharp new total 2416. The old 2312 must not be reused. +This is an endpoint-dependent corollary, not proof of the concurrent changed- +consumer construction, its paid mass, source-consuming logical return, or its +global moment. The complete bill must be recomputed from that actual word. + +## 5. Why the canonical chart adapters matter + +The native compiler uses a particular `canonical_frame` Gamma_W. It is a +monomial conjugate of a coordinate C tensor and is not always the intrinsic +C_W. The published program has **208 rank-zero intrinsic endpoint adapters**: +104 source-entry adapters and 104 target-exit adapters. They add no positive +child to the original 2368 invoice. They are distinct from the **208 rank-one +side-correction transports** used by the later corrected profile. + +A fresh canonical-frame census gives: + +- 102 X endpoint cocycles: phi=8, full symplectic defect=10; +- the other two X endpoint cocycles: phi=8, defect=8; +- all 104 Y endpoint cocycles: phi=8, defect=8; +- all 72 helper endpoint cocycles: phi=9, defect=9. + +Thus applying an intrinsic defect-eight assertion to bare canonical X charts +would be incorrect. Here is a concrete control at actual port X0, whose +physical normal is q=386. Let G=Gamma_span(q), F=F_9 and let H be a Hadamard +symplectic swap on zero-based coordinate 1. A Gaussian-dyadic realization is +S C S on that bit, up to its explicitly retained global phase; use its actual +inverse where required. The source-bound matrices give + + phi(F G^-1)=8, delta(F G^-1)=10, + phi(H F G^-1 H^-1)=9. + +Choose L=H and R=G^-1 H^-1. Then the matched bare canonical entrance L G R +is identity, while the exit L F R has phi=9. The claimed per-source cap eight +would fail for these bare endpoints. This is a legal Clifford endpoint +example, not a lower-cost P104 supplier or a counterexample to (1). + +The missing intrinsic source adapter is A=G C_q^-1. Before translation +phi(A)=0, but after this translation phi(H A H^-1)=2. Including it restores +the intended intrinsic cocycle, for which + + phi(H F C_q^-1 H^-1)=8. + +One cannot translate the canonical chart and continue donating its old +rank-zero adapter classification. Every converted wrapper must be evaluated +in its actual position. Conversely, this does not say every translation makes +adapters positive: ordinary monomial translations preserve phi. + +As an explicit whole-word control, apply the same L=H and R=G^-1 H^-1 to all +280 canonical charts. Identical-chart additions remain identical-chart +additions. Reprice each of the 1410 literal transports by its actual +conjugated B block. The resulting canonical chart progress is 2066 and the +transport rank mass is 2248, leaving excess182. The original pair was +2312 and2368, excess56. This particular reduction in paid mass therefore +worsens the progress deficit. Intrinsic adapters and the side correction +still require separate repricing; no claim is made that2248 is a complete +corrected-call bill. The general proof, not this single census, supports the +intrinsic matched-translation cap. + +## 6. Decision and cost consequence + +NARROW translation-only attempts to raise progress while keeping the same +intrinsic endpoint contract. In the role-local common-chart grammar, the +progress cap used by PR3954/3962 is now justified for the matched translations +above. Their cost rejection still additionally assumes the corrected mass, +actual global initial credits/owner endpoint, native rank grammar and volume +normalization. Arbitrary translations can change the paid profile, so this +study does not promote those conditional screens to a universal P104 barrier. + +Continue a changed Y endpoint, coupled operator-valued encoding, or genuinely +new word only with its actual endpoint-derived potential and full invoice. +A feasible first test is the concurrent all-F9 target proposal: verify its +whole logical return and paid events, then use2416 only if its intrinsic +endpoint truly matches the displayed changed contract. No selected frontier, +shared controls or frozen predecessor evidence is changed here. diff --git a/research/p104-translated-progress/README.md b/research/p104-translated-progress/README.md new file mode 100644 index 000000000..3a97c6773 --- /dev/null +++ b/research/p104-translated-progress/README.md @@ -0,0 +1,112 @@ +# P104 translated progress: symplectic width and an adapter-sensitive boundary + +**Result:** matched Clifford translations cannot raise the persistent progress +of the unchanged **intrinsic** P104 endpoints above 2312. The proof uses the +actual native width `phi(M)=rank_F2(B)` of a Clifford symplectic matrix and a +conjugacy-invariant upper bound from `rank(M-I)`. It applies to role-local +charts and common-chart scalar additions, with the same translation at both +ends. It does not assume that translations retain the paid native profile. + +The source convention matters. At actual X0, translating the **bare canonical** +endpoint changes its native width from 8 to 9. Its previously rank-zero source +adapter then costs width 2. Including the intrinsic adapter restores width 8. +This is a concrete missing-hypothesis control, not a supplier improvement. +The 208 rank-zero intrinsic adapters are distinct from the later 208 rank-one +side-correction transports. + +The theorem is reusable after a real endpoint change. If every Y ends at F9 +instead of F9*Cq^-1, the corresponding sharp progress cap becomes **2416**. +The old 2312 must not be applied to that changed contract. Any such new word +still needs its actual logical return, complete bill and global caller proof. + +[PROOF.md](PROOF.md) contains the general matrix proof, nonorthogonal and +alternating residual treatment, exact source binding, counterexample and +scope limits. [RESULT.json](RESULT.json) contains the finite receipt. The +source-bound whole canonical Hadamard control has native mass 2248 and +progress 2066, worsening their difference from 56 to 182; intrinsic adapters +and side correction remain separately chargeable. No complete changed-call +invoice or new kappa is claimed. The selected frontier is unchanged. + +## Reproduction + +Python 3.12, standard library only, from the repository root: + +```sh +python3 -B research/p104-translated-progress/verify.py +python3 -O -B research/p104-translated-progress/independent.py +python3 -O -B -m unittest discover -s research/p104-translated-progress -p test_verify.py -v +python3 -B scripts/research_package.py --package research/p104-translated-progress +``` + +The primary checker authenticates nine canonical inputs (including the retained compiler notice and license), reconstructs all +14400 root pairings and the 104 physical ports, binds all 1410 original +transport widths, checks all 280 canonical endpoint cocycles, and recomputes +the translated control. It imports the pinned native compiler only to +instantiate its actual canonical-frame convention; it does not import the +channel generator or treat that compiler as an independent checker. + +The separate checker imports no producer or primary verifier. Dense binary +arithmetic checks all 518400 products of Sp(4,2), 2160 matched translations, +and the actual 18-by-18 counterexample/adapter matrices. Exact Gaussian +rational operators independently recover six Cq/inverse Pauli actions. +Six unittest methods include seven actual optimized-CLI receipt/source faults +(each preceded by a passing private-fixture baseline) and mathematical controls for unmatched endpoints, even labels, changed +outputs and non-invariant native width. Typed receipts and duplicate JSON keys +fail closed. All commands support a read-only, Git-free source export; test +mutations affect only disposable private copies. + +These checks support the scoped proof. Unsigned symplectic ranks do not +certify phases, the complete physical channel, signed-floor/precision or +all-size admission. The old native phase checks retain their own source scope. + +## Sources, credit and overlap + +Baseline: canonical main `20ecf2891d80b5acf18d980b2164fb44ea7faa90`, priority +revision 6. [SOURCES.json](SOURCES.json) contains exact base/blob/SHA256 pins; +all replay inputs are available in canonical history. Pending PRs motivate +the question but are not imported as hidden Git dependencies. + +- Rohan Arun / [PR1972](https://github.com/CrocSwap/integer-mult-bounds/pull/1972) + and Adam Gall / PR1940 supply the scalar/frame word and schedule. +- [PR1991](https://github.com/CrocSwap/integer-mult-bounds/pull/1991) + supplies the native realization and intrinsic adapters, prepared for Chafik Boukhalfa. Its compiler credit + remains with icekylinx's frame-sa504 work; physical-label and independent + interpreter credit remains with the predecessor chain recorded there. +- Douglas Colkitt and the credited authors of `notes/endpoint-gauge-complex.tex` + and `notes/copied-centers-complex.tex` supply the residual normal form and + actual translated/exterior caller semantics. +- [PR3954](https://github.com/CrocSwap/integer-mult-bounds/pull/3954), head + `f1e2839819959cd0534d008be91ed5b79ec55a6a`, and + [PR3962](https://github.com/CrocSwap/integer-mult-bounds/pull/3962), head + `f7572974ac7fbcd21fd71c73b64bca0c8487aed6`, leave the conditional progress + implication audited here. Their incidence and full-gate results are not + claimed anew. +- [PR3882](https://github.com/CrocSwap/integer-mult-bounds/pull/3882), + [PR3894](https://github.com/CrocSwap/integer-mult-bounds/pull/3894), + [PR3940](https://github.com/CrocSwap/integer-mult-bounds/pull/3940), + [PR3961](https://github.com/CrocSwap/integer-mult-bounds/pull/3961) and + [PR3965](https://github.com/CrocSwap/integer-mult-bounds/pull/3965) own the + correction, encoded boundary and copy-lifetime contexts. ToikY's + [PR3966](https://github.com/CrocSwap/integer-mult-bounds/pull/3966) concerns + phase-uniform gauges, a different obligation. + +Clear1nsight, with substantial OpenAI Codex multi-agent assistance. Apache-2.0. +No literature-priority, proof-assistant or independent human-review claim. + +## Open next questions + +1. **Changed intrinsic target endpoint:** verify the proposed all-F9 target + word and price its complete correction/consumer. The first step is its + all-role physical boundary; only then use the 2416 cap in a new global bill. +2. **Coupled operator-valued charts:** determine whether a cross-role encoding + admits a useful replacement for this role-local sum. Start with one actual + adjacent pair and its complete transition, not a free abstract mixing. +3. **Translation with changed native profile:** price every conjugated child, + intrinsic adapter, exterior and final wrapper before comparing costs. + The source-bound X0 control shows why old rank-zero classifications cannot + simply be carried through a new Clifford conjugation. + +Decision: NARROW matched-translation-only progress searches under unchanged +intrinsic endpoints; retain changed endpoints and coupled algorithms as +explicitly different research directions. Structured next steps are in +[TASK.json](TASK.json). diff --git a/research/p104-translated-progress/RESULT.json b/research/p104-translated-progress/RESULT.json new file mode 100644 index 000000000..0e6c8d1f8 --- /dev/null +++ b/research/p104-translated-progress/RESULT.json @@ -0,0 +1,740 @@ +{ + "schema_version": 1, + "claim": "matched intrinsic role-local Clifford translations preserve the2312 progress upper bound", + "intrinsic_ports": [ + { + "q": 386, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 391, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 405, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 431, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 445, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 440, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 426, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 351, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 304, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 290, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 295, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 309, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 346, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 357, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 31, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 32, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 79, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 93, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 88, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 74, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 37, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 26, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 127, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 224, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 223, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 176, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 162, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 167, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 181, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 218, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 229, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 122, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 261, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 494, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 385, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 406, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 446, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 425, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 454, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 468, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 289, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 310, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 345, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 331, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 358, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 372, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 283, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 94, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 73, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 38, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 52, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 25, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 11, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 100, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 115, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 134, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 148, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 251, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 236, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 196, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 211, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 188, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 174, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 161, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 182, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 217, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 203, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 230, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 244, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 155, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 140, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 121, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 107, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 4, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 19, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 59, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 44, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 67, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 81, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 262, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 276, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 379, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 324, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 339, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 316, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 302, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 475, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 460, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 419, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 433, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 398, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 481, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 502, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 82, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 301, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 434, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 397, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 482, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 501, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 487, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 392, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 439, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 296, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + }, + { + "q": 87, + "source_progress": 8, + "target_progress": 8, + "cocycle_defect": 8 + } + ], + "intrinsic_total_bound": 2312, + "changed_full_Y_endpoint_bound": 2416, + "canonical_endpoint_census": { + "X:B8:defect10": 102, + "X:B8:defect8": 2, + "Y:B8:defect8": 104, + "Q:B9:defect9": 8, + "G:B9:defect9": 32, + "D:B9:defect9": 32 + }, + "counterexample": { + "register": "X0", + "q": 386, + "H_axis": 1, + "canonical_B_rank": 8, + "canonical_defect": 10, + "translated_B_rank": 9, + "entry_adapter_B_rank": 0, + "translated_entry_adapter_B_rank": 2, + "intrinsic_translated_B_rank": 8, + "canonical_source_columns": [ + 1, + 66944, + 4, + 8, + 16, + 32, + 64, + 66818, + 256, + 512, + 65922, + 2048, + 4096, + 8192, + 16384, + 32768, + 1410, + 198018 + ], + "relative_columns": [ + 1, + 66818, + 4, + 8, + 16, + 32, + 64, + 66944, + 256, + 513, + 65794, + 2052, + 4104, + 8208, + 16416, + 32832, + 1408, + 197632 + ], + "translated_relative_columns": [ + 1, + 66816, + 4, + 8, + 16, + 32, + 64, + 65922, + 256, + 513, + 66818, + 2052, + 4104, + 8208, + 16416, + 32832, + 386, + 196610 + ] + }, + "whole_canonical_control": { + "progress": 2066, + "native_mass": 2248, + "native_excess": 182, + "histogram": { + "1": 1074, + "2": 118, + "3": 66, + "4": 80, + "5": 32, + "6": 20, + "7": 20 + }, + "scope": "conjugated transports only; intrinsic endpoint adapters and side correction must be separately repriced" + }, + "alternating_plane": { + "ambient_dimension": 3, + "basis": [ + 3, + 6 + ], + "projector_columns": [ + 6, + 5, + 3 + ], + "rank": 2 + }, + "selected_frontier_changed": false +} diff --git a/research/p104-translated-progress/SOURCES.json b/research/p104-translated-progress/SOURCES.json new file mode 100644 index 000000000..356f2e71a --- /dev/null +++ b/research/p104-translated-progress/SOURCES.json @@ -0,0 +1,72 @@ +{ + "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": "notes/endpoint-gauge-complex.tex", + "usage": "input", + "git_blob": "907a0ceda8df0317ddc7f2b71df5af2aa4d47dfc", + "sha256": "dfee33b0281e5551bb6927f757ff0240abade60ae1800f715afd88853ae0191e" + }, + { + "path": "research/p104-native-channel/PROOF.md", + "usage": "input", + "git_blob": "a69311b74f74a2f8e8f411c1451baacd9bacddce", + "sha256": "5d743145d389ffdfaffc66096fa7e32c7155b18f73d74755403151d0435bb94c" + }, + { + "path": "research/p104-native-channel/compile.py", + "usage": "input", + "git_blob": "840d7608d6795d12ba174620279f88d8a6f727b4", + "sha256": "9d2fc2d81962ddb0b4dd7d6482d9918a87a6b05759690317dea79939ca5656a3" + }, + { + "path": "research/p104-native-channel/inputs/LOWRANK-WITNESS.json", + "usage": "input", + "git_blob": "86beaf424e9f0f800ae3a62797d94ec9386b7706", + "sha256": "0f541bef7f19fdeffd67157684e9f03d785f42c89973632f508fc1a0452b580e" + }, + { + "path": "research/p104-native-channel/inputs/P104-FIXTURE.json", + "usage": "input", + "git_blob": "2e16f99b295bb386fd13bd8fbd57b42ef54143a9", + "sha256": "516c06f6ec3cb84be588c546108de897650288576dd5fbf5fe44b9c5546ad8a4" + }, + { + "path": "research/p104-native-channel/vendor/clifford_exact.py", + "usage": "input", + "git_blob": "166841a037f069249f6f7f6dedb89248812f59e2", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "LICENSE", + "usage": "input", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + { + "path": "research/p104-native-channel/notices/FRAME-SA504-NOTICE.md", + "usage": "input", + "git_blob": "f7a8f861be860edd5a78114c5225dec90effa029", + "sha256": "a92f49c5ced455160fbedcc8954e3c9255e3605e88ad12ae5a84f1c4302986f1" + } + ] +} diff --git a/research/p104-translated-progress/TASK.json b/research/p104-translated-progress/TASK.json new file mode 100644 index 000000000..f764cc86f --- /dev/null +++ b/research/p104-translated-progress/TASK.json @@ -0,0 +1,105 @@ +{ + "schema_version": 1, + "task_id": "p104-side-correction", + "priority_revision": 6, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "original_card": { + "id": "p104-side-correction", + "question": "Can the proposed P104 joint endpoint flags be realized by a chronological correction program with coefficients, dirty restoration and an affordable complete bill?", + "starting_points": [ + "docs/research/research-family-status.md", + "research/p104-native-channel/README.md", + "research/p104-native-channel/PROOF.md", + "docs/research/community-efficient1000-review.md", + "research/p104-joint-unit-flags/README.md" + ], + "methods": [ + "Construct one side-correction word at an explicit chronological cut with the needed frames still available.", + "Derive a lower bound on the side correction and hosting costs that decides whether this channel can beat the selected budget." + ], + "acceptance_gate": "An exact arbitrary-input identity, source/target frame availability and restoration at the chosen cut, plus the complete channel+correction+idle/hosting bill or an explicit favorable bound. The native channel alone is not a supplier. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the revision-6 family record and #2981 static joint flags, alongside the reviewed #1991 channel. #2981 is an author-checked source archive, not an independently validated executable correction or a refutation of program-level lifetime floors.", + "scope": "Source-bound orientation only. Read the named package and review before relying on its local evidence; this command is not its replay or supplier admission." + }, + "first_experiment": "After checking live handoffs, pin one named collection from #2981 and attach acquisition/delivery times, source dependencies and coefficient requirements. Test legal access and arbitrary dirty restoration; price any completion against the full channel/endpoint/hosting allowance. Stop with the exact missing implication or a scoped counterexample rather than expanding the static cover census.", + "bottleneck_link": "Completing an already realized changed channel tests a concrete construction opportunity, instead of refining the incumbent packing. A positive local result still needs global and all-size admission.", + "allowed_variations": [ + "One correction factorization, one chronological cut, or one explicit hosting obstruction.", + "A changed correction schedule with an updated full bill and native frame contract." + ], + "scope_change_triggers": [ + "Recompiling the already certified low-rank channel without closing a new obligation.", + "Treating a pending ancestor, local histogram or unpriced side correction as an admitted global supplier.", + "Repeating a correction or physical conversion already supplied by a pending follow-up without adding independent coverage or a different unresolved obligation.", + "Repeating the 208-flag static matching or calling a static nested cover a chronological correction program. Independent audit of that certificate is distinct and remains useful." + ], + "overlap_terms": [ + "P104", + "I-G/2", + "side correction", + "native channel", + "1972", + "1991", + "2586", + "endpoint transport", + "physical dual", + "relay composition", + "2981", + "joint unit flags", + "acquisition delivery", + "static nesting" + ], + "existing_checks": [ + { + "scope": "PR #2981 reports static joint endpoint flags and a matching of 208 departure and arrival flags; archival intake is not independent verification.", + "evidence": "research/p104-joint-unit-flags/README.md", + "remaining": "Independent flag check and a chronological coefficient program with dirty restoration and a complete cost.", + "status": "author-checked", + "source_commit": "3d24b92d8ba057b57cb2d480170ec407520e6882", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Prove an endpoint-dependent progress bound for matched intrinsic Clifford translations, and audit actual canonical adapter placement with a source-bound counterexample.", + "scope_change_reason": "Explicit user-directed contrasting-fields follow-up to PR3954/3962: audit the translated persistent-progress premise using Clifford symplectic width and rank-distance bounds.", + "bottleneck_link": "Decides when the2312 progress hypothesis is justified and when changed endpoints or adapter placement require a new complete bill.", + "budget_minutes": 50, + "stop_rule": "Do not expand native construction under unchanged intrinsic endpoints merely by translating charts; preserve any actual changed endpoint/profile as a separate newly priced contract.", + "outcome": "completed", + "evidence": "PROOF.md, typed RESULT.json, source-bound verify.py, independent dense/operator checker and optimized CLI/scientific fault controls.", + "author": "Clear1nsight, with substantial OpenAI Codex assistance", + "ai_assistance": "Substantial OpenAI Codex multi-agent assistance for research, implementation and review; no independent human or formal proof-assistant review.", + "open_questions": [ + { + "question": "Can the actual changed-consumer word leave all Y roles at F9 with an affordable corrected caller?", + "why_it_matters": "The proven endpoint-dependent progress cap would become2416 instead of2312.", + "first_step": "Authenticate its all-role logical/physical endpoint and reprice every correction and exterior operation.", + "blocked_by": "Pending sibling source-bound construction and complete global invoice." + }, + { + "question": "Can coupled operator-valued charts evade the role-local potential while retaining a paid physical interface?", + "why_it_matters": "This theorem assumes a separate Clifford chart on each persistent role.", + "first_step": "Specify one actual adjacent encoded call pair and every transition/return operator.", + "blocked_by": "No general coupled potential or fully priced physical implementation." + } + ], + "checkpoint": { + "canonical_main": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "priority_revision": 6, + "root_overlap_checked_utc": "2026-10-19T07:38:11Z", + "coverage": "Root coordination checked all676 open PR bodies including drafts and bounded live family Discussion/claim updates; agent refreshed latest100 updated PR bodies and canonical main. No full-board exhaustiveness claim.", + "canonical_claim": "https://github.com/CrocSwap/integer-mult-bounds/pull/3954#issuecomment-6262365386", + "selected_frontier_changed": false, + "parallel_scopes": "Global coded callers, joint physical correction and dirty-query/copy-free resynthesis are separate siblings; no unproved savings imported.", + "agent_main_refreshed_utc": "2026-10-19T07:56:16Z", + "root_later_overlap_check": "Root reported at07:53UTC: canonical main unchanged; latest100 updated PR bodies contain no new external same-scope overlap." + } +} diff --git a/research/p104-translated-progress/VALIDATION.json b/research/p104-translated-progress/VALIDATION.json new file mode 100644 index 000000000..aeee19bd1 --- /dev/null +++ b/research/p104-translated-progress/VALIDATION.json @@ -0,0 +1,20 @@ +{ + "schema_version": 1, + "status": "author-checked", + "python": "3.12.3", + "scope": "Intrinsic endpoint-dependent symplectic progress proof, canonical adapter counterexample, and bounded transport-only control.", + "checks": [ + "Source-bound primary verification: 9 inputs,14400 physical pairings,280 endpoint cocycles,1410 original tariff checks.", + "Independent dense checker:518400 Sp4 products,2160 matched translations,6 exact Gaussian rational operators.", + "Six optimized unittest groups; seven CLI mutation cases, each with a successful pristine private-fixture baseline.", + "Registered package replay passed; publication exact-head and cold-export receipts are recorded externally after commit." + ], + "review": "Coordinating Codex agent read the mathematical proof and scoped controls. No independent human or proof-assistant review claimed.", + "limits": [ + "Unsigned matrices do not certify all physical phases.", + "Matched endpoint theorem requires role-local common-chart semantics.", + "2248 is transport-only canonical mass, not a complete corrected-call invoice.", + "2416 is a conditional changed-endpoint cap, not admission of a changed supplier.", + "Selected frontier unchanged." + ] +} diff --git a/research/p104-translated-progress/VERIFY.json b/research/p104-translated-progress/VERIFY.json new file mode 100644 index 000000000..ace4117b6 --- /dev/null +++ b/research/p104-translated-progress/VERIFY.json @@ -0,0 +1,55 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "notes/copied-centers-complex.tex", + "notes/endpoint-gauge-complex.tex", + "research/p104-native-channel/PROOF.md", + "research/p104-native-channel/compile.py", + "research/p104-native-channel/inputs/LOWRANK-WITNESS.json", + "research/p104-native-channel/inputs/P104-FIXTURE.json", + "research/p104-native-channel/vendor/clifford_exact.py", + "LICENSE", + "research/p104-native-channel/notices/FRAME-SA504-NOTICE.md" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Authenticated physical labels, intrinsic2312/changed2416 endpoint bounds, all1410 native tariff uses and actual canonical adapter counterexample." + }, + { + "argv": [ + "{python}", + "-O", + "-B", + "{package}/independent.py" + ], + "timeout_seconds": 120, + "checks": "Separate dense symplectic and exact Gaussian operator checker:518400 products and2160 translations." + }, + { + "argv": [ + "{python}", + "-O", + "-B", + "-m", + "unittest", + "discover", + "-s", + "{package}", + "-p", + "test_verify.py", + "-v" + ], + "timeout_seconds": 180, + "checks": "Six scientific/control methods including seven actual optimized CLI receipt/source faults." + } + ] +} diff --git a/research/p104-translated-progress/independent.py b/research/p104-translated-progress/independent.py new file mode 100644 index 000000000..8a2db8661 --- /dev/null +++ b/research/p104-translated-progress/independent.py @@ -0,0 +1,129 @@ +#!/usr/bin/env python3 +"""Independent dense binary and exact Gaussian operator checks; no producer imports.""" +from collections import deque +from fractions import Fraction as Q +from pathlib import Path +import json + + +def need(ok,message): + if not ok:raise ValueError(message) +def eye(d):return tuple(tuple(int(i==j) for j in range(d)) for i in range(d)) +def product(a,b):return tuple(tuple(sum(a[i][k]*b[k][j] for k in range(len(a)))%2 for j in range(len(a))) for i in range(len(a))) +def gf_rank(rows): + a=[list(r) for r in rows];r=0 + for j in range(len(a[0]) if a else 0): + pivot=next((i for i in range(r,len(a)) if a[i][j]),None) + if pivot is None:continue + a[r],a[pivot]=a[pivot],a[r] + for i in range(len(a)): + if i!=r and a[i][j]:a[i]=[x^y for x,y in zip(a[i],a[r])] + r+=1 + return r + +def phi(a): + n=len(a)//2 + return gf_rank([row[n:] for row in a[:n]]) +def inv(a): + d=len(a);x=[list(row)+list(unit) for row,unit in zip(a,eye(d))] + for j in range(d): + i=next(i for i in range(j,d) if x[i][j]);x[i],x[j]=x[j],x[i] + for i in range(d): + if i!=j and x[i][j]:x[i]=[a^b for a,b in zip(x[i],x[j])] + return tuple(tuple(row[d:]) for row in x) + +def group2(): + gens=[] + for k in range(2): + h=[list(r) for r in eye(4)];h[k],h[2+k]=h[2+k],h[k];gens.append(tuple(map(tuple,h))) + s=[list(r) for r in eye(4)];s[2+k][k]=1;gens.append(tuple(map(tuple,s))) + c=[list(r) for r in eye(4)];c[1][0]=1;c[2][3]=1;gens.append(tuple(map(tuple,c))) + seen={eye(4)};queue=deque(seen) + while queue: + a=queue.popleft() + for g in gens: + b=product(g,a) + if b not in seen:seen.add(b);queue.append(b) + need(len(seen)==720,'Sp4 group size') + return sorted(seen),gens + +# Exact Gaussian rationals, avoiding numerical state-vector comparisons. +z=(Q(0),Q(0));one=(Q(1),Q(0));ii=(Q(0),Q(1)) +def add(a,b):return a[0]+b[0],a[1]+b[1] +def neg(a):return -a[0],-a[1] +def times(a,b):return a[0]*b[0]-a[1]*b[1],a[0]*b[1]+a[1]*b[0] +def adj(a):return tuple(tuple((a[j][i][0],-a[j][i][1]) for j in range(len(a))) for i in range(len(a))) +def gm(a,b): + out=[] + for i in range(len(a)): + row=[] + for j in range(len(a)): + s=z + for k in range(len(a)):s=add(s,times(a[i][k],b[k][j])) + row.append(s) + out.append(tuple(row)) + return tuple(out) +def pauli(n,x,y):return tuple(tuple((Q((-1)**((y&j).bit_count()&1)),Q(0)) if i==j^x else z for j in range(1<=n else 0) + v=gm(gm(u,p),adj(u));matches=[] + for x in range(1<>i)&1 for j in range(2*n)) for i in range(2*n)) + +def main(): + g,gens=group2();triangles=0 + for a in g: + ra=phi(a) + need(phi(inv(a))==ra,'inverse width') + for b in g: + # Independently multiply just the upper-right block. + block=[[sum(a[i][k]*b[k][j] for k in range(4))%2 for j in (2,3)] for i in (0,1)] + need(gf_rank(block)<=ra+phi(b),'native-width triangle');triangles+=1 + C=eye(4);C=[list(r) for r in C];C[0][2]=1;C=tuple(map(tuple,C)) + F=[list(r) for r in eye(4)];F[0][2]=F[1][3]=1;F=tuple(map(tuple,F)) + K=product(F,inv(C));need(phi(K)==1,'two-bit intrinsic complement') + translations=0 + for l in g: + for r in (eye(4),gens[0],gens[-1]): + start=product(product(l,C),r);finish=product(product(l,F),r) + need(abs(phi(finish)-phi(start))<=1,'matched intrinsic bound');translations+=1 + # Both orientations and all two-bit nonzero rotations are checked as exact operators. + operators=0 + for q in (1,2,3): + for sign in (-1,1): + t=tableau(cgate(2,q,sign),2) + expected=[list(row) for row in eye(4)] + for i in range(2): + for j in range(2):expected[i][2+j]=((q>>i)&1)*((q>>j)&1) + need(t==tuple(map(tuple,expected)),'Gaussian Cq symplectic action');operators+=1 + result=json.loads((Path(__file__).parent/'RESULT.json').read_text()) + c=result['counterexample'];matrix=lambda cols:tuple(tuple((cols[j]>>i)&1 for j in range(18)) for i in range(18)) + native=matrix(c['relative_columns']);translated=matrix(c['translated_relative_columns']) + need(phi(native)==8 and gf_rank([[native[i][j]^int(i==j) for j in range(18)] for i in range(18)])==10,'actual canonical cocycle') + need(phi(translated)==9,'actual translated counterexample') + source=matrix(c['canonical_source_columns']);q=386 + rot=[list(row) for row in eye(18)] + for i in range(9): + for j in range(9):rot[i][9+j]=((q>>i)&1)*((q>>j)&1) + rot=tuple(map(tuple,rot));h=[list(row) for row in eye(18)];h[1],h[10]=h[10],h[1];h=tuple(map(tuple,h)) + full=[list(row) for row in eye(18)] + for i in range(9):full[i][9+i]=1 + full=tuple(map(tuple,full));adapter=product(source,inv(rot)) + need(phi(adapter)==0 and phi(product(product(h,adapter),h))==2,'independent adapter repricing') + need(phi(product(product(h,product(full,inv(rot))),h))==8,'independent intrinsic repair') + + need(result['intrinsic_total_bound']==104*8+104*8+72*9==2312,'old endpoint sum') + need(result['changed_full_Y_endpoint_bound']==104*8+104*9+72*9==2416,'changed endpoint reopening control') + print(f'PASS_INDEPENDENT_PROGRESS: {triangles} Sp4 products; {translations} translations; {operators} exact Gaussian operators') +if __name__=='__main__':main() diff --git a/research/p104-translated-progress/test_verify.py b/research/p104-translated-progress/test_verify.py new file mode 100644 index 000000000..3f76f7743 --- /dev/null +++ b/research/p104-translated-progress/test_verify.py @@ -0,0 +1,64 @@ +"""Scientific and actual-CLI controls; active under optimized Python.""" +import json +import shutil +import subprocess +import sys +import tempfile +import unittest +from pathlib import Path +import verify as v + +class Controls(unittest.TestCase): + def test_native_width_is_not_conjugacy_invariant(self): + c=v.rotation(1,1);h=v.hadamard(1,0);out=v.mul(v.mul(h,c),h) + self.assertEqual(v.phi(c),1);self.assertEqual(v.phi(out),0) + self.assertEqual(v.defect(c),v.defect(out)) + + def test_unmatched_endpoints_can_invalidate_bound(self): + original=v.ident(3);changed=v.full(3) + self.assertEqual(v.defect(original),0) + self.assertEqual(v.phi(changed)-v.phi(original),3) + + def test_even_label_does_not_have_odd_complement_rank(self): + rel=v.mul(v.full(3),v.inverse(v.rotation(3,3))) + self.assertEqual(v.defect(rel),3) + self.assertNotEqual(v.defect(rel),2) + + def test_changed_target_endpoint_changes_progress(self): + q=7;c=v.rotation(3,q);f=v.full(3) + old=v.defect(v.mul(f,v.inverse(c)));new=v.defect(f) + self.assertEqual((old,new),(2,3)) + self.assertEqual(104*8+104*9+72*9,2416) + + def test_nonsymplectic_fault_rejected(self): + bad=list(v.ident(2));bad[0]^=2 + with self.assertRaisesRegex(ValueError,'symplectic matrix'):v.symplectic(tuple(bad)) + + def cli_fault(self,kind): + with tempfile.TemporaryDirectory() as folder: + root=Path(folder);package=root/'research/p104-translated-progress' + shutil.copytree(v.P,package,ignore=shutil.ignore_patterns('__pycache__')) + for row in json.loads((package/'SOURCES.json').read_text())['files']: + if row['usage']=='input': + p=root/row['path'];p.parent.mkdir(parents=True,exist_ok=True);shutil.copyfile(v.ROOT/row['path'],p) + baseline=subprocess.run([sys.executable,'-O','-B',str(package/'verify.py')],cwd=root,capture_output=True,text=True,timeout=40) + self.assertEqual(baseline.returncode,0,kind+' private baseline failed: '+baseline.stderr) + self.assertIn('PASS_P104_TRANSLATED_PROGRESS',baseline.stdout) + result=package/'RESULT.json';result.chmod(0o600);data=json.loads(result.read_text()) + if kind=='boolean':data['schema_version']=True;result.write_text(json.dumps(data)) + elif kind=='float':data['schema_version']=1.0;result.write_text(json.dumps(data)) + elif kind=='false_cap':data['changed_full_Y_endpoint_bound']=2312;result.write_text(json.dumps(data)) + elif kind=='false_adapter':data['counterexample']['translated_entry_adapter_B_rank']=0;result.write_text(json.dumps(data)) + elif kind=='duplicate':result.write_text(result.read_text().replace('"schema_version": 1,','"schema_version": 1, "schema_version": 1,',1)) + elif kind=='missing_source':(root/'research/p104-native-channel/compile.py').unlink() + elif kind=='altered_source': + with (root/'research/p104-native-channel/vendor/clifford_exact.py').open('a') as out:out.write('\nchanged source\n') + run=subprocess.run([sys.executable,'-O','-B',str(package/'verify.py')],cwd=root,capture_output=True,text=True,timeout=40) + self.assertNotEqual(run.returncode,0,kind+' unexpectedly accepted') + self.assertNotIn('PASS_P104_TRANSLATED_PROGRESS',run.stdout) + + def test_actual_optimized_cli_rejects_receipt_and_source_faults(self): + for kind in ('boolean','float','false_cap','false_adapter','duplicate','missing_source','altered_source'): + with self.subTest(kind=kind):self.cli_fault(kind) + +if __name__=='__main__':unittest.main() diff --git a/research/p104-translated-progress/verify.py b/research/p104-translated-progress/verify.py new file mode 100644 index 000000000..6d73986b4 --- /dev/null +++ b/research/p104-translated-progress/verify.py @@ -0,0 +1,183 @@ +#!/usr/bin/env python3 +"""Source-bound symplectic progress audit; unsigned ranks, not phase admission.""" +import argparse +import hashlib +import importlib.util +import itertools +import json +import sys +from pathlib import Path +P=Path(__file__).resolve().parent +ROOT=P.parents[1] + + +def need(ok,message): + if not ok:raise ValueError(message) + + +def read_json(path): + def pairs(items): + out={} + for key,value in items: + need(key not in out,'duplicate JSON key: '+key);out[key]=value + return out + return json.loads(path.read_text(),object_pairs_hook=pairs) + + +def rank(values): + pivots={} + for value in values: + while value: + bit=value.bit_length()-1 + if bit in pivots:value^=pivots[bit] + else:pivots[bit]=value;break + return len(pivots) + + +def apply(cols,value): + out=0 + while value: + bit=(value&-value).bit_length()-1;out^=cols[bit];value^=1<>n)).bit_count()+((y&mask)&(x>>n)).bit_count())&1 + +def symplectic(a): + n=len(a)//2 + need(all(pairing(x,y,n)==(int(i%n==j%n and i//n!=j//n)) for i,x in enumerate(a) for j,y in enumerate(a)),'symplectic matrix') + +def inverse(a): + d=len(a);rows=[sum(((a[j]>>i)&1)<>j&1),None);need(k is not None,'invertible matrix') + rows[j],rows[k]=rows[k],rows[j] + for i in range(d): + if i!=j and rows[i]>>j&1:rows[i]^=rows[j] + return tuple(sum(((rows[i]>>(d+j))&1)<>i&1 else 0 for i in range(n)]) +def full(n):return upper(n,[1<len(rows):selected.append(i);rows.append(row) + need(len(selected)==9,'root pairing dimension') + compressed=[sum(((row>>j)&1)<>j)&1) for i in range(120) for j in range(120)),'14400 physical pairings') + fixture=read_json(ROOT/'research/p104-native-channel/inputs/P104-FIXTURE.json')['section4_explicit_P104'] + removed={tuple(x) for x in fixture['F0']+fixture['C']} + ports=[q for root,q in zip(roots,physical) if root not in removed] + need(len(ports)==104 and ports[0]==386,'P104 physical ports') + return ports,transform + + +def canonical(values): + p={} + for v in values: + while v: + j=v.bit_length()-1 + if j in p:v^=p[j] + else:p[j]=v;break + for j in sorted(p): + for k in p: + if k>j and p[k]>>j&1:p[k]^=p[j] + return tuple(p[j] for j in sorted(p,reverse=True)) + + +def verify(): + binding();ports,transform=physical_labels();n=9;F=full(n);I=ident(n) + intrinsic=[] + for q in ports: + need(q.bit_count()%2==1,'odd physical source') + C=rotation(n,q);K=mul(F,inverse(C));symplectic(K) + need(phi(C)==1 and phi(F)==9 and phi(K)==defect(K)==8,'intrinsic width8') + intrinsic.append({'q':q,'source_progress':phi(F)-phi(C),'target_progress':phi(K),'cocycle_defect':defect(K)}) + need(2*sum(x['cocycle_defect'] for x in intrinsic)+72*defect(F)==2312,'intrinsic bound2312') + # Bind the actual canonical frame convention without importing its generator. + path=ROOT/'research/p104-native-channel/vendor/clifford_exact.py' + spec=importlib.util.spec_from_file_location('p104_progress_native',path);ce=importlib.util.module_from_spec(spec);sys.modules[spec.name]=ce;spec.loader.exec_module(ce) + tocols=lambda op:tuple(x|(z<<9) for x,z,_ in op.tab) + word=read_json(ROOT/'research/p104-native-channel/inputs/LOWRANK-WITNESS.json') + frame=lambda f:canonical(transform(x) for x in f) + cache={} + def chart(f): + f=tuple(f) + if f not in cache:cache[f]=tocols(ce.canonical_frame(9,f));symplectic(cache[f]) + return cache[f] + endpoint_counts={};canonical_pairs={} + for name in word['initial_frames']: + gi=chart(frame(word['initial_frames'][name]));go=chart(frame(word['final_frames'][name]));k=mul(go,inverse(gi)) + key=f'{name[0]}:B{phi(k)}:defect{defect(k)}';endpoint_counts[key]=endpoint_counts.get(key,0)+1 + canonical_pairs[name]=(gi,go) + need(endpoint_counts=={'X:B8:defect10':102,'X:B8:defect8':2,'Y:B8:defect8':104,'Q:B9:defect9':8,'G:B9:defect9':32,'D:B9:defect9':32},'canonical endpoint census') + G=canonical_pairs['X0'][0];H=hadamard(9,1);K=mul(F,inverse(G));translated=mul(mul(H,K),H) + adapter=mul(G,inverse(rotation(n,386)));adapt_trans=mul(mul(H,adapter),H) + intrinsic_trans=mul(mul(H,mul(F,inverse(rotation(n,386)))),H) + need((phi(K),defect(K),phi(translated),phi(adapter),phi(adapt_trans),phi(intrinsic_trans))==(8,10,9,0,2,8),'actual adapter-placement counterexample') + # This whole canonical-word control is a changed schedule, not an admitted supplier. + R=mul(inverse(G),H);actual_progress=0 + for gi,go in canonical_pairs.values():actual_progress+=phi(mul(mul(H,go),R))-phi(mul(mul(H,gi),R)) + histogram={};original_mass=0 + for e in word['program']: + if e[0]=='transport': + rel=mul(chart(frame(e[3])),inverse(chart(frame(e[2]))));need(phi(rel)==e[4],'original native width binding');original_mass+=phi(rel);p=phi(mul(mul(H,rel),H));histogram[p]=histogram.get(p,0)+1 + mass=sum(k*v for k,v in histogram.items()) + need(actual_progress==2066 and mass==2248 and original_mass==2368,'changed canonical control bill') + # An alternating nondegenerate plane in ordinary F2^3: neither basis vector is odd. + v,w=3,6 + proj=[(v if (w>>i)&1 else 0)^(w if (v>>i)&1 else 0) for i in range(3)] + alt=upper(3,proj);symplectic(alt) + need(rank(proj)==phi(alt)==defect(alt)==2,'alternating residual width') + return {'schema_version':1,'claim':'matched intrinsic role-local Clifford translations preserve the2312 progress upper bound', + 'intrinsic_ports':intrinsic,'intrinsic_total_bound':2312,'changed_full_Y_endpoint_bound':104*8+104*9+72*9,'canonical_endpoint_census':endpoint_counts, + 'counterexample':{'register':'X0','q':386,'H_axis':1,'canonical_B_rank':8,'canonical_defect':10,'translated_B_rank':9,'entry_adapter_B_rank':0,'translated_entry_adapter_B_rank':2,'intrinsic_translated_B_rank':8,'canonical_source_columns':list(G),'relative_columns':list(K),'translated_relative_columns':list(translated)}, + 'whole_canonical_control':{'progress':actual_progress,'native_mass':mass,'native_excess':mass-actual_progress,'histogram':{str(k):v for k,v in sorted(histogram.items())},'scope':'conjugated transports only; intrinsic endpoint adapters and side correction must be separately repriced'}, + 'alternating_plane':{'ambient_dimension':3,'basis':[v,w],'projector_columns':proj,'rank':2},'selected_frontier_changed':False} + + +def main(): + ap=argparse.ArgumentParser();ap.add_argument('--write-result',action='store_true');args=ap.parse_args();out=verify() + if args.write_result:(P/'RESULT.json').write_text(json.dumps(out,indent=2)+'\n') + else:need(json.dumps(out,sort_keys=True,separators=(',',':'))==json.dumps(read_json(P/'RESULT.json'),sort_keys=True,separators=(',',':')),'typed result equality') + print('PASS_P104_TRANSLATED_PROGRESS: intrinsic2312; adapter-sensitive canonical counterexample') +if __name__=='__main__':main()