diff --git a/research/p104-phase-uniform-gauge/CERTIFICATE.json b/research/p104-phase-uniform-gauge/CERTIFICATE.json new file mode 100644 index 0000000000..c08d6bc799 --- /dev/null +++ b/research/p104-phase-uniform-gauge/CERTIFICATE.json @@ -0,0 +1,35 @@ +{ + "schema_version": 1, + "z": 420, + "columns": [ + 1, + 2, + 416, + 8, + 16, + 388, + 64, + 292, + 164 + ], + "translation": 430582246074561917307300, + "translation_word": [ + [ + 1, + 1 + ], + [ + 1, + 1 + ], + [ + 430582246074561917307301, + 1 + ], + [ + 430582246074561917307301, + 1 + ] + ], + "bankwise_appended_calls": 146432 +} diff --git a/research/p104-phase-uniform-gauge/PROOF.md b/research/p104-phase-uniform-gauge/PROOF.md new file mode 100644 index 0000000000..fd701d86fe --- /dev/null +++ b/research/p104-phase-uniform-gauge/PROOF.md @@ -0,0 +1,156 @@ +# A phase-uniform gauge with an unavoidable completion tag + +## 1. Scope and conventions + +Use exactly the 104 ordered odd binary labels published by Chris R / Clear1nsight in PR3954 at `f1e2839819959cd0534d008be91ed5b79ec55a6a`, retained in `source/RESULT.json`. The physical isometry and original P104/native construction are predecessor work. This note proves a changed coordinate gauge and its operator boundary; it does not supply the missing adjacent physical producer/consumer pair or admit the predecessor scaffold. + +All binary vectors use the usual dot product. Coordinates are numbered from zero; tensor coordinate `(i,j)` is bit `9i+j`. Write `j=511`, `q(x)=wt(x) mod 4`, and `chi_s(x)=(-1)^(s dot x)`. The scalar field can be Q(i), extended coordinatewise to arbitrary finite arrays. Define + +``` +X_u f(x) = f(x+u), Z_u f(x) = (-1)^(u dot x) f(x), +C_u = ((1+i)I+(1-i)X_u)/2, +F_m = product_(k=0..m-1) C_(e_k), +R_G f(x) = f(G^-1 x). +``` + +Thus `C_u chi_s = i^(u dot s) chi_s` and `F_m chi_s=i^q(s) chi_s`. The latter is the retained full native transform, not the Walsh transform. Orthogonality of G alone does **not** imply that R_G commutes with F_m. Gates `C_u^-1` have the opposite exponent. For an orthogonal G, + +``` +R_G chi_s = chi_(G s), +R_G X_u R_G^-1 = X_(G u), +R_G Z_u R_G^-1 = Z_(G u), +R_G C_u R_G^-1 = C_(G u). +``` + +These are exact ideal operator equations. A coordinate permutation on a large physical tape is not declared free. + +## 2. Explicit gauge: all product-line phases agree + +Let `z=420`, with support `{2,5,7,8}`, and put + +``` +O x = x + (x dot z) z, +O columns = [1,2,416,8,16,388,64,292,164]. +``` + +Because `z dot z=0`, O is involutive. Expanding `(Ox) dot (Oy)` shows orthogonality: the two cross terms cancel and the last term is zero. Since `q(z)=0`, the weight identity `q(x+y)=q(x)+q(y)+2(x dot y) mod4` gives + +``` +q(Ox) = q(x)+2(x dot z) mod4. (1) +``` + +The source-bound finite check verifies `q(Op)=3` on all 104 published labels. Their old weight classes were 56 of class 1 and 48 of class 3. For `K=O tensor O`, the 10,816 transformed product labels obey + +``` +q((Op_i) tensor (Op_j)) = 3*3 = 1 mod4. +``` + +K is orthogonal and bijective, so all these lines remain distinct and nondegenerate; their pairings and dimensions are unchanged. In the predecessor's positive `C_u` orientation, the normalization factor `i^(f wt(u))` is consequently the retained constant `i^(9f)` for every product line and every integer parallel-column count f. This removes the 5,376 gauge-dependent sign mismatches. It does not assert that the historical compiler already uses these coordinates or this orientation. + +## 3. The completion defect is necessary throughout the orthogonal class + +Use one orthogonal binary G in dimension nine identically on both tensor +factors; independent row/column gauges and arbitrary 81-dimensional gauges are +outside this quantified statement. For such G, the difference `q(Gx)-q(x)` is even and has zero polar form. Dividing by two defines a linear character, so there is a unique t with + +``` +q(Gx) = q(x)+2(t dot x) mod4. (2) +``` + +Diagonal products have weight class 1, so any constant product class must be 1. +If all `Gp_i tensor Gp_j` have weight class 1, then all `q(Gp_i)` have the same odd class c, either 1 or 3: a pair of different classes has product 3. The 104 source labels span the full binary nine-space. Equivalently, the equations on these labels determine at most one t for each c. The source-bound linear constraints give exactly + +``` +c=3: t=420; c=1: t=91=420+511. +``` + +An orthogonal G fixes the characteristic vector j, because `x dot x=j dot x` for every x. Substituting x=j in (2) forces `t dot j=0`. The second candidate has odd weight and is impossible. Thus **every** orthogonal gauge making these product phases constant must send the ports to class 3 and have the same nonzero input defect `t=420`. None can preserve F_9. This is a theorem about all orthogonal gauges for these fixed labels, not an enumeration of the orthogonal group or an obstruction to general nonorthogonal/paid intertwiners. + +For a general such G set `K_G=G tensor G` and + +``` +a = z tensor j + j tensor z + = 430582246074561917307300 + = 0x5b2de90b7a4d216f49a4. +``` + +The quadratic difference for K_G is linear after division by two. Evaluating on the 81 basis tensors gives + +``` +q(K_G s) = q(s)+2(a dot s) mod4. (3) +``` + +Indeed `q(Ge_i)=1+2z_i`, so the tensor basis column has weight class `1+2(z_i+z_j)`. This proves (3) on all 2^81 frequencies from orthogonality and 81 coefficient checks. The input character a is universal across this class of G. It is nonzero and even. The general conjugacy is + +``` +R_(K_G)^-1 F_81 R_(K_G) = F_81 X_a, +R_(K_G) F_81 R_(K_G)^-1 = F_81 X_(K_G a). +``` + +Input a and output K_G a need not coincide. No general involution is assumed. For our explicit O, `Oz=z`, `Oj=j`, hence `Ka=a`, and `wt(a)=2*4*5=40`. + +## 4. Exact all-role tags, and the unresolved physical seam + +For the explicit involution K, define + +``` +E_in = R_K, E_out = X_a R_K. +``` + +The preceding equations imply + +``` +F_81 E_in = E_out F_81, +F_81 E_out = E_in F_81. (4) +``` + +Thus the two tags alternate under repeated **already completed uniform** F_81 operations. Two such operations return to the entrance tag. If instead the next operation insists on the original E_in rather than accepting the alternate tag, the seam map is `E_in E_out^-1=X_a`. Omitting it is not an identity; a character with `a dot s=1` is a separating input. + +Apply the same E_in/E_out on every role of an all-role completed call, including all 72 local dirty helper roles (or every role of a declared larger owner inventory). Since (4) is an operator equality on each independently arbitrary function, it holds on their direct sum. Helpers are not assumed zero. Uniform address maps commute with scalar role matrices D,H,E0 and with the predecessor's literal slot permutation Pi; this does not make Pi a free physical move. Encoded helper equations are **not** a fresh physical dirty-return/ownership certificate: any required return to the original coordinate chart still needs its explicit boundary maps. + +Both address encodings act as the identity on constant address functions. +Consequently, a nonzero role-encoding defect already visible on constant +functions cannot be removed by these uniform gauge/translation tags alone; +it still requires a role-boundary transition. This observation does not +independently certify any concurrent package's specific counterexample. + +This does not instantiate PR3954's row/column producer. Define F_row,j as the product of positive C gates on the old standard active basis `e_k tensor p_j`, and F'_row,j on the new standard basis `e_k tensor q_j`, where q_j=Op_j. Define the column transforms analogously using `p_i tensor e_k` and `r_i tensor e_k`, with r_i=Op_i. The row correction is `z tensor q_j`; the column correction is `r_i tensor z`. Conjugate the old bases and apply (1) to the nine coefficient frequencies to obtain + +``` +R_K F_row,j R_K = F'_row,j X_(z tensor q_j), +R_K F_col,i R_K = F'_col,i X_(r_i tensor z). +``` + +These tags vary with the fiber. They must apply to every role in the local call, including its helpers, and reconcile on shared data owners. The alternating common-tag lemma (4) supplies no such physical matching, no free source relocation and no cost-free change of required outputs. That remains the released adjacent-call obligation. + +## 5. A sharp restricted tariff for a forced translation + +Fix one bank and a nonzero even vector b in any binary dimension where such a vector exists. The alphabet is exactly `C_u` and `C_u^-1` for nonzero **odd** u, each charged one call. No other operations, free translation, role mixing, ancilla, measurement or borrowed helper is allowed. Then the exact word length of X_b is four. + +For an upper bound choose e to be any unit vector. Both e and `e+b` are odd, and + +``` +C_e^2 C_(e+b)^2 = X_e X_(e+b) = X_b. +``` + +For the lower bound evaluate any shorter word on frequency j, the all-ones vector. Every allowed u has `u dot j=1`, whereas `b dot j=0`. A word of odd length has an odd exponent sum of plus/minus ones and cannot have phase one. A two-call word with equal signs has phase minus one at j. With opposite signs it is `C_u C_v^-1`; if u differs from v, some frequency separates their parities, giving phase plus/minus i instead of the real phase of X_b. If u=v it is the identity. Length zero is also the identity, while X_b is not. This excludes every length below four. Allowing a constant scalar phase does not help because the zero-frequency eigenvalue fixes that scalar to one. + +The written proof covers arbitrary dimension and even b. The verifier checks the constructive four-call character table; the independent checker exhausts a small three-dimensional alphabet only as corroboration. This is not a native compiler/frame admission or cross-role optimality theorem. For all orthogonal phase-uniform gauges above the tensor output defect K_G a is nonzero and even, so the same restricted theorem applies to any seam that is implemented in this exact alphabet. + +## 6. Complete cost decision and stopping rule + +Orthogonal K changes neither dimensions/ranks, the 36,608-role inventory, 208 local calls nor the predecessor's stipulated mass 2,576 and net progress 2,312 per call. Grant all gauge and tag work free and keep the same favorable contract. Re-derive the named gate: + +``` +W = 2*104^2+2*104*72 = 36608, m=81, N=104^2=10816, +required persistent progress = mW-N = 2954432, +remaining rank >= 2954432-208*2312 = 2473536, +lower paid mass = 208*2576+2473536 = 3009344, +capacity = 2965248, excess = 44096. +``` + +These are inherited conditional hypotheses, not freshly admitted local/native calls or global owners. At `0<=saving<1`, each child of rank r<=81 has moment term at least r/81. The unchanged positive mass gap therefore still rejects this scaffold. Finite fully paid auxiliary banks preserve the numerator gap. Phase homogenization cannot by itself remove a recursive child. + +If one **chooses** an appended isolated correction on every completed bank in the restricted alphabet of section 5, its extra primitive-word bill is `4W=146432` calls. **Only if each isolated C primitive is additionally admitted at one rank unit in this same ledger** does that literal route have excess `190528`, before physical wrappers. Word length alone does not establish that native tariff compatibility. This is a conditional literal-route calculation, not a lower bound on arbitrary fusion, mixed roles, different encodings or different coverage. It is not a complete upper bound on implementation time: R_K routing, chart/phase wrappers, source acquisition, dirty returns, ownership/holding/control/tapes, finite widths/precision/recovery and inherited all-size/compiler/analytic obligations remain unknown or inherited, never zero. + +**NARROW / STOP.** Preserve the explicit phase-uniform gauge, its unavoidable completion character and exact restricted seam tariff. Do not expand native implementation for the unchanged failed scaffold. A genuinely changed adjacent-call contract with reconciled fiber/helper tags, actual owners and a favorable complete replacement invoice is the next meaningful task. diff --git a/research/p104-phase-uniform-gauge/README.md b/research/p104-phase-uniform-gauge/README.md new file mode 100644 index 0000000000..2b221d7724 --- /dev/null +++ b/research/p104-phase-uniform-gauge/README.md @@ -0,0 +1,131 @@ +# P104 phase-uniform gauge and forced completion tag + +**Scoped ideal-operator result; no new supplier or kappa.** For the 104 binary +labels published in [PR3954](https://github.com/CrocSwap/integer-mult-bounds/pull/3954) +at `f1e2839819959cd0534d008be91ed5b79ec55a6a`, the explicit orthogonal involution + +``` +z=420, O x=x+(x dot z)z, +O columns=[1,2,416,8,16,388,64,292,164] +``` + +sends every label to weight 3 modulo 4. All 10,816 tensor product lines then have +weight 1 modulo 4: the predecessor's 5,376 gauge-dependent normalization +mismatches disappear. This answers one coordinate-gauge question left open by +PR3954, without claiming to complete its physical caller. + +## What is proved + +[PROOF.md](PROOF.md) gives the arbitrary-dimension/operator arguments and the +source-bound finite premises. Every orthogonal nine-dimensional gauge applied identically to both tensor +factors and making these product phases constant has the **same nonzero input quadratic defect** +`z=420`. The alternative character `91` would violate preservation of the +all-ones characteristic vector. This class cannot preserve the standard full +native transform F; the result is not an enumeration of the orthogonal group. + +For the explicit involution `K=O tensor O`, the completion translation is + +``` +a=z tensor 511 + 511 tensor z + =430582246074561917307300, wt(a)=40, Ka=a. +``` + +With `R_K f(x)=f(K^-1 x)`, exact uniform completed-F encodings are +`E_in=R_K` and `E_out=X_a R_K`, with +`F E_in=E_out F` and `F E_out=E_in F`. These identities hold on independently +arbitrary functions in all 280 local roles, including 72 dirty helpers. They do +not assume zero helper input. General non-involutive gauges distinguish the +input defect a from its output image K_G a. + +If a consumer forces a return to the original tag, its translation has exact +minimum length four in the **restricted one-bank alphabet** of odd-line +`C_u` and `C_u^-1`, one call each. The proof allows no other gates, role mixing, +ancillas or free translations. This is a word tariff, not native compiler, +rank-unit or cross-role optimality admission. + +The inherited favorable 81-dimensional scaffold still has lower mass +3,009,344 versus capacity 2,965,248: **excess 44,096 even when all new gauge and +tag work is free**. A chosen isolated correction on all 36,608 banks adds +146,432 primitive calls. Its excess would be 190,528 only if those primitives +were additionally admitted at one rank unit each in the same ledger. No such +admission is inferred here. Stop expansion of this unchanged scaffold. + +## Evidence and reproduction + +The only live scientific inputs are the three package-local source exports in +`source/`, pinned by origin commit, Git blob and SHA256 in [SOURCES.json](SOURCES.json). +Both checkers independently hardcode/authenticate the hashes. No predecessor +executable or unmerged foreign Git object is needed to replay this package. +The selected record/catalogue are historical base-commit provenance only. + +From the repository root, with Python 3.12 and its standard library: + +```sh +python3.12 -B scripts/research_package.py --package research/p104-phase-uniform-gauge --check-only +python3.12 -B scripts/research_package.py --package research/p104-phase-uniform-gauge +``` + +For a Git-free directory copy of this package, run `verify.py`, `independent.py` +and `test_verify.py` directly, with `-B`; repeat with `-O -B` to check assertion +independence. Explicit exceptions, rather than Python assertions, enforce the +scientific checks. The registered commands are in [VERIFY.json](VERIFY.json). + +`verify.py` checks 104 labels, 10,816 product lines, 512 possible defect +characters, 81 tensor coefficients and 22,680 role/basis conditions. Polarization +extends those coefficient checks to all frequencies; no enumeration of 2^81 +addresses is claimed. The separate checker uses binary RREF and 262,144 dot +pairs, checks a non-involutive gauge convention, and corroborates the operator +identities with four-bit literal matrices. Those small complex-matrix entries +and bounded fixtures are exactly representable dyadics; no numerical tolerance +accepts an equality. Its 585 three-bit words corroborate the written universal +four-call lower bound. `test_verify.py` runs 60 primary API/CLI rejection cases +and eight independent damaged-source rejections across normal/optimized Python, +plus a read-only Git-free positive fixture. These finite checks accompany the +written proofs; they are not a proof-assistant or full multiplication audit. + +The source's isometry/full verifier, native-channel and selected cold replay +are not rerun. The theorem binds to the explicitly retained published labels +and conventions, without re-admitting the predecessor's physical hypotheses. + +## Open next questions + +The structured questions and blockers are in [TASK.json](TASK.json). This is a +**changed-scope** follow-up to the released PR3954 gauge question, not completion +of the catalogue's chronological correction program or the latest handoff's +missing adjacent physical producer/consumer pair. + +Concurrent PR3961 studies the physical cross-axis encoding mismatch; PR3962 +studies whole-fiber coverage and helper sharing. Their refreshed PR bodies +identify distinct contracts; this package does not claim to replay them or +remove those obstructions by changing address coordinates. + +The consequential next step is one actual adjacent row/column pair: write its +all-role entrance, intermediate and exit encodings at a named chronological +cut, and reconcile the fiber-dependent tags `z tensor q_j` and `r_i tensor z` +on shared data and helper owners. The uniform completed-F lemma does not do +that. First require a changed complete invoice that clears the 44,096 deficit; +do not expand the rejected scaffold merely because its phase mismatch is fixed. + +A physically viable changed contract would still need actual source frames, +R_K routing, native/binary-hyperplane orientation and global phase, compatible +tariffs, finite-width/signed-floor precision and recovery, physical dirty +return, owners/holding/control/tapes, opposite orientation, all-size transfer +and complete supplier admission. These obligations remain unknown or inherited. + +## Credit and license + +Chris R / Clear1nsight's PR3954 owns the retained P104 labels, two-axis setup, +operator conventions and conditional scaffold gate, following PR3882/3940/3943. +Retain the source README/PROOF attribution: 1337isnot1337 PR3894; Rohan Arun +PR1972; Chafik Boukhalfa PR1991; Adam Gall PR1940; Josie Elliston PR1071/E8; +Aurel Prosz/Paureel, Zhihao Chen, Dominik Scholz, icekylinx, Sagar Thakrar PR1012, +Douglas Colkitt, Jose Manuel and Vasek PR2744, plus the retained native, +compiler, coverage, terminal-floor and caller lineage. PR3943 owns its +960-addition adapter; this package does not reassign that construction. + +The new explicit gauge, orthogonal-class character obstruction, completed-F +boundary and restricted translation tariff are by ToikY with substantial +OpenAI Codex assistance. Separate AI contexts implemented/reviewed the proof +checks and failure controls; this is not independent human or kernel review. +New work and retained source exports are under the repository's Apache-2.0 +license. No merge or selected-frontier change is requested. diff --git a/research/p104-phase-uniform-gauge/SOURCES.json b/research/p104-phase-uniform-gauge/SOURCES.json new file mode 100644 index 0000000000..28ab046b32 --- /dev/null +++ b/research/p104-phase-uniform-gauge/SOURCES.json @@ -0,0 +1,48 @@ +{ + "schema_version": 1, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ], + "source_exports": [ + { + "path": "research/p104-phase-uniform-gauge/source/README.md", + "origin_repository": "Clear1nsight/integer-mult-bounds", + "origin_commit": "f1e2839819959cd0534d008be91ed5b79ec55a6a", + "origin_path": "research/p104-two-axis-compatibility/README.md", + "git_blob": "c722f200b5086b4bd0059e7d0087f9e0f3a1f8ac", + "sha256": "d13777b9065d4d575cbc0e41293b454f15ad0455d5047bb36c6b1ed527ff48e0", + "usage": "package-local byte-exact source export; authenticated independently in both checkers" + }, + { + "path": "research/p104-phase-uniform-gauge/source/PROOF.md", + "origin_repository": "Clear1nsight/integer-mult-bounds", + "origin_commit": "f1e2839819959cd0534d008be91ed5b79ec55a6a", + "origin_path": "research/p104-two-axis-compatibility/PROOF.md", + "git_blob": "1d84b2a1188eab6a5c38743cc1eed32d66446a3d", + "sha256": "bdc7d868e4411541a33179af683f48011e66d6446a45bef363f3f3dd5163f717", + "usage": "package-local byte-exact source export; authenticated independently in both checkers" + }, + { + "path": "research/p104-phase-uniform-gauge/source/RESULT.json", + "origin_repository": "Clear1nsight/integer-mult-bounds", + "origin_commit": "f1e2839819959cd0534d008be91ed5b79ec55a6a", + "origin_path": "research/p104-two-axis-compatibility/RESULT.json", + "git_blob": "c7ed0ea02e8c462694762508b0bdd1dde2e116d0", + "sha256": "ce05a27ebc98677bec4febaa488fa03f5b6fc60216aa43b34298444d12f7ab6c", + "usage": "package-local byte-exact source export; authenticated independently in both checkers" + } + ], + "source_export_contract": "Pending foreign head is not a Git-history dependency. The three exact source exports are committed inside this package; both standalone checkers hardcode and verify their SHA256 values. No predecessor executable is imported. Generic source-history validation covers the base provenance rows, not foreign origin availability or the scientific claims of those sources." +} diff --git a/research/p104-phase-uniform-gauge/TASK.json b/research/p104-phase-uniform-gauge/TASK.json new file mode 100644 index 0000000000..f92de933d0 --- /dev/null +++ b/research/p104-phase-uniform-gauge/TASK.json @@ -0,0 +1,111 @@ +{ + "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": "A phase-uniform orthogonal gauge for the 104 published P104 labels, a universal nonzero completion-character obstruction, all-role completed-F tags and a sharp four-call translation tariff in a restricted ideal alphabet; retain the rejected scaffold gate.", + "scope_change_reason": "Handoff-first follow-up to PR3954 final head: test its explicitly open coordinate-gauge limitation. This is a partial gauge/boundary lemma, not the original card's chronological physical correction program or the latest handoff's missing adjacent physical producer/consumer pair.", + "bottleneck_link": "Separates gauge-dependent phase mismatches from the unavoidable completed-transform correction, while the favorable unchanged full bill remains negative. No new native construction follows without a changed caller contract and budget.", + "budget_minutes": 60, + "stop_rule": "One explicit transvection and the universal character argument only. Stop native expansion when the complete favorable scaffold invoice remains above capacity; final 15 minutes reserved for verification and handoff.", + "outcome": "partial", + "evidence": "PROOF.md sections 2-5 prove the stated gauge, orthogonal-class obstruction, arbitrary-input boundary and restricted tariff. verify.py authenticates three source exports and checks exact binary characters; independent.py uses separate RREF/bit representations and small literal matrices; test_verify.py supplies semantic and damaged-input controls. No full predecessor, native-channel, selected cold, human or kernel replay is claimed.", + "author": "ToikY", + "ai_assistance": "Substantial OpenAI Codex assistance in proof, implementation, testing and separate AI math/test review contexts; not independent human or proof-assistant review.", + "selection": { + "method": "latest-handoff-first, then named catalogue provenance; no fresh random task selection", + "handoff": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19034066", + "claim": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19034226", + "entry_open_pr_bodies_including_drafts": 662, + "coverage_limit": "Open PR bodies and targeted all-state gauge search checked; broader Discussions, closed diffs and unmentioned work only partially covered.", + "pre_submission": { + "checked_at_utc": "2026-10-19T07:13:36Z", + "canonical_fetch": "git fetch --no-tags https://github.com/CrocSwap/integer-mult-bounds.git main; FETCH_HEAD pinned immediately", + "main": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "priority_revision": 6, + "decision": "continue bounded gauge lemma; main/source pin unchanged. New PR3961 addresses physical cross-axis encoding mismatch and PR3962 whole-fiber coverage/helper-sharing, distinct from this gauge/character theorem. Their bodies were read; their proofs and executables were not independently replayed.", + "open_pr_bodies_including_drafts": 665, + "relevant_head_3954": "f1e2839819959cd0534d008be91ed5b79ec55a6a", + "coverage_limit": "All seven open-PR REST pages and current repository overlap helper; live #1166 read. Broader Discussion and closed-diff coverage partial." + } + }, + "open_questions": [ + { + "question": "Can one actual adjacent physical row/column producer and consumer accept the fiber-dependent gauge tags on every shared data and dirty-helper owner?", + "why_it_matters": "The uniform full-F boundary lemma does not provide the missing physical caller or remove a paid side correction.", + "first_step": "Pin one chronological cut in PR3954; write the injective all-role entrance, intermediate and exit encodings using the explicit row tag z tensor q_j and column tag r_i tensor z, then check an arbitrary-input identity.", + "blocked_by": "Shared-owner/helper tag reconciliation, physical frame availability and a changed complete invoice that first clears the inherited 44096 deficit. Do not expand the unchanged failed scaffold." + }, + { + "question": "Is the gauge or its forced translation admitted in the actual binary-hyperplane compiler, with global phase and a compatible tariff?", + "why_it_matters": "A four-call word in the restricted ideal C alphabet is not a native rank-unit or time bound.", + "first_step": "Only after a changed caller clears the family budget gate, specify one physically available C_u primitive and its orientation, rank tariff, finite-width chart and dirty-return contract.", + "blocked_by": "No such physical primitive or caller is constructed here; routing, precision, owners, opposite orientation and all-size transfer remain open." + } + ] +} diff --git a/research/p104-phase-uniform-gauge/VERIFY.json b/research/p104-phase-uniform-gauge/VERIFY.json new file mode 100644 index 0000000000..02db670bb2 --- /dev/null +++ b/research/p104-phase-uniform-gauge/VERIFY.json @@ -0,0 +1,36 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 60, + "checks": "Authenticated source labels, phase-uniform gauge, unique characters, tensor completion, all-role tags, constructive translation and conditional complete gate" + }, + { + "argv": [ + "{python}", + "-B", + "{package}/independent.py" + ], + "timeout_seconds": 60, + "checks": "Separate RREF, full nine-bit orthogonality, product lines, non-involutive conjugation convention, exact-dyadic small operator matrices and three-bit short-word corroboration" + }, + { + "argv": [ + "{python}", + "-B", + "{package}/test_verify.py" + ], + "timeout_seconds": 60, + "checks": "11 API and 19 CLI negative cases under normal and optimized Python, eight independent source controls and read-only Git-free positive replay" + } + ] +} diff --git a/research/p104-phase-uniform-gauge/independent.py b/research/p104-phase-uniform-gauge/independent.py new file mode 100644 index 0000000000..8940e9fdac --- /dev/null +++ b/research/p104-phase-uniform-gauge/independent.py @@ -0,0 +1,240 @@ +#!/usr/bin/env python3 +"""Separate binary elimination and literal small-matrix gauge checks. + +Apache-2.0. ToikY with substantial OpenAI Codex assistance. This checker +imports no primary or predecessor executable and is not human/native review. +""" +from __future__ import annotations + +import hashlib +import itertools +import json +from pathlib import Path + +HERE = Path(__file__).resolve().parent +SOURCE_PINS = { + "RESULT.json": "ce05a27ebc98677bec4febaa488fa03f5b6fc60216aa43b34298444d12f7ab6c", + "README.md": "d13777b9065d4d575cbc0e41293b454f15ad0455d5047bb36c6b1ed527ff48e0", + "PROOF.md": "bdc7d868e4411541a33179af683f48011e66d6446a45bef363f3f3dd5163f717", +} + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def weight(value): + return bin(value).count("1") + + +def dot(left, right): + return weight(left & right) % 2 + + +def authenticated_result(): + for name, pin in SOURCE_PINS.items(): + raw = (HERE / "source" / name).read_bytes() + require(hashlib.sha256(raw).hexdigest() == pin, "independent source: " + name) + return json.loads((HERE / "source" / "RESULT.json").read_bytes()) + + +def solve_character(labels, desired_weight): + """RREF of the 104 equations, rather than enumeration of orthogonal maps.""" + equations = [[p, ((desired_weight - weight(p)) // 2) % 2] for p in labels] + rank, pivots = 0, [] + for column in range(9): + choice = next((r for r in range(rank, len(equations)) + if equations[r][0] & (1 << column)), None) + if choice is None: + continue + equations[rank], equations[choice] = equations[choice], equations[rank] + for r in range(len(equations)): + if r != rank and equations[r][0] & (1 << column): + equations[r][0] ^= equations[rank][0] + equations[r][1] ^= equations[rank][1] + pivots.append(column) + rank += 1 + require(all(mask or not rhs for mask, rhs in equations), "consistent gauge character") + require(rank == 9, "published labels must span all nine coordinates") + solution = sum(equations[r][1] << column for r, column in enumerate(pivots)) + require(all((weight(p) + 2*dot(p, solution)) % 4 == desired_weight for p in labels), + "solved phase character") + return solution, rank + + +def apply_columns(columns, value): + output = 0 + for index, column in enumerate(columns): + if value & (1 << index): + output ^= column + return output + + +def tensor(left, right): + result = 0 + for i in range(9): + for j in range(9): + if left & (1 << i) and right & (1 << j): + result |= 1 << (9*i+j) + return result + + +def multiply(left, right): + return [[sum(x*y for x, y in zip(row, column)) for column in zip(*right)] + for row in left] + + +def permutation(size, index): + return [[int(j == index(i)) for j in range(size)] for i in range(size)] + + +def small_literal_matrices(): + """Four-bit address matrices, including the necessary full-F defect.""" + size, selected = 16, 15 + mapping = lambda x: x ^ (selected if dot(x, selected) else 0) + relabel = permutation(size, mapping) + translation = permutation(size, lambda x: x ^ selected) + alpha, beta = (1+1j)/2, (1-1j)/2 + full = [[alpha**(4-weight(x ^ y))*beta**weight(x ^ y) + for y in range(size)] for x in range(size)] + transformed = multiply(multiply(relabel, full), relabel) + require(transformed == multiply(full, translation), "literal F conjugation") + require(transformed != full, "gauge is not a free F-preserving relabel") + exit_encoding = multiply(translation, relabel) + require(multiply(full, relabel) == multiply(exit_encoding, full), "all-role entry/exit tags") + require(multiply(full, exit_encoding) == multiply(relabel, full), "alternating completed-F tags") + covariance = 0 + for u in range(size): + modulation = [[int(x == y) * (-1)**dot(x, u) for y in range(size)] + for x in range(size)] + wanted_modulation = [[int(x == y) * (-1)**dot(x, mapping(u)) for y in range(size)] + for x in range(size)] + require(multiply(multiply(relabel, modulation), relabel) == wanted_modulation, + "literal Z covariance") + if weight(u) % 2: + primitive = [[alpha*int(x == y)+beta*int(y == (x ^ u)) + for y in range(size)] for x in range(size)] + wanted = [[alpha*int(x == y)+beta*int(y == (x ^ mapping(u))) + for y in range(size)] for x in range(size)] + require(multiply(multiply(relabel, primitive), relabel) == wanted, + "literal rank-one C covariance") + covariance += 1 + # Every local role gets the same tag, including 72 nonzero independent dirty fixtures. + left_operator = multiply(full, relabel) + right_operator = multiply(exit_encoding, full) + for role in range(280): + payload = [complex((role+3)*(x+1), (role+1)*(3*x-7)) for x in range(size)] + left = [sum(a*b for a, b in zip(row, payload)) for row in left_operator] + right = [sum(a*b for a, b in zip(row, payload)) for row in right_operator] + require(left == right, "arbitrary nonzero data/helper fixture") + return covariance + + +def short_translation_words(): + """Finite three-bit corroboration; the universal lower bound is written.""" + labels = [u for u in range(8) if weight(u) % 2] + gates = [tuple(sign*dot(s, u) % 4 for s in range(8)) + for u in labels for sign in (-1, 1)] + targets = {a: tuple(2*dot(s, a) for s in range(8)) + for a in range(1, 8) if weight(a) % 2 == 0} + checked = 0 + for length in range(4): + for word in itertools.product(gates, repeat=length): + phase = tuple(sum(gate[s] for gate in word) % 4 for s in range(8)) + require(phase not in targets.values(), "translation shorter than four") + checked += 1 + for a, target in targets.items(): + first, second = 1, 1 ^ a + require(weight(first) % 2 == weight(second) % 2 == 1, "four-call odd labels") + phase = tuple((2*dot(s, first)+2*dot(s, second)) % 4 for s in range(8)) + require(phase == target, "four-call translation attainment") + return checked, len(targets) + + +def main(): + source = authenticated_result() + labels = source["physical_labels"] + require(len(set(labels)) == 104 and all(type(p) is int and 0 < p < 512 + and weight(p) % 2 for p in labels), "source label domain") + character, rank = solve_character(labels, 3) + forbidden, _ = solve_character(labels, 1) + require(character == 420 and forbidden == 91 and forbidden == (character ^ 511), + "unique phase-uniform characters") + require(weight(character) % 2 == 0 and weight(forbidden) % 2 == 1, + "orthogonal characteristic-vector exclusion") + columns = [1, 2, 416, 8, 16, 388, 64, 292, 164] + transform = lambda value: apply_columns(columns, value) + require(transform(511) == 511 and transform(character) == character, "fixed characteristic data") + for x in range(512): + require(transform(transform(x)) == x, "independent involution") + require((weight(transform(x))-weight(x)-2*dot(x, character)) % 4 == 0, + "independent quadratic refinement") + for y in range(512): + require(dot(transform(x), transform(y)) == dot(x, y), "independent orthogonality") + # Exhaustive one-axis Fourier equality, not the predecessor's 512 port-phase census. + for frequency in range(512): + require((weight(transform(frequency))-weight(frequency)) % 4 + == 2*dot(character, frequency), "Fourier full-F translation defect") + # A coordinate permutation after O leaves the input character unchanged but + # changes its output image. This detects inverse/conjugation convention errors. + def swap_zero_two(value): + return value ^ (5 if ((value >> 0) ^ (value >> 2)) & 1 else 0) + general = lambda value: swap_zero_two(transform(value)) + general_inverse = lambda value: transform(swap_zero_two(value)) + output_character = general(character) + require(output_character == 417 and output_character != character, + "non-involutive gauge output character") + require(any(general(general(value)) != value for value in range(512)), + "general-gauge convention control is not involutive") + for frequency in range(512): + require(general_inverse(general(frequency)) == frequency, "general inverse convention") + require((weight(general(frequency))-weight(frequency)) % 4 + == 2*dot(character, frequency), "general input character") + require((weight(general_inverse(frequency))-weight(frequency)) % 4 + == 2*dot(output_character, frequency), "general output character") + require((weight(general(frequency))-weight(frequency)) % 4 + == 2*dot(output_character, general(frequency)), "general matched exit tag") + changed = [transform(p) for p in labels] + require(all(weight(p) % 4 == 3 for p in changed), "phase-uniform root gauge") + product_checks = 0 + for old_left, new_left in zip(labels, changed): + for old_right, new_right in zip(labels, changed): + require(weight(tensor(new_left, new_right)) % 4 == 1, "uniform product phase") + require(dot(old_left, old_right) == dot(new_left, new_right), "port pairing preservation") + product_checks += 1 + tensor_columns = [tensor(columns[i], columns[j]) for i in range(9) for j in range(9)] + tensor_map = lambda value: apply_columns(tensor_columns, value) + correction = tensor(character, 511) ^ tensor(511, character) + by_quadratic_columns = sum(((weight(column)-1)//2 % 2) << index + for index, column in enumerate(tensor_columns)) + require(correction == by_quadratic_columns == 430582246074561917307300, + "universal tensor input character") + require(weight(correction) == 40 and tensor_map(correction) == correction, + "explicit tensor output character") + # Basis and two-basis sums corroborate the written polarization argument in dimension81. + for i in range(81): + for j in range(i, 81): + value = (1 << i) if i == j else (1 << i) | (1 << j) + require((weight(tensor_map(value))-weight(value)-2*dot(value, correction)) % 4 == 0, + "tensor quadratic identity") + covariance = small_literal_matrices() + short_words, targets = short_translation_words() + gate = source["gate"] + roles = 2*104**2 + 2*104*72 + capacity = 81*roles + required = capacity-104**2 + bill = 208*2576 + required-208*2312 + require((roles, capacity, bill, bill-capacity) == (36608, 2965248, 3009344, 44096), + "unchanged favorable budget") + require(gate["W"] == roles and gate["lower_mass"] == bill and gate["excess"] == 44096, + "predecessor gate binding") + print("PASS_INDEPENDENT_PHASE_UNIFORM_GAUGE", "label_rank="+str(rank), + "orthogonality_pairs=262144", "product_lines="+str(product_checks), + "literal_covariance_labels="+str(covariance), "all_role_fixtures=280", + "short_words="+str(short_words), "even_targets="+str(targets), + "unchanged_excess=44096", "no_new_kappa") + + +if __name__ == "__main__": + main() diff --git a/research/p104-phase-uniform-gauge/source/PROOF.md b/research/p104-phase-uniform-gauge/source/PROOF.md new file mode 100644 index 0000000000..1d84b2a118 --- /dev/null +++ b/research/p104-phase-uniform-gauge/source/PROOF.md @@ -0,0 +1,271 @@ +# Physical two-axis compatibility and the named cost gate + +## 1. Scope and source meanings + +This is a boundary theorem and conditional rejection for one explicitly described +two-axis P104 scaffold. It is not an embedding of P104 into the existing h=28 +mixed-center producer, not a new native compiler replay, and not a supplier. +The retained caller in notes/copied-centers-complex.tex supplies the physical +two-stage equations and separately paid endpoint correction. PR3882/3940 +supply the residual representation. PR3943 supplies a distinct actual internal +cleanup consumer; no new claim is made for that cleanup or the shared +192-transport return floor. + +All operators below act on arbitrary Gaussian-dyadic address functions. The +physical statements are ideal exact identities; signed-floor, finite-width and +recursive admission do not follow from them. + +Order the 104 ports as J followed by N, where +J=(0,1,3,6,22,31,93,103). Let B=A[J,N] for A=G/2. The pinned roots give +A[J,J]=I, A[N,N]=B^t B and BB^t=12I. Put +``` +D = [ I B ] H = diag(0_8,I_96) + [ B^t B^t B - I ] + +D^-1 = [ -11 I B ] + [ B^t -I ]. +``` +Multiplication proves the inverse. With w=u+y, PR3882's residual vector is +r=(q,v_N)=D u+H w. Thus the common-chart encoding and its inverse are +``` +E0 = [D H; 0 I], E0^-1 = [D^-1 -D^-1 H; 0 I]. +``` +Extend every compatibility map by identity on the 72 arbitrary dirty roles. +This extension preserves all their information; it does not supply the +unexecuted physical native return of a completed global caller. + +The ordered (r,w) notation is not the literal register occupancy. PR3882 +places r_J in X_J and r_N in Y_N, and w_J in Y_J and w_N in X_N. Put +J0=I-H and Pi=[[J0,H],[H,J0]]. Pi swaps the two slots exactly at the 96 N +ports; Pi^-1=Pi. The literal slot encoding is Pi E0, not E0. Pi is an +explicit bookkeeping permutation in the equations below, NOT a free physical +move or a proved compatible owner reassignment. Its realization, chart +alignment and fixed return locations belong in the complete boundary bill. + +## 2. Logical inverse shear and the physical caller + +The original inverse shear R=[I -I;0 I] on (u,w) has encoded form +``` +R_encoded = E0 R E0^-1 = [I -D;0 I]. +``` +Hence an encoded source may be carried by the exact update r <- r-Dw, with +w unchanged. D has 5,000 nonzero entries: eight unit diagonal entries and +4,992 signed half entries. A direct common-FULL-chart implementation applies +the eight unit terms, halves all 104 temporarily writable w donors once, +performs the 4,992 signed unit updates, and doubles all w back. This is +5,000 unit array ADD/SUBs plus 104 halves and 104 restoring doubles. It is +a constructive common-chart scalar invoice, not a scalar optimum and not a +physical implementation with free chart/owner changes. It is not the +source-preserving 1,736-ADD fused schedule of PR3940. + +For each physical data pair use a nondegenerate tensor line U=P tensor Q, +T=C_U, F=C_I, and E=F T^-1. Let bold T be the diagonal family over the ports. +For the proposed P104 ports we explicitly choose T=C_u with the positive +rank-one operator formula in section 3, and define E=F T^-1. This specifies +the physical operators rather than assuming every ambient-projector or +historical chart orientation has the same phase. Any orientation/monomial +adjustment needed to embed these choices into a producer belongs in the +additional boundary bill; no free identification with the h=28 producer is +asserted. A different orientation must rebind the finite phase census. +The retained caller has source charts (T,I) and terminal charts (F,E). +Writing u=T^-1 x, its two stages are exactly +``` +(A,B) = diag(F,E) R S diag(T^-1,I) (x,y) + = (-F y, F T^-2 x + E y), +S=[I 0;I I]. +``` +This is the actual retained endpoint equation, not merely the scalar +(-y,x+y) equation. The paid correction is +P=[I 0;T^-1 I], so P(A,B)=(A,F T^-2 x). + +In ordered (r,w) coordinates at the terminal charts the encoding is not E0. Conjugating by +G=diag(F,E) gives the physical encoding +``` +L_T = G E0 G^-1 = [D H T;0 I]. +``` +F is common and commutes with the rank-one C_U operators; H is diagonal +and commutes with T. D need not commute with T. +In the literal register order the physical encoding is A_T=Pi L_T. + +To preserve this explicitly fixed physical encoding on both sides of the +paid correction, the exact operator is +``` +P_encoded = L_T P L_T^-1 + = [ I+H D^-1 -H D^-1 H T ] + [ T^-1 D^-1 I-T^-1 D^-1 H T ]. +``` +Equivalently, delta=D^-1(r-H T B), followed by +r'=r+H delta and B'=B+T^-1 delta. This is an operator identity with the +displayed order; it grants neither matrix reads nor chart transport for free. +Its r-to-r increment H D^-1 has rational rank 96, or 96 times the address-space +dimension on arrays. That is an information/linear-map rank, NOT a lower bound +of 96 native tariff units. + +The correction in literal slots is therefore +P_literal_encoded=Pi P_encoded Pi, rather than P_encoded alone. Keeping the +permutation symbolic exposes the required ownership/return obligation without +silently donating moves between the actual X/Y banks. + +Applying the old correction unchanged to encoded fields is wrong: +``` +P L_T - L_T P = [-H 0] + [T^-1(D-I) H]. +``` +For B=0 and A a nonzero N-port input, the first-bank error is -A. +This counterexample survives even homogeneous T. A corrected physical caller +must implement the conjugated correction, choose a different explicitly +intertwined output encoding, or decode. None is priced as zero. + +There is also a direct literal-slot counterexample, without granting a gather: +with K=T^-1, +``` +P A_T - A_T P = [-H K 0] + [K J0(D-I)-H K H]. +``` +The first-bank defect on an N-port A input is -K A, again nonzero and of +rank 96 times the address dimension. The separate noncommutative checker +verifies Pi^2=I, both literal-slot identities and the ordered-coordinate +identities. No rank here is identified with a native conversion tariff. + +After the correction, the retained phase/sign/exchange wrappers finish the +unencoded caller. In the fixed literal A_T contract they must be preceded by +A_T^-1=L_T^-1 Pi (or by L_T^-1 after a separately realized ordered gather), +or replaced jointly by a proved and priced encoded endpoint. This study does +not assert that every possible co-designed final encoding must decode there. + +## 3. Explicit two-axis physical lines and a noncommuting read + +Independently reconstruct the doubled E8 roots, the rank-nine binary pairing +and an explicit orthonormal isometry. Check all 120^2 pairings, then remove the +two pinned frames to obtain 104 odd distinct physical labels p_i in F2^9. +The receipt records the complete isometry and ordered labels. This is an +explicit coordinate gauge; it need not spell the historical compiler's gauge. + +For the proposed replacement scaffold take V=F2^9 tensor F2^9, m=81, and +U_ij=span(p_i tensor p_j). All 10,816 lines are distinct and nondegenerate. +For a fixed Q=p_j the first-stage active space is F2^9 tensor Q; the +second-stage active space is P tensor F2^9. This supplies actual binary +subspaces for the boundary calculation, not the chronological global owner +map or the old triple-center producer. Opposite-orientation P104 execution +in this scaffold is deliberately granted only as a favorable cost hypothesis. + +The native-boundary proof pins +C_u=((1+i)I+(1-i)X_u)/2. Consequently +``` +C_u^-1-C_v^-1 = (1+i)(X_u-X_v)/2. +``` +For distinct nonzero binary u,v, X_u-X_v has rank 2^(m-1), since exactly +half the Fourier characters separate their parities. A nonzero B entry +therefore cannot move unchanged through the port-dependent T^-1 family: +[D,T^-1]_ij=D_ij(T_j^-1-T_i^-1) is nonzero. + +The receipt gives original ports 0 and 2 as one explicit half-coefficient +edge, along with their physical labels, tensor vectors and a separating +frequency. On the four-address span {0,u,v,u+v}, a 4-delta input produces +opposite nonzero Gaussian values +(1+i) and -(1+i), up to the sign of B. +The separate checker reconstructs the literal four-address translation +matrices and their rank two difference. + +For a fixed nonzero Q, contraction of an 81-bit Fourier character with Q +ranges over all 512 vectors in F2^9, each equally often. The complete +512-pattern check finds that D commutes with T^-1 only for the homogeneous +patterns z=0 and z=511; the other 510 fail. This is exact for this finite +P104 encoding and gauge. It is not a no-intertwiner theorem for changed +encodings, paid cross-port operators or other geometries. + +Positive control: any common completed operator C on every role commutes with +E0, since its entries are scalar bank coefficients. Thus a matched entrance +and exit encoding can pass through an already completed uniform tensor call. +This is why the present boundary obstruction does not close every jointly +designed encoded caller. + +## 4. Port-dependent endpoint normalization + +For any binary u, C_u^2=X_u and the retained normalization generalizes to +``` +i^wt(u) Z_u (F C_u^-2) Z_u = F. +``` +On Fourier character z the exponent difference is +wt(u)+wt(z xor u)+2*(z xor u).u-wt(z), a multiple of four. +This proves the identity on all address functions. The checker additionally +evaluates 5,537,792 explicit (tensor line, character) pairs. + +The old triple generators have weight nine. In this explicit P104 product +gauge, 5,440 lines have weight 1 mod 4 and 5,376 have weight 3 mod 4. +For one parallel column, using the old constant i^9 on the latter gives the +wrong global sign. For f parallel columns the correct scalar is i^(f*wt(u)); +this particular sign error disappears when f is even. The corrected phase is +explicit and introduces no positive-rank child, but its +phase/address passes remain paid physical work. These counts are +gauge-specific; no obstruction to choosing a better physical gauge is claimed. + +## 5. Complete conditional cost gate for this scaffold + +Enumerate n=104 row fibers and n column fibers. The persistent owner inventory +is two n-by-n data banks plus two DISJOINT banks of 72 helpers per fiber: +``` +N=n^2=10816, W=2n^2+2n*72=36608, m=9*9=81. +``` +Each data pair begins with source chart C_U of rank one and target identity. +All other persistent entrances are identity. The retained completed all-role +contract is full F on every one of the W physical roles. Therefore required +persistent progress is P_total=81W-N=2,954,432. + +The rejection has the following explicit hypotheses: +(a) 2n=208 whole local calls, each granted the same favorable corrected P104 +profile of mass M=2576, even in the unproved opposite orientation; +(b) each local block supplies at most P=2312 of that persistent progress; +(c) disjoint persistent helpers as enumerated, the above entrance/exit contract, +and no uncharged frame preparation; +(d) all remaining native work has rank tariff at least its net persistent +dimension progress; all child ranks are at most 81; +(e) the retained equal physical-role volume factor 1/W. +These are a named proposed replacement model, not a proved global P104 embedding. + +The original 4,058-event witness is used only to recount mass 2368 and +persistent progress 2312; adding the retained 208-H1 correction gives 2576. +Neither its full endpoint nor its native recipes are freshly replayed here. +The local I-G/2 correction does not earn the same progress a second time. +The most favorable remaining rank is consequently +``` +P_total - 208*2312 = 2473536, +lower mass = 208*2576 + 2473536 = 3009344, +capacity = 81*36608 = 2965248, +excess = 44096 > 0. +``` +This deliberately most favorable bound permits a new joint implementation to +absorb the old physical endpoint correction. If instead one retains the +literal decode / old-P / encode route, the caller's separately paid rank-one +copy transforms contribute another N=10,816 units with no persistent progress: +the lower mass is then 3,020,160 and the excess is 54,912, before decoding, +encoding, scalar copy/add/disposal or any other new work. This second number +is a bound for that literal route, not a lower bound on arbitrary resynthesis. +For 0<=a<1, (r/81)^(1-a)>=r/81. Hence the complete favorable moment is +at least 3,009,344/2,965,248 > 1 before any new encoded boundary work. +Adding b fully paid persistent banks adds 81b to both bill and capacity, +preserving the 44,096 excess. This is a different scaffold from PR3940's +width-73 nine-call law and PR3943's hypothetical paired chain. Their 1,544, +425/426 and other thresholds are not transferred here. + +The full gate is +``` +M_complete(a) >= [sum_local_children (r/81)^(1-a) + + sum_remaining_children (r/81)^(1-a)] / W + + A_intertwiners(a)+A_scalar(a)+A_physical(a) < 1. +``` +The A terms include acquisition/encoding/decoding, the explicit Pi occupancy +map and fixed-slot return, both changed-bank updates, +endpoint work not already counted in the chosen native route, new wrappers, +routing/holding/control/tape, finite +width/precision/recovery and recursive admission as applicable. They are +unknown nonnegative costs, not zero. No numerical physical total is supplied. +Even granting them all zero, the native lower bill already fails. Under this +unchanged invoice at least 44,097 net rank units of improvement are necessary +at a=0, and are not sufficient at positive a or with added costs. +A changed owner inventory, coverage law, net progress or local profile needs +a newly derived gate. + +Decision: NARROW. Publish the compatibility equations, explicit counterexamples +and conditional complete-cost rejection. Do not expand native/supplier +construction for this scaffold. A genuinely different joint encoding or owner/ +coverage contract remains open. diff --git a/research/p104-phase-uniform-gauge/source/README.md b/research/p104-phase-uniform-gauge/source/README.md new file mode 100644 index 0000000000..c722f200b5 --- /dev/null +++ b/research/p104-phase-uniform-gauge/source/README.md @@ -0,0 +1,141 @@ +# P104 residuals at a two-axis physical endpoint + +**Scoped physical compatibility theorem and conditional cost rejection. +No supplier, new kappa or selected-frontier change.** + +PR3940 established a common-chart inverse-shear comparison. This successor +derives the actual terminal-chart encoding, its conjugated paid correction, +an explicit physical counterexample to unchanged correction, and a complete +conditional gate for a specified 9-by-9 tensor-line replacement scaffold. + +The named caller is canonical notes/copied-centers-complex.tex. For its +A=-Fy, B=F T^-2 x+E y endpoint, write r=D u+H w, with +D=[[I,B_0],[B_0^t,B_0^t B_0-I]], H=diag(0_8,I_96). +Here B_0 is the P104 pivot matrix; it is distinct from the caller's B output. + +Established results, with full proofs in [PROOF.md](PROOF.md): + +- Carrying the common-chart encoding through the inverse shear requires + r <- r-Dw. Its direct scalar word has 5,000 unit ADD/SUBs, 104 halves and + 104 restoring doubles under the stated common-FULL/writable-donor contract. + This is not an optimum or an improvement on PR3940's fused word. +- At the physical terminal charts the encoding is + L_T=[[D,H T],[0,I]], not the scalar E0. The exact conjugated correction is + supplied. Reusing the old correction gives the explicit defect + [[-H,0],[T^-1(D-I),H]]. The required first-bank increment has linear rank + 96 per address. This is NOT a 96-unit native-cost lower bound. +- Literal occupancy is retained explicitly: Pi swaps the two data slots at + N, so the physical encoding is A_T=Pi L_T and its correction is + Pi P_encoded Pi. Applying the old correction directly in those literal + slots has first-bank defect -H T^-1. Pi, chart alignment and fixed-slot + return are not granted as free physical moves or owner relabelings. +- The 104 physical root labels give 10,816 distinct nondegenerate lines + p_i tensor p_j in dimension 81. All 512 phase patterns of a fixed fiber + are checked: only the two homogeneous patterns commute with D; 510 fail. + A literal four-address translation witness is supplied. A completed + common transform on every role is a positive commuting control. +- The retained constant weight-nine endpoint phase needs adjustment in this + explicit gauge: for one parallel column, 5,376 of the 10,816 tensor lines + require the opposite sign (this sign mismatch cancels for even column count). + The actual i^wt(u) phase is supplied and proved for every address. + This finite census is gauge-specific, not a general obstruction. +- Under the expressly favorable unchanged local profile/progress, separate + helper banks, original physical entrance/exit and equal-volume assumptions, + the proposed two-axis scaffold needs at least 3,009,344 rank units against + capacity 2,965,248. The 44,096 excess survives any finite number of fully + paid extra banks. The moment fails for 0<=a<1 before new boundary work. + This is its own gate; PR3940's 1,544 deficit and PR3620's thresholds are + not transferred. + +**Decision: NARROW.** The equations identify the precise changed operations; +the named favorable cost model already rejects implementation expansion. +Unknown encoder/decoder, intertwiners, endpoint copy/add/disposal, owners, +routing/holding/control/tape, width/precision/recovery and recursive costs +are listed in the proof and not set to zero. + +The product-line scaffold is a concrete proposed replacement geometry, not an +embedding into the old h=28 mixed-center producer or an implemented global +owner schedule. Its opposite-orientation local calls are granted for the +conditional screen, not proved executable. Native recipes, signed-floor +execution, the old channel's full endpoint replay, selected cold replay, +all-size transfer, independent human review and formal-kernel acceptance +are not claimed. + +Port transforms are explicitly oriented by the native boundary formula +C_u=((1+i)I+(1-i)X_u)/2, with E=F C_u^-1. Any adjustment to another +ambient-projector/chart orientation must be proved and paid; the finite +phase census is bound to these stated operators and this coordinate gauge. + +## Reproduce + +Standard-library CPython 3.12, from a genuine complete-history checkout: + +```sh +python3.12 -I -B scripts/research_package.py --package research/p104-two-axis-compatibility +python3.12 -B scripts/check_research_commit.py --package research/p104-two-axis-compatibility --check-source-history +``` + +Direct commands also work from a source-complete Git-free export: + +```sh +python3.12 -I -B research/p104-two-axis-compatibility/verify.py +python3.12 -I -O -B research/p104-two-axis-compatibility/independent.py +python3.12 -I -O -B research/p104-two-axis-compatibility/test_verify.py +``` + +The primary reconstructs a physical root isometry and all 14,400 pairings, +D and its inverse, all 512 fiber phase patterns, 1,024 exact dense Gaussian +conjugation fixtures, all 208 data columns at four patterns, 5,537,792 +normalization-character checks and the cost gate. The original channel is +used to recount its profile and persistent progress, not freshly replayed +as a native program. The separate checker imports no primary/predecessor +executable; it uses all 240 roots, rational elimination, a noncommutative +operator algebra, literal four-address translations and explicit owner-name +sets. Both share one AI-assisted source context. + +Eight behavioral groups include wrong reader, omitted changed-bank update, +wrong phase, homogeneous positive controls, undercharged/fully-paid-bank +budgets, operator-order controls, and actual optimized Git-free read-only +CLI checks with Boolean receipt, falsified bill, altered and missing inputs. +RESULT.json is compared by complete canonical typed JSON. Normal verification +does not regenerate it; --write-result is an explicit development option +which refuses to overwrite a receipt. + +## Open next questions + +A useful changed proposal must identify a concrete hypothesis it changes: +a joint entrance/exit encoding across already completed uniform calls, a +different physical gauge, or genuine owner/coverage/profile relief. First +supply its all-role intertwiner and a complete favorable budget. A new scalar +word alone does not repair the rejected scaffold. TASK.json gives the first +step and stopping rule. No further native search is reserved. + +## Sources, overlap and credit + +Canonical base 20ecf2891d80b5acf18d980b2164fb44ea7faa90, priority revision 6. +SOURCES.json pins only canonical live inputs and original catalogue/selected +provenance. The algebra is reconstructed here; no foreign pending executable +is imported. Exact pending predecessor meanings/heads are in PREDECESSORS.json. + +Credit Clear1nsight/PR3882 and PR3940 for the residual boundary and caller-cut +audit; 1337isnot1337/PR3894 for the direct correction; Rohan Arun/PR1972, +Chafik Boukhalfa/PR1991, Adam Gall/PR1940, Josie Elliston/PR1071 and the +retained E8/native lineage. The physical isometry method and C_u boundary +formula are inherited from Chafik's native package and independently +reconstructed, not claimed new. Credit Aurel Prosz/Paureel, Zhihao Chen, +Rohan Arun, Dominik Scholz and icekylinx for the actual caller/normalization; +Sagar Thakrar/PR1012, Douglas Colkitt, Jose Manuel and Vasek/PR2744 for +coverage and complete-budget discipline. PR3609/3620 retain their different +dual and threshold scopes. + +Credit parallel PR3943 (2cba526a4ebe0ef6c3c0143498adcf67dca97941) for the +actual internal Q-cleanup consumer, parallel return analysis and its separate +hypothetical-chain rejection. This package does not repeat that consumer, +compare 960 versus 1152 adapter counts or claim a new 192-transport floor. +Entry overlap covered 650 open PR bodies including drafts over seven pages, +the repository helper, and bounded live #1166 handoffs. No complete +Discussion cache, exhaustive diff survey or novelty guarantee is claimed. + +Clear1nsight, with substantial OpenAI Codex assistance. New work Apache-2.0; +all predecessor attribution retained. The two implementations are distinct +checks in one assisted session, not independent human review. diff --git a/research/p104-phase-uniform-gauge/source/RESULT.json b/research/p104-phase-uniform-gauge/source/RESULT.json new file mode 100644 index 0000000000..c7ed0ea02e --- /dev/null +++ b/research/p104-phase-uniform-gauge/source/RESULT.json @@ -0,0 +1 @@ +{"D_entries":5000,"D_inverse_checked_entries":10816,"commutator_nonzero_blocks":1277952,"commuting_patterns":[0,511],"constant_weight_nine_phase_failures":5376,"decision":"NARROW; no native/supplier expansion within the rejected scaffold","dense_conjugation_fixtures":1024,"dirty_action":"identity in compatibility maps; completed physical F is inherited, not freshly executed","dirty_roles":72,"encoded_residual_change_rank_per_address":96,"gate":{"W":36608,"capacity":2965248,"data_pairs":10816,"excess":44096,"local_calls":208,"lower_mass":3009344,"m":81,"remaining_rank":2473536,"required_progress":2954432},"independent_data_columns":832,"label_isometry":{"dual":[453,420,199,200,160,18,141,95,3],"orth":[1,8,257,259,260,291,307,351,447],"pivots":[0,1,2,3,6,12,20,30,42]},"literal_reader":{"coefficient_sha256":"aefbaffc2d02f240d640e69357322d871bbb95f8325cae07efed52c9b206cd3a","counts":{"add":5000,"double":104,"half":104},"events":5208,"input_columns":280},"noncommuting_patterns":510,"normalization_character_checks":5537792,"phase_patterns":512,"physical_labels":[386,391,431,426,127,122,82,87,405,445,440,351,304,290,295,309,346,357,31,32,79,93,88,74,37,26,224,223,176,162,167,181,218,229,261,494,385,406,446,425,454,468,289,310,345,331,358,372,283,94,73,38,52,25,11,100,115,134,148,251,236,196,211,188,174,161,182,217,203,230,244,155,140,121,107,4,19,59,44,67,81,262,276,379,324,339,316,302,475,460,419,433,398,481,502,301,434,397,482,501,487,392,439,296],"root_pairings":14400,"schema_version":1,"scope":"Physical endpoint equations and explicit tensor-line scaffold; conditional unchanged-profile cost rejection, not a global owner embedding or supplier.","status":"PASS_P104_TWO_AXIS_COMPATIBILITY","tensor_dimension":81,"tensor_lines":10816,"tensor_weights_mod_four":{"1":5440,"3":5376},"witness":{"D_twice_coefficient":1,"donor_port":2,"frequency":1,"p_donor":405,"p_row":386,"physical_difference_rank":"2^(m-1)","q":386,"row_port":0,"u_donor":1826393684020434815156610,"u_row":1826393683993908996146176}} diff --git a/research/p104-phase-uniform-gauge/test_verify.py b/research/p104-phase-uniform-gauge/test_verify.py new file mode 100644 index 0000000000..88810a9861 --- /dev/null +++ b/research/p104-phase-uniform-gauge/test_verify.py @@ -0,0 +1,204 @@ +#!/usr/bin/env python3 +"""Destructive API/CLI controls for the explicit phase-uniform gauge package. + +Apache-2.0. Separate AI test implementation; no human or kernel review claimed. +Private mutation fixtures copy bytes without inheriting read-only export modes. +""" +from __future__ import annotations + +import copy +import hashlib +import json +from pathlib import Path +import shutil +import stat +import subprocess +import sys +import tempfile +import time + +HERE = Path(__file__).resolve().parent + + +def need(condition, message): + if not condition: + raise RuntimeError(message) + + +def snapshot(folder): + return {str(p.relative_to(folder)): (p.stat().st_ino, stat.S_IMODE(p.stat().st_mode), + hashlib.sha256(p.read_bytes()).hexdigest()) + for p in folder.rglob('*') if p.is_file()} + + +def fixture(destination): + destination.mkdir() + for name in ('verify.py', 'independent.py', 'CERTIFICATE.json'): + shutil.copyfile(HERE / name, destination / name) + shutil.copytree(HERE / 'source', destination / 'source', copy_function=shutil.copyfile) + # copytree also copies directory modes; mutate only this private fixture. + for directory in [destination / 'source'] + [p for p in (destination / 'source').rglob('*') if p.is_dir()]: + directory.chmod(0o755) + + +def execute(arguments, optimized=False, cwd=None): + command = [sys.executable, '-I', '-B'] + if optimized: + command.append('-O') + result = subprocess.run(command + arguments, cwd=cwd, text=True, capture_output=True, timeout=20) + return result + + +API_PREFIX = '''import json,runpy,sys +v=runpy.run_path(sys.argv[1]) +cert=json.loads((v['HERE']/'CERTIFICATE.json').read_text()) +O=cert['columns'] +K=[v['tensor'](O[i],O[j]) for i in range(9) for j in range(9)] +a=cert['translation'] +''' + +API_CASES = { + 'zero_completion_tag': "v['check_completion'](K,0)", + 'incorrect_completion_tag': "v['check_completion'](K,a^1)", + 'corrupt_completion_columns': "K[0]^=2; v['check_completion'](K,a)", + 'helper_208_missing_translation': "tags=[a]*280; tags[208]=0; v['check_roles'](K,tags,a)", + 'omitted_helpers': "v['check_roles'](K,[a]*208,a)", + 'boolean_helper_tag': "tags=[a]*280; tags[208]=True; v['check_roles'](K,tags,a)", + 'odd_translation': "v['translation_word'](1,81)", + 'wrong_word_endpoint': "w=v['translation_word'](a,81); w[2]=(w[2][0]^6,1); w[3]=w[2]; v['check_word'](w,a,81)", + 'even_line_alphabet': "w=v['translation_word'](a,81); w[0]=(3,1); v['check_word'](w,a,81)", + 'boolean_line_sign': "w=v['translation_word'](a,81); w[0]=(w[0][0],True); v['check_word'](w,a,81)", + 'unpaired_word': "w=v['translation_word'](a,81); w[0]=(w[0][0],-1); v['check_word'](w,a,81)", +} + + +def api_controls(): + for name, statement in API_CASES.items(): + for optimized in (False, True): + result = execute(['-c', API_PREFIX + statement, str(HERE / 'verify.py')], optimized) + need(result.returncode != 0 and 'ValueError' in result.stderr, + 'API control accepted or crashed unexpectedly: ' + name + '\n' + result.stderr) + return len(API_CASES) + + +def certificate_mutations(original): + def changed(name, key, value): + cert = copy.deepcopy(original) + cert[key] = value + return name, cert + columns = list(original['columns']) + columns[0] ^= 2 + bool_columns = list(original['columns']) + bool_columns[0] = True + bad_word = copy.deepcopy(original['translation_word']) + bad_word[2][0] ^= 6 + bad_word[3] = list(bad_word[2]) + even_word = copy.deepcopy(original['translation_word']) + even_word[0][0] = 3 + bool_sign = copy.deepcopy(original['translation_word']) + bool_sign[0][1] = True + return ( + changed('bad_z', 'z', 91), + changed('zero_z', 'z', 0), + changed('boolean_z', 'z', True), + changed('string_z', 'z', '420'), + changed('corrupt_columns', 'columns', columns), + changed('boolean_column', 'columns', bool_columns), + changed('zero_translation', 'translation', 0), + changed('boolean_translation', 'translation', True), + changed('wrong_translation_word', 'translation_word', bad_word), + changed('even_line_word', 'translation_word', even_word), + changed('boolean_word_sign', 'translation_word', bool_sign), + changed('undercharged_appended', 'bankwise_appended_calls', original['bankwise_appended_calls'] - 1), + changed('boolean_appended', 'bankwise_appended_calls', True), + ) + + +def cli_controls(base): + cert = json.loads((HERE / 'CERTIFICATE.json').read_text()) + mutations = certificate_mutations(cert) + cases = [name for name, _ in mutations] + [ + 'altered_source_result', 'missing_source_result', 'altered_source_readme', + 'missing_source_proof', 'missing_certificate', 'duplicate_certificate_key', + ] + values = dict(mutations) + independent_negative_runs = 0 + for name in cases: + folder = base / name + fixture(folder) + cert_path = folder / 'CERTIFICATE.json' + if name in values: + cert_path.write_text(json.dumps(values[name])) + elif name == 'altered_source_result': + path = folder / 'source/RESULT.json' + path.write_bytes(path.read_bytes() + b'\n') + elif name == 'missing_source_result': + (folder / 'source/RESULT.json').unlink() + elif name == 'altered_source_readme': + path = folder / 'source/README.md' + path.write_bytes(path.read_bytes() + b'\n') + elif name == 'missing_source_proof': + (folder / 'source/PROOF.md').unlink() + elif name == 'missing_certificate': + cert_path.unlink() + elif name == 'duplicate_certificate_key': + text = cert_path.read_text() + cert_path.write_text(text.replace('{', '{"z":420,', 1)) + for optimized in (False, True): + result = execute([str(folder / 'verify.py')], optimized, folder) + need(result.returncode != 0 and 'PASS_P104_PHASE_UNIFORM_GAUGE' not in result.stdout, + 'CLI damaged-input control accepted: ' + name + ' optimized=' + str(optimized)) + need('ValueError' in result.stderr or 'FileNotFoundError' in result.stderr, + 'CLI damaged-input control crashed unexpectedly: ' + name + '\n' + result.stderr) + if name in {'altered_source_result', 'missing_source_result', + 'altered_source_readme', 'missing_source_proof'}: + independent = execute([str(folder / 'independent.py')], optimized, folder) + need(independent.returncode != 0 and + ('ValueError' in independent.stderr or 'FileNotFoundError' in independent.stderr), + 'independent CLI accepted damaged source: ' + name) + independent_negative_runs += 1 + return len(cases), independent_negative_runs + + +def readonly_positive(base): + folder = base / 'readonly' + fixture(folder) + files = [p for p in folder.rglob('*') if p.is_file()] + directories = [folder] + [p for p in folder.rglob('*') if p.is_dir()] + for p in files: + need(p.stat().st_ino != (HERE / p.relative_to(folder)).stat().st_ino, + 'read-only fixture shares an inode with source') + p.chmod(0o444) + for p in directories: + p.chmod(0o555) + before = snapshot(folder) + try: + for optimized in (False, True): + result = execute([str(folder / 'verify.py')], optimized, folder) + need(result.returncode == 0 and result.stdout.startswith('PASS_P104_PHASE_UNIFORM_GAUGE '), + 'read-only Git-free positive CLI failed: ' + result.stderr) + need(snapshot(folder) == before, 'read-only positive export changed') + finally: + for p in sorted(directories, key=lambda q: len(q.parts)): + p.chmod(0o755) + return len(files) + + +def main(): + started = time.monotonic() + original = snapshot(HERE) + api = api_controls() + with tempfile.TemporaryDirectory(prefix='p104-uniform-gauge-controls-') as temporary: + base = Path(temporary) + cli, independent_negative_runs = cli_controls(base) + readonly_files = readonly_positive(base) + need(snapshot(HERE) == original, 'source package was modified by controls') + print('PASS_P104_PHASE_UNIFORM_GAUGE_CONTROLS api_cases=' + str(api) + + ' cli_cases=' + str(cli) + ' negative_runs=' + str(2 * (api + cli)) + + ' independent_source_negative_runs=' + str(independent_negative_runs) + + ' normal_and_optimized=PASS readonly_git_free_files=' + str(readonly_files) + + ' source_unchanged=PASS elapsed_seconds=' + format(time.monotonic() - started, '.3f')) + + +if __name__ == '__main__': + main() diff --git a/research/p104-phase-uniform-gauge/verify.py b/research/p104-phase-uniform-gauge/verify.py new file mode 100644 index 0000000000..28f3cda421 --- /dev/null +++ b/research/p104-phase-uniform-gauge/verify.py @@ -0,0 +1,174 @@ +#!/usr/bin/env python3 +"""Explicit P104 gauge and completed-transform tags. Apache-2.0; see README.""" +from __future__ import annotations +from collections import Counter +import hashlib +import json +from pathlib import Path + +HERE = Path(__file__).resolve().parent +PINS = {'PROOF.md': 'bdc7d868e4411541a33179af683f48011e66d6446a45bef363f3f3dd5163f717', 'README.md': 'd13777b9065d4d575cbc0e41293b454f15ad0455d5047bb36c6b1ed527ff48e0', 'RESULT.json': 'ce05a27ebc98677bec4febaa488fa03f5b6fc60216aa43b34298444d12f7ab6c'} + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def unique(pairs): + out = {} + for key,value in pairs: + need(key not in out, 'duplicate JSON key') + out[key] = value + return out + + +def load(path): + return json.loads(path.read_text(), object_pairs_hook=unique) + + +def authenticate(): + for name,digest in PINS.items(): + need(hashlib.sha256((HERE/'source'/name).read_bytes()).hexdigest()==digest, + 'source bytes: '+name) + + +def dot(x,y): + return (x&y).bit_count()&1 + + +def linear(columns,x): + value = 0 + for i,c in enumerate(columns): + if x>>i&1: + value ^= c + return value + + +def tensor(x,y,n=9): + return sum(y << (n*i) for i in range(n) if x>>i&1) + + +def orthogonal(columns): + n = len(columns) + need(all(type(c) is int and 0>i)&1))%4==0 + for i,c in enumerate(columns)), 'completed-transform phase character') + need(linear(columns,a)==a, 'explicit gauge must fix completion tag') + + +def check_roles(columns,tags,a): + """Direct-sum character identity on independent data and dirty-helper roles.""" + need(len(tags)==280, 'all local roles including 72 arbitrary helpers') + for role,tag in enumerate(tags): + need(type(tag) is int and 0<=tag<(1<>i)&1))%4==0, + 'all-role completion tag '+str(role)) + need(all(tag==a for tag in tags), 'common tag on every role') + + +def translation_word(a,n): + need(type(a) is int and 0>i&1 else 0) for i in range(9)] + need(isinstance(cert['columns'],list) and len(cert['columns'])==9 and + all(type(c) is int and 0