From c6ab9db1682787f681c2c0cb950bf8523aeaf163 Mon Sep 17 00:00:00 2001 From: Ali Romman <226877337+aliromman@users.noreply.github.com> Date: Wed, 18 Nov 2026 06:40:50 -0500 Subject: [PATCH 1/2] Bind sharp radial phase-covariant Gaussian rounding to complete ports --- .../phase-covariant-radial-ports/CREDITS.md | 41 +++ .../phase-covariant-radial-ports/ORIGINS.json | 38 +++ .../phase-covariant-radial-ports/PROOF.md | 278 ++++++++++++++++++ .../phase-covariant-radial-ports/README.md | 96 ++++++ .../phase-covariant-radial-ports/RESULT.json | 144 +++++++++ .../phase-covariant-radial-ports/SOURCES.json | 18 ++ .../phase-covariant-radial-ports/TASK.json | 100 +++++++ .../phase-covariant-radial-ports/VERIFY.json | 34 +++ .../phase-covariant-radial-ports/kernel.py | 84 ++++++ .../phase-covariant-radial-ports/oracle.py | 67 +++++ .../phase-covariant-radial-ports/ports.py | 26 ++ .../predecessor/NOTICE | 21 ++ .../predecessor/PROOF.md | 242 +++++++++++++++ .../predecessor/rounded.py | 123 ++++++++ .../phase-covariant-radial-ports/verify.py | 201 +++++++++++++ 15 files changed, 1513 insertions(+) create mode 100644 research/phase-covariant-radial-ports/CREDITS.md create mode 100644 research/phase-covariant-radial-ports/ORIGINS.json create mode 100644 research/phase-covariant-radial-ports/PROOF.md create mode 100644 research/phase-covariant-radial-ports/README.md create mode 100644 research/phase-covariant-radial-ports/RESULT.json create mode 100644 research/phase-covariant-radial-ports/SOURCES.json create mode 100644 research/phase-covariant-radial-ports/TASK.json create mode 100644 research/phase-covariant-radial-ports/VERIFY.json create mode 100644 research/phase-covariant-radial-ports/kernel.py create mode 100644 research/phase-covariant-radial-ports/oracle.py create mode 100644 research/phase-covariant-radial-ports/ports.py create mode 100644 research/phase-covariant-radial-ports/predecessor/NOTICE create mode 100644 research/phase-covariant-radial-ports/predecessor/PROOF.md create mode 100644 research/phase-covariant-radial-ports/predecessor/rounded.py create mode 100644 research/phase-covariant-radial-ports/verify.py diff --git a/research/phase-covariant-radial-ports/CREDITS.md b/research/phase-covariant-radial-ports/CREDITS.md new file mode 100644 index 0000000000..fc33758e78 --- /dev/null +++ b/research/phase-covariant-radial-ports/CREDITS.md @@ -0,0 +1,41 @@ +# Sources and credit + +Prepared by Ali Romman with substantial OpenAI Codex assistance. +New work is Apache-2.0. Independent human and formal-kernel review are +unclaimed. The algebraic oracle is adapted source methodology, not blind +or independent scientific review. + +- Ali Romman's [PR #7696](https://github.com/CrocSwap/integer-mult-bounds/pull/7696), + [proof](https://github.com/aliromman/integer-mult-bounds/blob/d7be8d9131a948ea1d25833e96906ea3da979764/research/gaussian-exact-sum-global-optimum/PROOF.md) + and [ring code](https://github.com/aliromman/integer-mult-bounds/blob/d7be8d9131a948ea1d25833e96906ea3da979764/research/gaussian-exact-sum-global-optimum/verify.py), + supplies the global Hall lower bound and individual-ring matching. + The new kernel adapts that matching and removes variable division. + That source retains Nick Petalas's first forward exact-sum witness, + CubeJerry/Jerry Chen's half-grid and annular geometry, and the earlier + Gaussian-pair credit. The lower theorem is not a new result here. +- Ali Romman's [PR #6509](https://github.com/CrocSwap/integer-mult-bounds/pull/6509), + [proof](https://github.com/aliromman/integer-mult-bounds/blob/a4173e810c4d34a1d13b9745af123ad0ec6cfed5/research/conservative-gaussian-rounding/PROOF.md), + [port interface](https://github.com/aliromman/integer-mult-bounds/blob/a4173e810c4d34a1d13b9745af123ad0ec6cfed5/research/conservative-gaussian-rounding/ports.py), + [retained code](https://github.com/aliromman/integer-mult-bounds/blob/a4173e810c4d34a1d13b9745af123ad0ec6cfed5/research/conservative-gaussian-rounding/inputs/rounded.py) + and [oracle source](https://github.com/aliromman/integer-mult-bounds/blob/a4173e810c4d34a1d13b9745af123ad0ec6cfed5/research/conservative-gaussian-rounding/verify.py), + supplies the exact backend interface, stage structure, requests and + coordinate-error/width analysis. oracle.py follows its rational + convolution and literal three-bit monomial formulas. Exact copied + files keep their notices and are authenticated by ORIGINS.json. +- JoyboyBrian's [PR #5485](https://github.com/CrocSwap/integer-mult-bounds/pull/5485) + and [PR #4743](https://github.com/CrocSwap/integer-mult-bounds/pull/4743) + supply the actual port and error-channel lineage, as recorded in the + retained [notice](predecessor/NOTICE). Generic reversible rounding, + phase covariance, fiber sums and dirty cleanup are prior work. + The notice retains Tekalign, Arham Tahir, Nick Petalas, Cinna Davis + and the earlier native/compiler attribution. +- CubeJerry's [PR #6758](https://github.com/CrocSwap/integer-mult-bounds/pull/6758), + [pinned source](https://github.com/CubeJerry/integer-mult-bounds/blob/362b20bc934500bc503e850059f0d34daa5dcae3/research/four-axis-phase-covariant-grid/README.md), + is related prior phase restoration and port binding for a different + four-axis quotient map. No code or precision gain is transferred from it. + +The new result selects the one-pair matching by sum parity. It attains +the sharp radial budget with phase, conjugate-inverse, translation and +swap covariance, then proves the complete retained-port radial envelopes. +The copied sources are unchanged. Their retained proof is a dependency, +not a claim of independent reproving or first port implementation. diff --git a/research/phase-covariant-radial-ports/ORIGINS.json b/research/phase-covariant-radial-ports/ORIGINS.json new file mode 100644 index 0000000000..bb445efb5e --- /dev/null +++ b/research/phase-covariant-radial-ports/ORIGINS.json @@ -0,0 +1,38 @@ +[ + { + "path": "ports.py", + "source_path": "research/conservative-gaussian-rounding/ports.py", + "commit": "a4173e810c4d34a1d13b9745af123ad0ec6cfed5", + "repo": "aliromman/integer-mult-bounds", + "git_blob": "a9d5d0268ff6872536edadf159f79448aa30197a", + "sha256": "8460457aaafeaedf3b7fb287c0d61b049fb2595e8993ba3fc8695d8f9c9b830d", + "size": 1012 + }, + { + "path": "predecessor/rounded.py", + "source_path": "research/conservative-gaussian-rounding/inputs/rounded.py", + "commit": "a4173e810c4d34a1d13b9745af123ad0ec6cfed5", + "repo": "aliromman/integer-mult-bounds", + "git_blob": "8ae18373f2f5b0d33a7f0d1d6a591489f81401f1", + "sha256": "f320d180bdcd65d28102eb34a26b3ab5287b39d8d00bb4734019060d174d47c9", + "size": 4348 + }, + { + "path": "predecessor/NOTICE", + "source_path": "research/conservative-gaussian-rounding/NOTICE", + "commit": "a4173e810c4d34a1d13b9745af123ad0ec6cfed5", + "repo": "aliromman/integer-mult-bounds", + "git_blob": "e5377e3e34c883d3bd8a829e1cb247f3aba28cc8", + "sha256": "ba3157cea93750cc40a060e06af11da25f8d1b0e51eeea56636c94ce2c8abe8e", + "size": 1346 + }, + { + "path": "predecessor/PROOF.md", + "source_path": "research/conservative-gaussian-rounding/PROOF.md", + "commit": "a4173e810c4d34a1d13b9745af123ad0ec6cfed5", + "repo": "aliromman/integer-mult-bounds", + "git_blob": "b7047476aaa5e2bb149c92a8a40a9b2ab444ef73", + "sha256": "122eff335674d8de1bcba47d28feb0c420be62b2b6d4e84f91c4292383753380", + "size": 11768 + } +] diff --git a/research/phase-covariant-radial-ports/PROOF.md b/research/phase-covariant-radial-ports/PROOF.md new file mode 100644 index 0000000000..48550b7e40 --- /dev/null +++ b/research/phase-covariant-radial-ports/PROOF.md @@ -0,0 +1,278 @@ +# A sharp radial provider with Gaussian phase symmetry and complete ports + +This package supplies an exact-sum Gaussian-pair bijection with error at +most h on the grid `h Z[i]`, where `h=2^-g`. Its forward, inverse outward +and absolute radial suprema are all `h/sqrt(2)`, the minimum from +[PR #7696](https://github.com/CrocSwap/integer-mult-bounds/pull/7696), +[pinned proof](https://github.com/aliromman/integer-mult-bounds/blob/d7be8d9131a948ea1d25833e96906ea3da979764/research/gaussian-exact-sum-global-optimum/PROOF.md). +Unlike that package's particular construction, this provider commutes +with global Gaussian units. Its inverse is its componentwise conjugate. +It also preserves wire swap and common Gaussian translations. + +The provider is installed through the unchanged backend interface of +[PR #6509](https://github.com/CrocSwap/integer-mult-bounds/pull/6509), +[pinned port](https://github.com/aliromman/integer-mult-bounds/blob/a4173e810c4d34a1d13b9745af123ad0ec6cfed5/research/conservative-gaussian-rounding/ports.py). +The full two-/three-call programs return both arbitrary stored dirty banks +exactly under reverse execution. Their retained coordinate error requests +remain valid. New radial envelopes cover every call and both complete port +directions. These are indexed numerical programs, not accelerated native +suppliers or fixed multitape graphs. No new kappa is claimed. + +## 1. The parity-dependent matching + +First set h=1. Use the definitions from PR #7696: + +```text +s=x+y, d=x-y, +J(a,b)=(-b,a), B(a,b)=(a+b,a-b), T=B/2, Q=-J, +L=(Z+1/2)^2, H(a,b)=(a,-b). +``` + +Let M pair consecutive vertices of each square ring in L, starting at +the top right corner and walking along the top, left, bottom and right +sides. Each side includes its initial corner and excludes its final +corner. This is the prior individual-ring involution. It flips the color +given by the integer coordinate sum modulo two. + +Write `R=2r=2k+1` for the odd integer side length in unit steps. The +cycle has 4R vertices. Its matching sends index j to `j+(-1)^j` modulo +4R. A half-turn adds 2R, an even integer, so M is odd. The reflection H +sends j to `3R-j` modulo 4R. Since 3R is odd, this reflection commutes +with M. Thus M commutes with H and with -I. + +For a mixed-parity sum set `p=Re(s) mod 2` and define + +```text +M_1=M, M_0=Q M Q^-1. +``` + +The implementation stores doubled odd coordinates (a,b) and radius R. +Its cycle index is `(R-a)/2` on the top side, `R+(R-b)/2` on the left, +`2R+(a+R)/2` on the bottom and `3R+(b+R)/2` on the right. The same +half-open corner convention makes the cases disjoint. Each index is an +integer in [0,4R). Toggling its last bit gives its partner; four comparison +branches recover the coordinates without division by R. + +Both are involutions, flip colors, preserve square rings and commute with +H and -I. For M_0, use `Q^-1 H Q=-H` and the two symmetries of M. +For both values of p the identity + +```text +M_(1-p) Q = Q M_p +``` + +holds. In the second direction this uses `Q^2=-I` and oddness of M. + +## 2. Positive and negative providers + +For equal-parity sums use the exact ideal difference `f_sigma(d)=sigma Jd`. +For mixed sums use + +```text +f_+(d)=B M_p(T Jd), +f_-(d)=-J B M_p(T d), +F_sigma(x,y)=((s+f_sigma(d))/2,(s-f_sigma(d))/2). +``` + +The sum and p remain unchanged. The input difference has parities +`(p,1-p)`. The color of T Jd is 1-p, and M_p changes it to p. Applying +B gives the required difference parities. The negative formula has the +same property, with the final -J exchange. Both output halves are exact +Gaussian integers. The identities `T B=I` and `M_p^2=I` give both inverse +compositions. No error bits or history are stored. + +A unit matching edge gives squared pair error one. Equal-parity sums have +zero error. Thus every input is a nearest Euclidean Gaussian-grid output, +with each complex-coordinate error at most `h/sqrt(2)`. This pointwise +nearest-error property is retained predecessor work, not a new grid +lower bound. + +Global multiplication by i sends p to 1-p and the transformed point t +to Q t. The displayed intertwining identity therefore gives +`F_+(i*x,i*y)=i*F_+(x,y)`. The inverse has the same covariance. For +componentwise conjugation K, the identity `T J K B=H` and commutation +of M_p with H give `K F_+ K=F_-`. Conjugation preserves p, so the same +matching is used on both relevant sum fibers. + +Oddness of M_p gives wire-swap covariance. A common Gaussian translation +changes s by twice a Gaussian integer and leaves d unchanged. It preserves +p and hence commutes with the map. Equal inputs and zero are fixed. These +claims hold for all magnitudes on the grid. Finite words require the +range conditions below. + +## 3. Sharp radial bound and its native-stage consequence + +For mixed sums write `c=|s|^2/2>=1/2`. The squared input and output norms +are `c+|t|^2` and `c+|M_p(t)|^2`. Both matchings use only tangential +square-ring edges. Apart from a zero-cost sign toggle, such an edge has +one coordinate of magnitude r and other magnitudes u and u+1, where +`r>=u+1` and `u>=1/2`. + +If `A=c+r^2+u^2`, the squared-radius increment is 2u+1. The radial gap +is less than `1/sqrt(2)` because +`(2u+1/2)^2 < 2A`: the left side is `4u^2+2u+1/4`, while the right side +is at least `4u^2+4u+3`. This also proves the inverse bound. The sum-one +matching is unchanged from PR #7696, so its explicit forward and inverse +sharpness sequences remain: + +```text +F_+(-k*i,1+k*i)=(k+1,-k), +F_-(1-k*i,k*i)=(-k,k+1), k>=1. +``` + +Their outward gaps tend to `1/sqrt(2)`. The general Hall lower theorem +in PR #7696 applies because this class still preserves exact sums and is +injective. The three suprema are therefore sharp. None is attained at a +finite input. Scaling by h gives the stated grid constants. + +Now take a layer of N/2 disjoint pairs. Write a and b for the vectors of +pair norms before and after that layer. Each component satisfies +`|b_j-a_j|<=h/sqrt(2)`. The reverse triangle inequality in R^(N/2) gives + +```text +abs(||layer(z)||-||z||) <= h*sqrt(N)/2. +``` + +This layer bound is sharp: use the same forward sharpness pair at every +site, then let k increase. The joint output error from the ideal layer is +at most `h*sqrt(N/2)`. The radial and approximation bounds are different +statements; the smaller radial constant does not reduce the error constant. + +A native call on `N=8^f` applies f literal layers, at bits `3j+axis` with +axis 0 or 2. Its inverse reverses this order and uses F_-. For every call +and every prefix of j layers, + +```text +abs(||prefix_j(z)||-||z||) <= j*h*sqrt(N)/2, +||rounded_call(z)-ideal_call(z)|| <= f*h*sqrt(N/2). +``` + +The first bound follows by adding the layer radial changes. The second +uses the ideal layers' unitarity. No independent-error premise is used. +The factor f is a sufficient bound; no sharpness claim is made for a +complete multi-layer call. Every spectator-fiber sum is preserved exactly, +as each pair has exact sum. There are 4^f such independent complex sums. + +## 4. Complete retained ports and radial envelopes + +The root ports.py and predecessor/rounded.py are exact copied source +bytes. ORIGINS.json pins their public Git objects. The only supplied new +operation is the explicit numerical backend argument. The source uses +its actual P, Q, W and M monomials, its triangular addition and all k paid +calls, for k=2 or 3. No source function is patched. The kernel.need function +implements the port's unchanged predicate interface. + +The monomials are exact grid permutations with unit phases. The mix is +`y += (P+2Q)x`, has operator norm at most three in its source argument, +and has its literal subtraction inverse. Every native call has its +literal inverse. Reading the complete reverse port shows precisely the +reverse operation order. Induction gives exact return of both arbitrary +stored banks in either composition order, whenever range checks permit +the execution. No bank is assumed zero or discarded. + +Let X and Y be the Euclidean norms of the two entry banks and put +`D=f*h*sqrt(N)/2`. The full port bounds are + +| Direction | Output x norm | Output y norm | +| --- | --- | --- | +| forward, k calls | at most X+D | at most Y+3X+(k+2)D | +| reverse, k calls | at most X+D | at most Y+3X+(k-1)D | + +For forward execution, x gains at most D before it is used in the mix. +The mix gives at most `Y+3(X+D)`. The y bank then has k-1 native calls, +which add at most `(k-1)D`; the exact wrappers add zero. For reverse +execution, y first has k-1 inverse calls, then subtracts the mix formed +from the still-unmodified entry x. The inverse x call comes last. The +same argument with fewer completed layers bounds every native prefix. +These are complete sufficient envelopes, not optimal port constants. + +The coordinate approximation contract is the one used by the source. +Each layer has maximum complex-coordinate error `h/sqrt(2)`, and its +ideal infinity norm is sqrt(2). Thus +`delta_(j+1)<=sqrt(2)*delta_j+h/sqrt(2)`, from delta_0=0, yields +`delta_f<2*2^(f/2)*h`. The unchanged source tolerance requests are + +| Port | q | +| --- | --- | +| two-call forward | P+f+3 | +| three-call forward | P+ceil(3f/2)+3 | +| two-call reverse | P+ceil(f/2)+2 | +| three-call reverse | P+f+2 | + +The grid `g=q+ceil(f/2)+1` therefore retains complete error at most +`2^-P`, using the source's port propagation proof. This package checks +that premise on actual paid inputs and against a full rational oracle; +it does not claim first discovery or independent proof of the retained +port budgets. The exact source proof is in predecessor/PROOF.md. +Initial quantization remains a separate charge. + +## 5. Word range and the complete direct cost + +Stored data use signed w-bit integers. The pair routine checks all four +inputs and all four outputs. It returns only after all output checks pass. +On valid inputs, let M bound their absolute components. Each sum or +difference is at most 2M. Doubled half-grid coordinates and the ring radius +are at most 4M. The cycle index is less than 4r, hence at most 16M. +The branch formulas use only fixed small multiples, additions, signs, +parities and exact halves. All their intermediate magnitudes are at most +`16M+2`. Signed `w+6` auxiliary bits suffice for w>=2. There is no +variable divisor, growing table, matching search or real arithmetic in +the runtime provider. The verifier checks the no-variable-division property. + +The source data width +`w=H+g+2f+ceil(f/2)+9`, for H>=0, remains sufficient under its entry +magnitude and grid premises. The stored-output growth and coordinate +error bound are the same as in the source proof. The new auxiliary words +have the stated extra six bits; they are not charged as free storage. +This is not a claim that the old eight-word scratch allocation is reused. +Whole-call range failure can occur after earlier pair writes; no atomic +whole-call failure contract is asserted. Successful inverse return is the +contract tested and proved above. + +A complete k-call port performs exactly `k*f*N/2` pairs, including zero +pairs. Every pair has a bounded fixed number of full-word operations, +eight stored range checks, four real reads and four real writes. Its +constant number of auxiliary words can be initialized and cleared in +O(w) bit work. The direct work bound includes these steps, parity/side +selection and output range decisions; there is no unit-cost lookup oracle. + +The unchanged source mix adds 4N real additions and 2N shifts. It retains +two monomial mix terms and four full wrapper passes for k=2, or six for +k=3. Each pass builds its address/phase records in O(fN) word work, +executes the permutation and clears its owned route/visited state. Both +dirty banks and all route data remain in the storage accounting. + +Thus the complete indexed reference has O(fN) bounded-word work, +`O(fN*(w+f))` bit work and `O(N*(w+f))` stored bits. These are constructive +asymptotic bounds, not an exact tape-transition invoice or a measured +speedup. A fixed multitape graph, recursive exchange rate, physical routing, +compiler stock, owned backing and selected caller admission remain open. + +## 6. Verification, excluded identities and credit + +The exact receipt checks all pair inputs in [-4,4]^4 in both directions, +all four Gaussian phases, conjugate inverse, swap, translation and radial +bounds. Complete signed-width domains 2, 3 and 4 check success exactly +when final outputs fit. Complete ring walks check the direct formula and +its reflection/half-turn symmetries. The sharpness sequence includes +4097-bit inputs. Actual complete native calls and all four port directions +for f=1,2,3 check every paid cut, full rational error, radial envelopes, +fiber sums, phase covariance and exact dirty return. Aligned inputs agree +with the source port and ideal oracle. + +The fourth power and tensor-stage commutation fail on retained examples. +Wrong inverse stage order also fails. The square/fourth identities of +some earlier providers are not preserved, and the actual ports do not use +them. The negative provider must use the stated inverse and reversed +stage order. No ideal native graph identity is inferred from this local +bijection. Invalid formats, wrong axes, aliased banks and real signed +output overflow are rejection controls. + +The new result is the parity-selected sharp radial provider and its +complete source-bound radial/port contract. Generic phase restoration, +reversible rounding and this port interface are prior work. +[CREDITS.md](CREDITS.md) gives exact source roles, including CubeJerry's +distinct four-axis phase construction and the retained native lineage. +Prepared by Ali Romman with substantial OpenAI Codex assistance. +Apache-2.0. Independent human and formal-kernel review are unclaimed. +The selected frontier and all five selected assumptions remain unchanged. diff --git a/research/phase-covariant-radial-ports/README.md b/research/phase-covariant-radial-ports/README.md new file mode 100644 index 0000000000..ab15ece1f7 --- /dev/null +++ b/research/phase-covariant-radial-ports/README.md @@ -0,0 +1,96 @@ +# Sharp radial Gaussian rounding with complete phase-covariant ports + +A parity-dependent square-ring matching attains the sharp pair radial +supremum **h/sqrt(2)** while preserving global Gaussian phases, exact sum, +wire swap and common translations. Its inverse is its componentwise +conjugate. This supplies the symmetry missing from +[PR #7696](https://github.com/CrocSwap/integer-mult-bounds/pull/7696). + +The new provider runs through the unchanged explicit backend interface +and complete two-/three-call C0/C2 ports retained in +[PR #6509](https://github.com/CrocSwap/integer-mult-bounds/pull/6509). +Both arbitrary stored dirty banks return exactly under successful reverse +execution. The source coordinate-error requests remain valid. No new +kappa, selected-assumption discharge or accelerated native tariff is claimed. + +Read [PROOF.md](PROOF.md), [RESULT.json](RESULT.json), the +[provider](kernel.py), [retained complete port](ports.py) and +[source pins](ORIGINS.json). All source wrappers and additions remain. + +## Radial and implementation contract + +For N=8^f, put D=f*h*sqrt(N)/2. A complete native call changes the field +norm by at most D in absolute value. For entry-bank norms X,Y, the full +k-call forward port has output norms at most X+D and Y+3X+(k+2)D. +The reverse port has bounds X+D and Y+3X+(k-1)D. The per-layer bound is +sharp; the complete-call and port bounds are sufficient, with no claim +of optimality. Approximation error remains f*h*sqrt(N/2) per call. + +The pair implementation uses fixed comparisons, signs, parities and exact +halves. It uses no variable data division or growing lookup. Stored words +use the retained signed width w; a constant number of w+6 auxiliary words +suffice. Their work and storage are included. The complete indexed bounds +are O(fN*(w+f)) bit work and O(N*(w+f)) stored bits, with every native pair, +source wrapper, addition, range check and owned route/auxiliary cleanup. +These are not exact tape-transition counts or a measured speedup. + +The fourth-power identity and tensor-stage commutation fail. The inverse +must reverse the literal stage order. No native graph identity is inferred. +A fixed tape graph, physical routing, owned backing, recursive pricing, +stock and selected caller admission remain open. The selected frontier +and all five assumptions remain unchanged. The old eight-word scratch +allocation is not claimed for this different pair computation. + +## Evidence and reproduction + +Use CPython 3.12 and its standard library from the repository root: + +```sh +python3.12 -I -W error -B research/phase-covariant-radial-ports/verify.py +python3.12 -I -W error -B -O research/phase-covariant-radial-ports/verify.py +python3.12 -B scripts/research_package.py --package research/phase-covariant-radial-ports +python3.12 -B scripts/check_research_commit.py --package research/phase-covariant-radial-ports --check-source-history --check-modes +``` + +Expected markers are PASS_PHASE_COVARIANT_RADIAL_PORTS, +PASS_REGISTERED_RESEARCH_PACKAGE and PASS_RESEARCH_COMMIT_BYTES. +Both modes check 13122 pair directions, 52488 phase cases, 16900 complete +ring points, all signed input domains at widths 2/3/4, and 68 sharpness +indices through 4097 bits. There are 24 complete native calls, 672 fiber +observables, 24 complete port executions with 60 actual paid cuts, +24 exact dirty returns and 12 aligned predecessor comparisons. The +primary port executions contain 16720 pairs and 133760 stored range checks. + +Exact source bytes, direct rational errors and radial inequalities are +checked. The copied ports.py retains its source trailing blank line; +new-source whitespace checks exclude only this byte-exact retained file. Overflow, invalid domains, aliases, wrong inverse order and +excluded finite-order/tensor identities have controls. Full predecessor +package replays, selected cold replay, Lean and Docker were not run. +Independent human and formal-kernel review are unclaimed. These finite +checks corroborate the written all-input proof. + +## Source and overlap + +Base: canonical main e54523517d0f03e58352e647c403a5af3e525a57, priority +revision 8. The uniform-transfer card changes scope to this source-bound +local provider and inverse contract. [TASK.json](TASK.json) states the +family decision and remaining costs. The [advance claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19707602) follows +the existing exact-sum handoff. Live handoffs, source-reference intake, +refreshed PR/Discussion overlap and the complete closed snapshot with its +updated-order delta show no competing one-pair ring-provider claim. +Sparse local and unpublished work remain coverage limits. + +## Open next questions + +Can the whole indexed program be lowered to a fixed tape graph at a useful +recursive tariff? First specify a signed format, routing, every temporary +and the exact operation order. Preserve both arbitrary banks and do not +substitute the failed fourth-power identity for the actual inverse. + +## Credit + +Prepared by Ali Romman with substantial OpenAI Codex assistance. +[CREDITS.md](CREDITS.md) links the exact global-optimum and port sources, +CubeJerry's distinct four-axis phase precedent, and all retained native +attribution. The runtime source files keep their original notices. +New work is Apache-2.0. diff --git a/research/phase-covariant-radial-ports/RESULT.json b/research/phase-covariant-radial-ports/RESULT.json new file mode 100644 index 0000000000..4df03afa9e --- /dev/null +++ b/research/phase-covariant-radial-ports/RESULT.json @@ -0,0 +1,144 @@ +{ + "status": "PASS_PHASE_COVARIANT_RADIAL_PORTS", + "pair_cases": 13122, + "phase_cases": 52488, + "complete_ring_points": 16900, + "signed_width_censuses": { + "2": { + "fitting": 384, + "rejected": 128 + }, + "3": { + "fitting": 5632, + "rejected": 2560 + }, + "4": { + "fitting": 88064, + "rejected": 43008 + } + }, + "sharpness_indices": 68, + "largest_input_bits": 4097, + "complete_call_cases": 24, + "exact_fiber_observables": 672, + "complete_port_cases": 24, + "actual_paid_cuts": 60, + "exact_dirty_roundtrips": 24, + "aligned_predecessor_ports": 12, + "primary_port_work": { + "butterflies": 16720, + "stored_range_checks": 133760, + "nonzero_roundings": 8331 + }, + "largest_port_error_squared": "10705/128", + "source_files": 4, + "controls": [ + "signed output overflow", + "Boolean data", + "Boolean sign", + "wrong axis", + "aliased dirty banks", + "wrong inverse order", + "phase-independent matching", + "excluded finite order" + ], + "limitation_witnesses": { + "noncommuting_layers": { + "input": [ + [ + -1, + 0 + ], + [ + -1, + 0 + ], + [ + 0, + 0 + ], + [ + 1, + 0 + ] + ], + "order_01": [ + [ + 0, + -1 + ], + [ + 0, + 0 + ], + [ + 0, + 1 + ], + [ + -1, + 0 + ] + ], + "order_10": [ + [ + 0, + -1 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + -1, + 1 + ] + ] + }, + "wrong_inverse_stage_order": [ + [ + -1, + 0 + ], + [ + -1, + 0 + ], + [ + 0, + 0 + ], + [ + 1, + 0 + ] + ], + "fourth_power": { + "input": [ + [ + 0, + -1 + ], + [ + 1, + 1 + ] + ], + "output": [ + [ + 2, + 0 + ], + [ + -1, + 0 + ] + ] + } + }, + "scope": "Sharp radial phase/conjugate provider and indexed retained ports; no accelerated native or tape admission" +} diff --git a/research/phase-covariant-radial-ports/SOURCES.json b/research/phase-covariant-radial-ports/SOURCES.json new file mode 100644 index 0000000000..5335fa97d9 --- /dev/null +++ b/research/phase-covariant-radial-ports/SOURCES.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + } + ] +} diff --git a/research/phase-covariant-radial-ports/TASK.json b/research/phase-covariant-radial-ports/TASK.json new file mode 100644 index 0000000000..c1a100513e --- /dev/null +++ b/research/phase-covariant-radial-ports/TASK.json @@ -0,0 +1,100 @@ +{ + "schema_version": 1, + "task_id": "uniform-transfer-audit", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "uniform-transfer-audit", + "question": "Can one of the selected record's five inherited assumptions be proved at its actual caller?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "Identify the proposition and what would change downstream; do not equate a finite replay with a universal proof.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Choose one assumption ID (native_all_columns, owned_erasure, compiler, precision_tape, analytic_recovery), one quantified implication and exact dependency closure. Check current handoffs, including #5625 row reentry and #5707 root-prefix lowering, without treating their partial scope as the whole theorem. Prove or falsify that implication with a caller-bound argument; stop at the chosen obligation. Finite tests or root digits do not discharge an all-size statement.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "existing_checks": [ + { + "scope": "PR #4100: proposed unconditional construction and finite checks, without independent acceptance.", + "evidence": "research/unconditional-batched-crt/README.md", + "remaining": "Independent proof audit of one caller-bound all-size implication; all other premises remain explicit.", + "status": "author-checked", + "source_commit": "337d04939571a637aeab54a0f58f54fde811663a", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Sharp radial phase-covariant Gaussian pair provider, conjugate inverse, complete retained C0/C2 ports and radial envelopes.", + "scope_change_reason": "The prior global-optimum construction lacks phase covariance. Select its ring matching by conserved sum parity and bind the result to the existing explicit backend consumer.", + "bottleneck_link": "Supply the sharp local radial budget with the Gaussian phase and inverse conventions of a real retained port; preserve actual inputs and both arbitrary dirty banks.", + "budget_minutes": 60, + "stop_rule": "Stop at the provider and complete indexed port. No fixed multitape graph, recursive tariff, finite-order or tensor consistency claim.", + "outcome": "completed", + "evidence": "PROOF.md; RESULT.json; pair and phase census, complete signed-width domains, actual native cuts, rational port oracle, exact dirty return and negative controls.", + "author": "Ali Romman", + "ai_assistance": "Substantial OpenAI Codex assistance; no independent human or formal-kernel review claimed.", + "open_questions": [ + { + "question": "Can the full indexed provider and retained ports be lowered to a fixed tape graph at a useful recursive tariff?", + "why_it_matters": "The local radial optimum does not price physical routing, owned backing or recursive services.", + "first_step": "State a signed format and full operation/temporary ledger; retain the actual inverse order and every wrapper.", + "blocked_by": "Physical tape graph and selected recursive pricing are not supplied." + } + ], + "family_decision": { + "decision": "Replace the phase-deficient matching and test one complete existing consumer, then stop at the numerical/indexed contract.", + "sources": "7696@d7be8d9131a948ea1d25833e96906ea3da979764; 6509@a4173e810c4d34a1d13b9745af123ad0ec6cfed5; related 6758@362b20bc934500bc503e850059f0d34daa5dcae3", + "evidence_status": "Author-checked all-input proof and exact finite consumer replay.", + "boundary": "Gaussian pairs on h Z[i]; explicit positive/conjugate-negative providers; source-ordered C0/C2 ports with arbitrary dirty banks and all monomial/mix operations.", + "obligations": { + "phase_and_conjugate_inverse": "proved", + "sharp_pair_radial_budget": "attained; lower theorem from pinned PR7696", + "retained_call_and_port_accuracy": "source premise preserved and actual cuts checked", + "dirty_return": "proved for successful range-valid executions", + "direct_indexed_work": "O(fN*(w+f)) bit work with all source wrappers and auxiliary work", + "fixed_tape_graph": "unknown; not zero", + "accelerated_native_and_selected_caller": "not supplied" + }, + "alternative": "The existing four-axis phase provider has a distinct quotient/error contract; it does not settle this one-pair radial target.", + "construction_gate": "Further lowering needs a physical schedule and a complete paid profile; no selected admission follows here." + } +} diff --git a/research/phase-covariant-radial-ports/VERIFY.json b/research/phase-covariant-radial-ports/VERIFY.json new file mode 100644 index 0000000000..b1fbff5dac --- /dev/null +++ b/research/phase-covariant-radial-ports/VERIFY.json @@ -0,0 +1,34 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Exact source pins, pair symmetries and signed-width domains, actual paid cuts, full rational port error, radial envelopes, dirty return and rejected contract controls." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "-O", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Exact source pins, pair symmetries and signed-width domains, actual paid cuts, full rational port error, radial envelopes, dirty return and rejected contract controls." + } + ] +} diff --git a/research/phase-covariant-radial-ports/kernel.py b/research/phase-covariant-radial-ports/kernel.py new file mode 100644 index 0000000000..bd5ec7c913 --- /dev/null +++ b/research/phase-covariant-radial-ports/kernel.py @@ -0,0 +1,84 @@ +"""Use the optimum ring matching with a phase-covariant parity choice. + +Ali Romman, with substantial OpenAI Codex assistance. Apache-2.0. +Adapted from PR7696's ring map. Layer and call structure follows PR6509. +""" + +def need(value, message): + if not value: + raise ValueError(message) + + +def partner(point, trace): + """Match doubled half-grid coordinates without variable division.""" + x,y=point + r=max(abs(x),abs(y)) + need(x%2==y%2==1, 'Half-grid parity') + if y==r and x>-r: + j=(r-x)//2 + elif x==-r and y>-r: + j=r+(r-y)//2 + elif y==-r and x=2 and type(sign) is int and sign in (-1,1), 'Pair format') + need(len(x)==len(y)==2, 'Gaussian pair') + trace=trace if trace is not None else {} + limit=1 << (width-1) + for value in (*x,*y): + need(type(value) is int and -limit<=value=0 and len(values)>0 and len(values)&(len(values)-1)==0 and (1<=1 and type(axis) is int and axis in (0,2) and len(values)==8**f and type(adjoint) is bool, 'Literal Gaussian call dimensions') + for stage in (range(f-1,-1,-1) if adjoint else range(f)): + layer(values,3*stage+axis,width,-1 if adjoint else 1,trace) + return values diff --git a/research/phase-covariant-radial-ports/oracle.py b/research/phase-covariant-radial-ports/oracle.py new file mode 100644 index 0000000000..ef61f06212 --- /dev/null +++ b/research/phase-covariant-radial-ports/oracle.py @@ -0,0 +1,67 @@ +"""Evaluate the ideal source maps with exact rational arithmetic. + +Ali Romman, with substantial OpenAI Codex assistance. Apache-2.0. +The Gaussian convolution and literal three-bit formulas follow the +PR6509 verifier. They are an algebraic check, not independent review. +""" +from fractions import Fraction as F + + +def add(a,b):return a[0]+b[0],a[1]+b[1] +def sub(a,b):return a[0]-b[0],a[1]-b[1] +def mul(a,b):return a[0]*b[0]-a[1]*b[1],a[0]*b[1]+a[1]*b[0] +def norm2(z):return z[0]*z[0]+z[1]*z[1] +def phase(a,q=1): + for _ in range(q%4):a=(-a[1],a[0]) + return a + + +def ideal_call(values,f,axis,adjoint=False): + sign=-1 if adjoint else 1 + a,b=(F(1,2),F(sign,2)),(F(1,2),F(-sign,2)) + terms=[] + for mask in range(1<>j)&1;index|=bit<<(3*j+axis) + coefficient=mul(coefficient,b if bit else a) + terms.append((index,coefficient)) + return [tuple(sum(mul(c,values[k^shift])[part] for shift,c in terms) for part in (0,1)) for k in range(len(values))] + + +def base_map(name,x): + bits=[(x>>j)&1 for j in range(3)] + if name=='P': + q=sum(bits);bits[2]^=bits[0];q+=sum(bits) + elif name=='Q': + q=sum(bits);bits[0],bits[1]=bits[1],bits[0];q+=sum(bits) + elif name=='W':q=2*(bits[0]+bits[2]) + elif name=='M':bits[0],bits[1]=bits[1],bits[0];q=2*bits[1] + else:raise ValueError('Monomial name') + return sum(b<>(3*j))&7);y|=digit<<(3*j);q+=p + if inverse:out[x]=phase(values[y],-q) + else:out[y]=phase(values[x],q) + return out + + +def ideal_port(x,y,f,kind,reverse): + x=list(x);y=list(y) + def mix(sign): + nonlocal y + p=monomial(x,'P',f);q=monomial(x,'Q',f) + y=[add(v,(sign*(a[0]+2*b[0]),sign*(a[1]+2*b[1]))) for v,a,b in zip(y,p,q)] + if reverse: + if kind==3:y=monomial(y,'M',f,True);y=ideal_call(y,f,2,True);y=monomial(y,'W',f,True) + y=ideal_call(y,f,0,True);mix(-1);x=ideal_call(x,f,0,True) + else: + x=ideal_call(x,f,0);mix(1);y=ideal_call(y,f,0) + if kind==3:y=monomial(ideal_call(monomial(y,'W',f),f,2),'M',f) + return x,y diff --git a/research/phase-covariant-radial-ports/ports.py b/research/phase-covariant-radial-ports/ports.py new file mode 100644 index 0000000000..a9d5d0268f --- /dev/null +++ b/research/phase-covariant-radial-ports/ports.py @@ -0,0 +1,26 @@ +"""Use an explicit numerical backend in the retained complete port. + +Port source: JoyboyBrian / PR5485 and the credited PR4743 lineage. +Interface: Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. +""" +from kernel import need + +def port(x,y,f,kind,reverse,width,backend,source,capture=False): + monomial,mix=source.monomial,source.mix + need(x is not y, 'Distinct dirty banks') + need(kind in (2,3),'two or three calls') + if capture:x=list(x);y=list(y) + trace={};cuts=[] + def paid(v,axis,adj=False): + before=list(v) if capture else None + backend(v,f,axis,width,adj,trace) + if capture:cuts.append((axis,adj,before,list(v))) + if reverse: + if kind==3: + monomial(y,'M',f,width,True);paid(y,2,True);monomial(y,'W',f,width,True) + paid(y,0,True);mix(x,y,f,width,-1);paid(x,0,True) + else: + paid(x,0);mix(x,y,f,width,1);paid(y,0) + if kind==3:monomial(y,'W',f,width);paid(y,2);monomial(y,'M',f,width) + return x,y,trace,cuts + diff --git a/research/phase-covariant-radial-ports/predecessor/NOTICE b/research/phase-covariant-radial-ports/predecessor/NOTICE new file mode 100644 index 0000000000..e5377e3e34 --- /dev/null +++ b/research/phase-covariant-radial-ports/predecessor/NOTICE @@ -0,0 +1,21 @@ +Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. + +JoyboyBrian / PR5485 supplies the retained literal nearest-even C0/C2 calls, +monomial/mixing implementation, complete port schedules, accuracy and width +bounds. PR4743 and its retained native-port/error-channel lineage supply the +underlying ports and external tolerance analysis. These are reused and credited, +not claimed as new constructions or independently re-established theorems. + +Tekalign supplies p104-reversible-lifting, including an earlier exact inverse, +nearest pair-error bound and complete collector cleanup. Arham Tahir supplies +the numerical collision and native-rounding context. Nick Petalas and the +retained precision authors supply unitary error-propagation context. The +native-rounded-loop-defect result is by JoyboyBrian; coherent-frame-additivity +is by Cinna Davis. They retain their separate graph-consistency obstructions. +All copied files keep their notices. + +The new contribution is the conserved-sum, Gaussian-phase-covariant rounding +choice, exact center classification and pointwise optimality proof, complete +port installation, exact fiber-observable contract, controls and direct cost. +Lattice parity, affine rotation and integer lifting are established mathematics. +No historical algorithm, generic reversibility or source port is claimed as new. diff --git a/research/phase-covariant-radial-ports/predecessor/PROOF.md b/research/phase-covariant-radial-ports/predecessor/PROOF.md new file mode 100644 index 0000000000..b7047476aa --- /dev/null +++ b/research/phase-covariant-radial-ports/predecessor/PROOF.md @@ -0,0 +1,242 @@ +# A conserved, reversible nearest Gaussian grid map + +## Object and prior work + +The ideal pair map is + + C_sigma(x,y) = ((s+sigma*i*d)/2, (s-sigma*i*d)/2), + s=x+y, d=x-y, sigma in {-1,1}. + +Inputs are Gaussian integers times a retained grid spacing h=2^-g. The +mathematical proof first sets h=1. The arrays contain stored grid values; +it does not recover information lost by initial quantization of real inputs. + +JoyboyBrian's PR5485 gives a fixed-grid nearest-even implementation, direct +cost and source-ordered error budgets for the actual PR4743 C0/C2 ports. +Tekalign's `p104-reversible-lifting` already gives a nearest-error bijection +and exact paired cleanup. Its pair preserves a rounded midpoint and rotates +the difference. It does not preserve the exact sum. Neither generic integer +lifting nor reversibility alone is new here. `native-rounded-loop-defect` +already distinguishes inverse replay from consistency around a native graph. +The new contract adds exact sums and Gaussian phase covariance, classifies +the optimal centers below, and binds them to both complete port schedules. + +## Construction and exact inverse + +For a Gaussian integer s, choose c(s) as follows: + +- If the real and imaginary parts of s have equal parity, set c=0. +- If the real part is odd and the imaginary part is even, set + c=sign(Re s). +- Otherwise set c=i*sign(Im s). + +The sign in each nonzero case is defined: an odd integer is nonzero. +Set + + d' = sigma*i*(d-c(s)) + c(s), + x' = (s+d')/2, y' = (s-d')/2. + +The sum remains exactly s. Write c=u+iv. A Gaussian integer center gives +integer outputs exactly when + + u+v = Re s+Im s (mod 2). + +To prove this, use d=s modulo2 and compare the two components of +sigma*i*d+(1-sigma*i)c with s modulo2. Both component conditions reduce to +the displayed parity equation. The selected c meets it. The executable +checks that both final numerators are even before the two exact shifts. + +The inverse uses the same sum, the same c(s), and -sigma. It maps +sigma*i*(d-c)+c back to d. Thus the pair is a bijection of the full Gaussian +integer grid, with no stored error bit or history. This is state-map +reversibility, not a reversible tape circuit for the scratch arithmetic. +Four repeated positive +pair maps give identity. The same statements hold for a layer of disjoint +pairs. They do not assert that four complete calls on several axes give +identity: different rounded layers need not commute. + +## Pointwise minimum error and center classification + +Subtract the ideal pair result. The two output errors are + + e = (1-sigma*i)c/2, and -e. + +Their combined squared Euclidean norm is |c|^2. In the affine-on-difference +family above, legal centers have the stated parity. If Re s+Im s is even, +the unique minimum-norm center is zero. If it is odd, the four minimum-norm +centers are 1,-1,i,-i. This classifies every least-error center at every sum; +it is not a search-box conclusion. + +The chosen map has an even stronger pointwise accuracy property. When the +sum parity is even, the ideal outputs are already Gaussian integers and the +map is exact. When it is odd, all four ideal real components are half-integers. +Every grid output then has squared pair error at least4*(1/2)^2=1. Our map +attains1. Thus it is a nearest Euclidean grid point for every input, among +all grid-valued maps, with or without an inverse. Each complex coordinate +error is at most h/sqrt(2), and pair Euclidean error is at most h. These +bounds are sharp at a mixed-parity input. They are not global precision +lower bounds for a different representation or a complete supplier. + +## Exact symmetries and observable channels + +The center rule satisfies c(i*s)=i*c(s) and c(conj(s))=conj(c(s)). Direct +substitution gives global Gaussian-unit phase covariance and conjugacy of +the positive and negative pair maps. Equal inputs are fixed. Zero is fixed. +These properties hold for every magnitude, provided finite words do not +overflow. They also hold through exact monomial maps and integer additions, +so both complete port programs commute with a global Gaussian unit phase. + +For Cj tensor f on N=8^f coordinates, the active bits are3k+j, with j=0 or2. +Each update preserves its pair sum. Fixing all other2f bits defines4^f disjoint +spectator fibers, each of size2^f. Every such fiber sum is preserved exactly +by the complete call. The ideal call has the same property. Its actual error +therefore lies in the kernel of4^f independent complex sum functionals, a +subspace of dimension N-4^f. No claim is made that every vector in that +subspace is attainable as an error. + +If an exact grid monomial R precedes the call and L follows it, the wrapped +result satisfies + + ell * L^-1 * rounded_U(x) = ell * R(x) + +for each of these sum rows ell. Thus the exact observables can be moved +through the actual paid monomial wrappers. Their setup and execution costs +remain payable. This is an explicit completed-call error restriction that +independent coordinate balls do not express. + +## Limits of the invariant + +No map in the displayed family can also commute with pair exchange at every +input. Exchange sends d to -d at fixed s. Commutation would require +(1-sigma*i)c=-(1-sigma*i)c, hence c=0. Mixed-parity sums forbid that center. +Likewise, no center rule in this family can have both common-grid-translation +covariance and global Gaussian phase covariance. The first would give +c(s+2z)=c(s). The second gives c(-s)=-c(s). Taking z=-s forces c=0. +These are restrictions of the stated affine family, not universal exclusions +of every nonlinear or history-carrying program. + +The actual implementation is nonadditive. Its map on inputs(1,0),(0,0) is +identity, while on(2,0),(0,0) it gives(1+i,1-i). It also fails pair exchange +and common translation covariance, as the verifier records. + +Two rounded axes need not commute. On four complex entries with only the +last equal to1, axis0 then axis1 gives + + (-i, 1+i, 1, -1), + +while axis1 then axis0 gives + + (-i, 1, 1+i, -1). + +Both exact linear orders are equal. This is a concrete limitation, not an +assumed one. The inverse of a multi-axis call must reverse its literal stage +order. Independently lowering an ideal inverse or using native graph +identities is not justified. Native graph flatness and full additivity +remain open obligations. + +## Complete-call accuracy and finite words + +Every pair has the same per-coordinate error bound as the retained PR5485 +service. For the exact first k factors on the actual stored input, let delta_k +be the maximum complex-coordinate error. The exact factor has infinity norm +sqrt(2), so + + delta_0=0, + delta_(k+1) <= sqrt(2)*delta_k + h/sqrt(2), + delta_f <= (2^(f/2)-1)/(2-sqrt(2))*h < 2*2^(f/2)*h. + +No independent-error assumption is used. Reverse stage order has the same +bound. The Euclidean field bound is f*sqrt(N/2)*h by unitary propagation. +For completed-call tolerance2^-q, the retained grid choice + + g=q+ceil(f/2)+1 + +still suffices. The pair computation uses sums and differences of grid +integers, two center tags in{-1,0,1}, and two exact final halves. If input +components are bounded by M grid units, its largest raw data numerator is +at most4M+1. This includes the added parity correction. Range checks occur +before each stored arithmetic result; there is no modular wrap or saturation. + +The source port budgets set + +| Port direction | q | +| --- | --- | +| two-call forward | P+f+3 | +| three-call forward | P+ceil(3f/2)+3 | +| two-call reverse | P+ceil(f/2)+2 | +| three-call reverse | P+f+2 | + +They are reused with attribution. The new kernel satisfies their actual-input +error premise, so the full coordinate error remains at most2^-P. For original +coordinate magnitude at most2^H, H>=0, retain + + w=H+g+2f+ceil(f/2)+9 + +signed component bits. To check the additional numerator unit, the source +port entry bound is U=2^(H+2f+4). A native prefix has component magnitude below +3*2^ceil(f/2)*U. In grid units the new numerator is below +192*2^(H+g+2f+ceil(f/2))+1, which is less than the positive w-bit limit +256*2^(H+g+2f+ceil(f/2)). Thus the old width margin covers the new rule. +Initial quantization, if used, keeps its original separate error charge. + +## Complete dirty-port inverse + +`ports.py` is an explicit copy of the retained port body with a backend +argument, exact source monomial/mix dependencies, and a distinct-bank guard. +A static AST check allows only those interface edits. No source function or +class is patched. The exact monomials preserve the grid and have literal +inverses. Each triangular mix leaves its source bank unchanged and is undone +by the opposite addition. Each new Gaussian call is undone by its reversed +stage program. The complete reverse port is precisely these operations in +reverse order. Induction gives exact return of both arbitrary stored dirty +banks, in either composition order. Native error bounds and exact return +are separate statements; neither is inferred from basis vectors alone. + +## Complete direct cost and workspace + +A call executes fN/2 pair operations, including zero pairs. A port with k=2 +or3 calls executes B=kfN/2 pairs. Each pair has10 full-word additions or +subtractions, two exact arithmetic half shifts, two small center-tag additions, +a bounded number of sign/parity/branch operations,16 signed-word checks, +four real reads and four real writes. The trace records the data arithmetic, +range checks and every pair; center selection and control are additional +bounded work, not free oracles. + +Eight signed data words suffice: load four inputs in slots0..3, form the two +sums and two differences in4..7, overwrite0..1 with the corrected numerators +and then their halves, and overwrite2..3 with sum-minus-output. Store0..3 +and clear all eight owned scratch words. The center and signs need a fixed +number of control bits. Initialization and clearing cost O(w) bit writes +per pair and are included in the direct bound. Python locals and oracle +snapshots are semantic instrumentation, not a physical register allocator. + +Both ports also perform the retained two monomial mixing terms:4N real +additions and2N left shifts, plus sign/check work. A two-call port executes +four full monomial wrapper passes; a three-call port executes six. Every +pass builds its N address/phase records in O(fN) word work, traverses the +permutation cycles, and clears its owned route/visited records. Its O(Nf) +control bits and held values are payable. The arrays are updated in place; +no dirty array or error transcript is cleared. + +The complete indexed reference thus has O(fN) bounded-word work and +O(fN*(w+f)) bit work, including ordinary arithmetic, control, indexing, +source reads, writes, allocation and cleanup. Storage is O(N*(w+f)) bits, +including both dirty banks and owned route data. This is not an accelerated +recursive Gaussian tariff or a fixed multitape schedule. Physical routing, +recursive funding, compiler stock and outer admission remain unproved; +unknown costs are not charged zero. + +## Evidence and expansion decision + +The verifier uses a direct Gaussian-rational tensor convolution and a separate +three-bit monomial oracle. It checks all source port directions, actual +inputs at every paid cut, integer round trips, phase covariance, every fiber +sum, exact predecessor ports on aligned inputs, source/format/overflow controls +and the explicit nonlinear failures above. Finite domains corroborate the +all-size proofs; they do not prove them by extrapolation. + +The changed invariant and explicit complete direct bill justify this bounded +interface construction. Further construction requires a caller that can use +the conserved observables and fund the full native/physical implementation. +No kappa, universal native admissibility, scientific acceptance or selected +frontier change follows from this package. diff --git a/research/phase-covariant-radial-ports/predecessor/rounded.py b/research/phase-covariant-radial-ports/predecessor/rounded.py new file mode 100644 index 0000000000..8ae18373f2 --- /dev/null +++ b/research/phase-covariant-radial-ports/predecessor/rounded.py @@ -0,0 +1,123 @@ +"""Fixed-grid Gaussian calls and literal ports; JoyboyBrian, Codex assistance.""" + + +def need(ok,why): + if not ok:raise ValueError(why) + + +def half_even(n): + q=n>>1 + return q+((n&1)&(q&1)) + + +def checkword(n,width): + need(type(n) is int and -(1<<(width-1))<=n<(1<<(width-1)),'signed word overflow') + return n + + +def call(v,f,axis,width,adjoint=False,trace=None): + need(type(f) is int and f>=1 and axis in (0,2) and len(v)==8**f,'literal Gaussian call dimensions') + need(type(width) is int and width>=2,'word width') + for z in v: + need(len(z)==2,'complex pair') + for value in z:checkword(value,width) + trace=trace if trace is not None else {} + for j in range(f): + bit=3*j+axis; step=1<>1) + if name=='P':y=x^(4 if x&1 else 0); q=x.bit_count()+y.bit_count() + elif name=='Q':y=swap;q=x.bit_count()+y.bit_count() + elif name=='W':y=x;q=2*((x&5).bit_count()%2) + else:y=swap;q=2*((y>>1)&1) + perm.append(y);phase.append(q%4) + return perm,phase + + +def rotate(z,q): + a,b=z + return ((a,b),(-b,a),(-a,-b),(b,-a))[q] + + +def route(name,f,inverse=False): + p,q=letters(name) + if inverse: + back=[0]*8;ph=[0]*8 + for x,y in enumerate(p):back[y]=x;ph[y]=-q[x]%4 + p,q=back,ph + out=[] + for x in range(8**f): + y=z=0 + for j in range(f): + a=(x>>(3*j))&7;y|=p[a]<<(3*j);z+=q[a] + out.append((y,z%4)) + return out + + +def monomial(v,name,f,width,inverse=False): + routing=route(name,f,inverse); seen=bytearray(len(v)) + for start in range(len(v)): + if seen[start]:continue + x=start;saved=v[x] + while True: + seen[x]=1;y,q=routing[x];following=v[y] + v[y]=tuple(checkword(z,width) for z in rotate(saved,q));x=y;saved=following + if x==start:break + # These are owned control fields, explicitly returned zero after use. + for i in range(len(seen)):seen[i]=0;routing[i]=(0,0) + + +def mix(t,y,f,width,sign): + for name,coefficient in [('P',1),('Q',2)]: + monomial(t,name,f,width) + for i,((a,b),(c,d)) in enumerate(zip(t,y)): + ca=checkword(a if coefficient==1 else a<<1,width);cb=checkword(b if coefficient==1 else b<<1,width) + y[i]=(checkword(c+sign*ca,width),checkword(d+sign*cb,width)) + monomial(t,name,f,width,True) + + +def port(x,y,f,kind,reverse,width,capture=False): + need(kind in (2,3),'two or three calls') + if capture:x=list(x);y=list(y) + trace={};cuts=[] + def paid(v,axis,adj=False): + before=list(v) if capture else None + call(v,f,axis,width,adj,trace) + if capture:cuts.append((axis,adj,before,list(v))) + if reverse: + if kind==3: + monomial(y,'M',f,width,True);paid(y,2,True);monomial(y,'W',f,width,True) + paid(y,0,True);mix(x,y,f,width,-1);paid(x,0,True) + else: + paid(x,0);mix(x,y,f,width,1);paid(y,0) + if kind==3:monomial(y,'W',f,width);paid(y,2);monomial(y,'M',f,width) + return x,y,trace,cuts + + +def request_bits(P,f,kind,reverse): + need(type(P) is int and P>=0 and type(f) is int and f>=1 and kind in (2,3),'accuracy domain') + if reverse:external=(f+1)//2+2 if kind==2 else f+2 + else:external=f+3 if kind==2 else (3*f+1)//2+3 + return P+external+(f+1)//2+1 + + +def signed_width(H,P,f,kind,reverse): + need(type(H) is int and H>=0,'magnitude domain') + return H+request_bits(P,f,kind,reverse)+2*f+(f+1)//2+9 diff --git a/research/phase-covariant-radial-ports/verify.py b/research/phase-covariant-radial-ports/verify.py new file mode 100644 index 0000000000..e3c093d556 --- /dev/null +++ b/research/phase-covariant-radial-ports/verify.py @@ -0,0 +1,201 @@ +"""Check the phase-covariant provider at the complete retained consumer. + +Ali Romman, with substantial OpenAI Codex assistance. Apache-2.0. +""" +import ast +from fractions import Fraction +import hashlib +import importlib.util +from itertools import product +import json +from math import isqrt +from pathlib import Path +import random +import sys + +HERE=Path(__file__).resolve().parent +sys.path.insert(0,str(HERE)) +from kernel import pair,layer,call,partner,need +from ports import port +from oracle import add,sub,norm2,phase,ideal_call,ideal_port + + +def authenticate(): + rows=json.loads((HERE/'ORIGINS.json').read_text()) + for row in rows: + raw=(HERE/row['path']).read_bytes() + need(len(raw)==row['size'] and hashlib.sha256(raw).hexdigest()==row['sha256'] and hashlib.sha1(b'blob '+str(len(raw)).encode()+b'\0'+raw).hexdigest()==row['git_blob'],'Source bytes') + spec=importlib.util.spec_from_file_location('retained_rounded',HERE/'predecessor/rounded.py') + old=importlib.util.module_from_spec(spec);spec.loader.exec_module(old) + return old,rows + + +def squared(values):return sum(norm2(z) for z in values) +def conjugate(z):return z[0],-z[1] + + +def radial(a,b,f,n): + # abs(sqrt(b)-sqrt(a)) <= f*sqrt(n)/2, by positive squaring. + low,high=sorted((a,b));r=4*(high-low)-f*f*n + return r<=0 or r*r<=16*f*f*n*low + + +def exact_pair_error(x,y,out,sign): + sx,sy=add(x,y);dx,dy=sub(x,y) + target=(sx-sign*dy,sy+sign*dx,sx+sign*dy,sy-sign*dx) + return sum((2*a-b)**2 for a,b in zip((*out[0],*out[1]),target)) + + +def fibers(values,f,axis): + mask=sum(1<<(3*j+axis) for j in range(f));out={} + for i,value in enumerate(values): + key=i&~mask;out[key]=add(out.get(key,(0,0)),value) + return out + + +def port_envelope(out,x,y,f,kind,reverse): + n=len(x);scale=10**60 + # Lower bounds on the right and an upper bound on the left suffice. + left=isqrt(squared(out)*scale*scale)+1 + rhs=isqrt(squared(y)*scale*scale)+3*isqrt(squared(x)*scale*scale) + coefficient=kind-1 if reverse else kind+2 + rhs+=coefficient*f*isqrt(n*scale*scale)//2 + need(left<=rhs,'Full y-bank radial envelope') + + +def refusal(function): + try:function() + except ValueError:return + raise ValueError('Rejected control was accepted') + + +def verify(): + old,pins=authenticate() + # The runtime pair uses only division by the literal two. + tree=ast.parse((HERE/'kernel.py').read_text()) + for node in ast.walk(tree): + if isinstance(node,ast.BinOp) and isinstance(node.op,(ast.Div,ast.FloorDiv,ast.Mod)): + need(isinstance(node.right,ast.Constant) and node.right.value==2,'No variable data division') + ring_checks=0 + for r in range(1,130,2): + cycle=[];x,y=r,r + for dx,dy in [(-2,0),(0,-2),(2,0),(0,2)]: + for _ in range(r):cycle.append((x,y));x+=dx;y+=dy + for j,u in enumerate(cycle): + v=partner(u,{}) + need(v==cycle[j^1],'Retained individual-ring matching') + need(partner((u[0],-u[1]),{})==(v[0],-v[1]),'Horizontal reflection') + need(partner((-u[0],-u[1]),{})==(-v[0],-v[1]),'Half turn') + ring_checks+=1 + pair_count=phase_count=0 + for values in product(range(-4,5),repeat=4): + x,y=values[:2],values[2:] + for sign in (-1,1): + out=pair(x,y,16,sign) + need(add(*out)==add(x,y),'Exact sum') + need(exact_pair_error(x,y,out,sign)==4*(sum(values)%2),'Pointwise least Gaussian error') + need(pair(*out,16,-sign)==(x,y),'Pair inverse') + need(pair(conjugate(x),conjugate(y),16,sign)==tuple(map(conjugate,pair(x,y,16,-sign))),'Conjugate inverse') + need(pair(y,x,16,sign)==out[::-1],'Pair exchange') + need(pair(add(x,(3,-2)),add(y,(3,-2)),16,sign)==tuple(add(z,(3,-2)) for z in out),'Common translation') + need(radial(norm2(x)+norm2(y),squared(out),1,2),'Sharp pair radial bound') + for q in range(4): + need(pair(phase(x,q),phase(y,q),16,sign)==tuple(phase(z,q) for z in out),'All Gaussian phases');phase_count+=1 + pair_count+=1 + widths={} + for width in (2,3,4): + limit=1 << (width-1);fitting=rejected=0 + for z in product(range(-limit,limit),repeat=4): + for sign in (-1,1): + wide=pair(z[:2],z[2:],width+6,sign) + fits=all(-limit<=v Date: Wed, 18 Nov 2026 06:42:48 -0500 Subject: [PATCH 2/2] Keep radial and work formulas literal in the rendered README --- research/phase-covariant-radial-ports/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/research/phase-covariant-radial-ports/README.md b/research/phase-covariant-radial-ports/README.md index ab15ece1f7..82f993738e 100644 --- a/research/phase-covariant-radial-ports/README.md +++ b/research/phase-covariant-radial-ports/README.md @@ -19,18 +19,18 @@ Read [PROOF.md](PROOF.md), [RESULT.json](RESULT.json), the ## Radial and implementation contract -For N=8^f, put D=f*h*sqrt(N)/2. A complete native call changes the field +For N=8^f, put `D=f*h*sqrt(N)/2`. A complete native call changes the field norm by at most D in absolute value. For entry-bank norms X,Y, the full k-call forward port has output norms at most X+D and Y+3X+(k+2)D. The reverse port has bounds X+D and Y+3X+(k-1)D. The per-layer bound is sharp; the complete-call and port bounds are sufficient, with no claim -of optimality. Approximation error remains f*h*sqrt(N/2) per call. +of optimality. Approximation error remains `f*h*sqrt(N/2)` per call. The pair implementation uses fixed comparisons, signs, parities and exact halves. It uses no variable data division or growing lookup. Stored words use the retained signed width w; a constant number of w+6 auxiliary words suffice. Their work and storage are included. The complete indexed bounds -are O(fN*(w+f)) bit work and O(N*(w+f)) stored bits, with every native pair, +are `O(fN*(w+f))` bit work and `O(N*(w+f))` stored bits, with every native pair, source wrapper, addition, range check and owned route/auxiliary cleanup. These are not exact tape-transition counts or a measured speedup.