From e948d394780f6b5e08ce3edeb53422edde1ddfc8 Mon Sep 17 00:00:00 2001 From: Ali Romman <226877337+aliromman@users.noreply.github.com> Date: Wed, 18 Nov 2026 01:26:56 -0500 Subject: [PATCH 1/3] Prove a stronger exact-sum Gaussian rounding obstruction --- .../MATCHING.json | 222 ++++++++++++++++++ .../PROOF.md | 117 +++++++++ .../README.md | 74 ++++++ .../RESULT.json | 170 ++++++++++++++ .../SOURCES.json | 25 ++ .../TASK.json | 83 +++++++ .../VERIFY.json | 34 +++ .../verify.py | 150 ++++++++++++ 8 files changed, 875 insertions(+) create mode 100644 research/gaussian-exact-sum-next-obstruction/MATCHING.json create mode 100644 research/gaussian-exact-sum-next-obstruction/PROOF.md create mode 100644 research/gaussian-exact-sum-next-obstruction/README.md create mode 100644 research/gaussian-exact-sum-next-obstruction/RESULT.json create mode 100644 research/gaussian-exact-sum-next-obstruction/SOURCES.json create mode 100644 research/gaussian-exact-sum-next-obstruction/TASK.json create mode 100644 research/gaussian-exact-sum-next-obstruction/VERIFY.json create mode 100644 research/gaussian-exact-sum-next-obstruction/verify.py diff --git a/research/gaussian-exact-sum-next-obstruction/MATCHING.json b/research/gaussian-exact-sum-next-obstruction/MATCHING.json new file mode 100644 index 0000000000..baab6c1877 --- /dev/null +++ b/research/gaussian-exact-sum-next-obstruction/MATCHING.json @@ -0,0 +1,222 @@ +[ + { + "input": [ + -2, + 0 + ], + "output": [ + 1, + -2 + ] + }, + { + "input": [ + -1, + -2 + ], + "output": [ + 2, + -2 + ] + }, + { + "input": [ + -1, + -1 + ], + "output": [ + 2, + -1 + ] + }, + { + "input": [ + -1, + 0 + ], + "output": [ + 1, + -1 + ] + }, + { + "input": [ + -1, + 1 + ], + "output": [ + 0, + -2 + ] + }, + { + "input": [ + -1, + 2 + ], + "output": [ + -2, + -1 + ] + }, + { + "input": [ + 0, + -2 + ], + "output": [ + 3, + 0 + ] + }, + { + "input": [ + 0, + -1 + ], + "output": [ + 2, + 0 + ] + }, + { + "input": [ + 0, + 0 + ], + "output": [ + 1, + 0 + ] + }, + { + "input": [ + 0, + 1 + ], + "output": [ + 0, + -1 + ] + }, + { + "input": [ + 0, + 2 + ], + "output": [ + -1, + -1 + ] + }, + { + "input": [ + 1, + -2 + ], + "output": [ + 2, + 1 + ] + }, + { + "input": [ + 1, + -1 + ], + "output": [ + 1, + 1 + ] + }, + { + "input": [ + 1, + 0 + ], + "output": [ + 0, + 0 + ] + }, + { + "input": [ + 1, + 1 + ], + "output": [ + -1, + 0 + ] + }, + { + "input": [ + 1, + 2 + ], + "output": [ + -2, + 0 + ] + }, + { + "input": [ + 2, + -2 + ], + "output": [ + 2, + 2 + ] + }, + { + "input": [ + 2, + -1 + ], + "output": [ + 1, + 2 + ] + }, + { + "input": [ + 2, + 0 + ], + "output": [ + 0, + 1 + ] + }, + { + "input": [ + 2, + 1 + ], + "output": [ + -1, + 1 + ] + }, + { + "input": [ + 2, + 2 + ], + "output": [ + -2, + 1 + ] + }, + { + "input": [ + 3, + 0 + ], + "output": [ + 0, + 2 + ] + } +] diff --git a/research/gaussian-exact-sum-next-obstruction/PROOF.md b/research/gaussian-exact-sum-next-obstruction/PROOF.md new file mode 100644 index 0000000000..3213ca76dc --- /dev/null +++ b/research/gaussian-exact-sum-next-obstruction/PROOF.md @@ -0,0 +1,117 @@ +# Exact-sum rounding needs forward slack at least sqrt(13)-3 + +Let G=Z[i]. For x,y in G, put s=x+y, d=x-y and +C_+(x,y)=((s+i*d)/2,(s-i*d)/2). Use the Euclidean norm on G^2. +Let F:G^2 -> G^2 be injective, preserve s exactly, and satisfy +||F(z)-C_+(z)|| <= 1 at every input. Define its forward slack as +sup_z max(0,||F(z)||-||z||). + +**Theorem.** The forward slack is at least beta=sqrt(13)-3. +On the finite sum-one domain with squared norm at most 13, beta is the +exact minimum. No period, phase covariance, square identity, inverse +contract or surjectivity is assumed. + +This improves the necessary bound alpha=sqrt(5)-sqrt(3) from +[Nick Petalas's PR #7652](https://github.com/CrocSwap/integer-mult-bounds/pull/7652). +That proof supplies the question and the candidate formula. The formula +is derived again below. The new obstruction has 18 inputs and 16 neighbors. +The equality certificate covers all 22 inputs of the larger finite domain. + +## Complete candidate sets + +In the sum-one fiber write x=a+i*b and y=1-x. The squared pair norm is +N(a,b)=a^2+(1-a)^2+2*b^2. The first ideal output is +(1/2-b)+i*(a-1/2). Exact sum makes the second output one minus the first. +If the first output is c+i*e, the pair error squared is +((2*c-1+2*b)^2+(2*e-2*a+1)^2)/2. +Both terms inside the squares are odd integers. Error at most one holds +exactly when both terms have absolute value one. Thus the complete legal +candidate set is {-b,1-b} x {a-1,a}. All four candidates have error one. +This argument excludes every other Gaussian-integer output, not only +outputs in a search box. + +## The Hall obstruction + +Put B={ (a,b):N(a,b)<=9 } and S=B union {(-2,0),(3,0)}. +The two extra inputs have squared norm 13. The rows below give every +output squared norm for each input of S; repeated output norms do not +mean repeated vertices. + +| Input squared norm | Number of inputs in S | Candidate output squared norms | Allowed norms at slack strictly below beta | +| ---: | ---: | --- | --- | +| 1 | 2 | 1,1,3,3 | 1 | +| 3 | 4 | 1,3,5,7 | 1,3,5 | +| 5 | 2 | 3,3,9,9 | 3 | +| 7 | 4 | 3,7,9,13 | 3,7,9 | +| 9 | 4 | 5,7,13,15 | 5,7 | +| 13 | 2 | 9,9,19,19 | 9 | + +There are 16 points in B and 18 points in S. Every allowed output in +the last column belongs to B. In fact the union of the strict candidate +sets equals B, as the explicit certificate checks. Therefore a map with +slack below beta sends 18 distinct inputs into at most 16 distinct outputs. +It cannot be injective. This proves the lower bound on the entire domain. + +All comparisons in the table are strict except the omitted 9 -> 13 gap, +which equals beta. They can be checked by positive squaring. For a useful +rational separation, 0.60 < beta < 0.61; all other allowed positive gaps +in this table are below 0.51, and all excluded positive gaps are above 0.73. +The verifier uses tighter rational brackets and an integer square test, +with no floating-point comparison. + +The conclusion applies even if the map has arbitrary behavior off S. +It does not claim that beta is attained on all of G^2. + +## Equality on the complete finite domain + +The domain D={ (a,b):N(a,b)<=13 } has 22 inputs. The inequalities in N +imply -2<=a<=3 and -2<=b<=2, so enumeration of this box is complete. +[MATCHING.json](MATCHING.json) gives one output for every point of D. +All outputs are distinct. Each output is one of the four legal candidates, +and each radial gap is at most beta. At least one 9 -> 13 edge is present. +The Hall lower bound and this explicit matching prove the exact finite +optimum. The four inputs in D minus S have not been omitted from this +attainment statement. + +For an independent geometric check, write the input as +(a,b,1-a,-b). Twice the ideal output is H times this real vector, where + +```text +H = [ 1 -1 1 1 ] + [ 1 1 -1 1 ] + [ 1 1 1 -1 ] + [-1 1 1 1 ]. +``` + +The verifier checks H^T H=4I and computes every error directly with this +matrix. A separate augmenting-path search gives maximum matching sizes +20 below beta and 22 at beta on D. This search does not read the retained +matching as a search guide. The written Hall proof and explicit matching +suffice without trusting a maximum-matching implementation. + +## Exact comparison and scope + +For integers A,B>=0 and positive p/q, set r=(B-A)*q^2-p^2. +Then sqrt(B)-sqrt(A)<=p/q exactly when r<=0 or +r^2<=4*A*p^2*q^2. This follows by moving the nonnegative radical term +and squaring only when its other side is positive. +The verifier brackets beta between +605551275463989293/10^18 and 605551275463989294/10^18. +Every non-tied edge is separated from this interval; the ties have +(A,B)=(9,13). Thus the complete edge decisions are exact. + +The lower bound alpha from PR #7652 is below 0.51, while beta is above +0.60. This is a stricter necessary global bound, not only a larger +finite census. PR #7570 gives the distinct global upper bound +sqrt(19)-sqrt(13) for a class with a square-to-swap identity. That source +proof was read but its verifier was not run here. Global attainment for +the present weaker class, a physical map, precision/range bounds, inverse +behavior, a caller and all implementation costs remain open. There is +no change to kappa or any of the five selected assumptions. + +Prepared by Ali Romman with substantial OpenAI Codex assistance. +Credit Nick Petalas for PR #7652, Jerry Chen for the fixed-sum matching +context in PR #7570, and Ali Romman for the ideal pair in PR #6509. +The finite witness, matching and verifier here are new. No source code +was copied. Apache-2.0. Independent human and formal-kernel review are +not claimed. diff --git a/research/gaussian-exact-sum-next-obstruction/README.md b/research/gaussian-exact-sum-next-obstruction/README.md new file mode 100644 index 0000000000..4f685e1dfd --- /dev/null +++ b/research/gaussian-exact-sum-next-obstruction/README.md @@ -0,0 +1,74 @@ +# A stronger exact-sum Gaussian rounding obstruction + +Every injective, exact-sum Gaussian-pair rounder with Euclidean error +at most one needs forward norm slack at least **sqrt(13)-3** (about +0.605551275464). This raises the necessary bound sqrt(5)-sqrt(3) +(about 0.504017169931) in [PR #7652](https://github.com/CrocSwap/integer-mult-bounds/pull/7652). +Eighteen inputs have only sixteen legal outputs below the new threshold. +An explicit matching attains it on all 22 sum-one inputs with squared +norm at most 13. No period or square identity is assumed. + +This is a scoped proof with an exact finite certificate. Read +[PROOF.md](PROOF.md), [MATCHING.json](MATCHING.json) and +[RESULT.json](RESULT.json). Global attainment is not proved. No new +kappa, supplier admission or selected-assumption discharge is claimed. + +## Evidence and reproduction + +Use CPython 3.12 and its standard library from the repository root. + +```sh +python3.12 -I -W error -B research/gaussian-exact-sum-next-obstruction/verify.py +python3.12 -I -W error -B -O research/gaussian-exact-sum-next-obstruction/verify.py +python3.12 -B scripts/research_package.py --package research/gaussian-exact-sum-next-obstruction +python3.12 -B scripts/check_research_commit.py --package research/gaussian-exact-sum-next-obstruction --check-source-history --check-modes +``` + +Expected statuses are PASS_GAUSSIAN_EXACT_SUM_NEXT_OBSTRUCTION, +PASS_REGISTERED_RESEARCH_PACKAGE and PASS_RESEARCH_COMMIT_BYTES. +The verifier checks all 88 legal edges, the complete Hall neighborhood, +the 22-edge matching, direct four-coordinate Gaussian errors, exact root +comparisons, two maximum-matching sizes and four rejection controls. +The receipt is checked in normal and optimized modes. No predecessor +scientific replay, selected cold replay, Lean or Docker run is required +or claimed. Independent human and formal-kernel review remain open. + +## Source and overlap + +The package starts from canonical main +`e54523517d0f03e58352e647c403a5af3e525a57`, with priority revision 8 and +selected PR #7000 unchanged. [SOURCES.json](SOURCES.json) pins the task, +selected record and the predecessor question. The predecessor is +[PR #7652 at 317fecee459888f4e4fecd8ca62adeb7583f696d](https://github.com/petalas/integer-mult-bounds/blob/317fecee459888f4e4fecd8ca62adeb7583f696d/research/gaussian-exact-sum-forward-slack/README.md). +Its candidate formula is derived again in the proof; no source code is +copied. The verifier needs no predecessor file at run time. + +The overlap pass covered 972 open PR bodies, 6175 closed PR bodies and +7603 Discussion records, with complete remote pagination on 2026-11-18. +The sparse local note search covered 106 of 10178 tracked notes, so this +is not a complete novelty certificate. The live handoff had no competing +reply before the [advance claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19702072). +PR #7651 concerns an unrestricted four-coordinate graph. PR #7570 adds +a square-to-swap identity. PR #7572 already treats affine-period slack; +that idea was dropped before this investigation. + +## Open next questions + +Can a global exact-sum injection attain the new threshold, or must it +have greater slack? First seek a structural matching or Hall argument +that treats the whole sum-one lattice. A larger successful finite check +alone does not answer this question. A physical implementation would +also need an inverse/caller contract, a range proof and a complete cost +invoice. [TASK.json](TASK.json) records these obligations. + +## Credit + +Prepared by Ali Romman with substantial OpenAI Codex assistance. +Nick Petalas supplied the lower-bound question and candidate formula in +[PR #7652](https://github.com/CrocSwap/integer-mult-bounds/pull/7652). +Jerry Chen supplied the fixed-sum matching context in +[PR #7570](https://github.com/CrocSwap/integer-mult-bounds/pull/7570). +Ali Romman supplied the ideal Gaussian pair in +[PR #6509](https://github.com/CrocSwap/integer-mult-bounds/pull/6509). +The new obstruction does not require the extra order identity of PR #7570. +New work is Apache-2.0; the repository license applies. diff --git a/research/gaussian-exact-sum-next-obstruction/RESULT.json b/research/gaussian-exact-sum-next-obstruction/RESULT.json new file mode 100644 index 0000000000..79ad2aac41 --- /dev/null +++ b/research/gaussian-exact-sum-next-obstruction/RESULT.json @@ -0,0 +1,170 @@ +{ + "all_error_one_edges": 88, + "ball_inputs": 22, + "claim": "global forward slack >= sqrt(13)-3; exact optimum on N<=13", + "fault_controls": [ + "collision", + "missing input", + "illegal error", + "strict threshold" + ], + "hall_inputs": 18, + "hall_inputs_explicit": [ + [ + -2, + 0 + ], + [ + -1, + -1 + ], + [ + -1, + 0 + ], + [ + -1, + 1 + ], + [ + 0, + -2 + ], + [ + 0, + -1 + ], + [ + 0, + 0 + ], + [ + 0, + 1 + ], + [ + 0, + 2 + ], + [ + 1, + -2 + ], + [ + 1, + -1 + ], + [ + 1, + 0 + ], + [ + 1, + 1 + ], + [ + 1, + 2 + ], + [ + 2, + -1 + ], + [ + 2, + 0 + ], + [ + 2, + 1 + ], + [ + 3, + 0 + ] + ], + "hall_shell_counts": { + "1": 2, + "3": 4, + "5": 2, + "7": 4, + "9": 4, + "13": 2 + }, + "root_bracket_denominator": 1000000000000000000, + "root_bracket_numerators": [ + 605551275463989293, + 605551275463989294 + ], + "status": "PASS_GAUSSIAN_EXACT_SUM_NEXT_OBSTRUCTION", + "strict_matching_size": 20, + "strict_neighbors": 16, + "strict_neighbors_explicit": [ + [ + -1, + -1 + ], + [ + -1, + 0 + ], + [ + -1, + 1 + ], + [ + 0, + -2 + ], + [ + 0, + -1 + ], + [ + 0, + 0 + ], + [ + 0, + 1 + ], + [ + 0, + 2 + ], + [ + 1, + -2 + ], + [ + 1, + -1 + ], + [ + 1, + 0 + ], + [ + 1, + 1 + ], + [ + 1, + 2 + ], + [ + 2, + -1 + ], + [ + 2, + 0 + ], + [ + 2, + 1 + ] + ], + "threshold_edges": 4, + "threshold_matching_size": 22 +} diff --git a/research/gaussian-exact-sum-next-obstruction/SOURCES.json b/research/gaussian-exact-sum-next-obstruction/SOURCES.json new file mode 100644 index 0000000000..72f2f352de --- /dev/null +++ b/research/gaussian-exact-sum-next-obstruction/SOURCES.json @@ -0,0 +1,25 @@ +{ + "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" + }, + { + "path": "research/gaussian-exact-sum-forward-slack/README.md", + "usage": "provenance", + "pin": "head:317fecee459888f4e4fecd8ca62adeb7583f696d:research/gaussian-exact-sum-forward-slack/README.md", + "git_blob": "3fe489cbb6a3373952a7ff0d10749e2470184520", + "sha256": "2261b26dee2a3b6c698428ba52c80fdf5cd196b697f49e1d53c9a388fe72a7b4" + } + ] +} diff --git a/research/gaussian-exact-sum-next-obstruction/TASK.json b/research/gaussian-exact-sum-next-obstruction/TASK.json new file mode 100644 index 0000000000..814be4b71d --- /dev/null +++ b/research/gaussian-exact-sum-next-obstruction/TASK.json @@ -0,0 +1,83 @@ +{ + "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": "Prove a stronger necessary forward slack for exact-sum error-one Gaussian rounding, and certify the exact finite optimum through squared norm 13.", + "scope_change_reason": "The live PR7652 handoff asks whether a different finite sum-one neighborhood forces a larger slack. This is a precision-contract obstruction, not a full selected transfer audit.", + "bottleneck_link": "The native precision contract must permit forward norm growth. This proof excludes all exact-sum injective error-one maps below the stated slack, without assuming an implementation invoice.", + "budget_minutes": 60, + "stop_rule": "Stop at the first new proved threshold; do not count larger passing censuses as results.", + "outcome": "completed", + "evidence": "PROOF.md; MATCHING.json; RESULT.json; exact normal/optimized verifier and independent geometric and matching paths.", + "author": "Ali Romman", + "ai_assistance": "Substantial OpenAI Codex assistance; no independent human or formal-kernel review claimed.", + "open_questions": [ + { + "question": "Can an all-lattice exact-sum error-one injection attain sqrt(13)-3?", + "why_it_matters": "It decides whether the new necessary norm allowance is sufficient before physical construction.", + "first_step": "Seek a uniform matching or a structural Hall obstruction on the sum-one lattice, rather than only increasing a finite radius.", + "blocked_by": "No all-lattice construction or sharp global lower bound is known in this package; physical and caller costs remain unknown." + } + ] +} diff --git a/research/gaussian-exact-sum-next-obstruction/VERIFY.json b/research/gaussian-exact-sum-next-obstruction/VERIFY.json new file mode 100644 index 0000000000..4007d9a58f --- /dev/null +++ b/research/gaussian-exact-sum-next-obstruction/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": 60, + "checks": "Complete Hall witness, exact threshold comparisons, all 22 matching edges, direct Gaussian matrix check, separate augmenting paths and four rejection controls." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "-O", + "{package}/verify.py" + ], + "timeout_seconds": 60, + "checks": "Complete Hall witness, exact threshold comparisons, all 22 matching edges, direct Gaussian matrix check, separate augmenting paths and four rejection controls." + } + ] +} diff --git a/research/gaussian-exact-sum-next-obstruction/verify.py b/research/gaussian-exact-sum-next-obstruction/verify.py new file mode 100644 index 0000000000..b28d91f59e --- /dev/null +++ b/research/gaussian-exact-sum-next-obstruction/verify.py @@ -0,0 +1,150 @@ +#!/usr/bin/env python3 +"""Check the complete Hall witness and matching with integer arithmetic. + +Ali Romman, with substantial OpenAI Codex assistance. Apache-2.0. +""" +from collections import Counter +from copy import deepcopy +from itertools import product +import json +from pathlib import Path + +ROOT = Path(__file__).resolve().parent +DEN = 10**18 +LOW = 605551275463989293 +HIGH = LOW + 1 +H = ((1, -1, 1, 1), (1, 1, -1, 1), + (1, 1, 1, -1), (-1, 1, 1, 1)) + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def norm(z): + a, b = z + return a*a + (1-a)*(1-a) + 2*b*b + + +def candidates(z): + a, b = z + return set(product((-b, 1-b), (a-1, a))) + + +def gap_at_most(a, b, numerator): + """Compare sqrt(b)-sqrt(a) with the positive rational numerator/DEN.""" + remainder = (b-a)*DEN**2 - numerator**2 + return remainder <= 0 or remainder**2 <= 4*a*numerator**2*DEN**2 + + +def category(a, b): + """Return -1, 0 or 1 for a gap below, at or above sqrt(13)-3.""" + if (a, b) == (9, 13): + return 0 + if gap_at_most(a, b, LOW): + return -1 + require(not gap_at_most(a, b, HIGH), 'unresolved root comparison') + return 1 + + +def direct_edges(z): + """Use the four real coordinates of the ideal pair as a second path.""" + a, b = z + source = (a, b, 1-a, -b) + twice_ideal = tuple(sum(row[j]*source[j] for j in range(4)) for row in H) + edges = set() + for c, e in product(range(-4, 5), repeat=2): + target = (c, e, 1-c, -e) + squared_error_times_four = sum((2*t-v)**2 for t, v in zip(target, twice_ideal)) + if squared_error_times_four <= 4: + require(squared_error_times_four == 4, 'mixed-sum error must be one') + edges.add((c, e)) + return edges + + +def validate_matching(rows, vertices, strict=False): + inputs = [tuple(row['input']) for row in rows] + outputs = [tuple(row['output']) for row in rows] + require(len(inputs) == len(set(inputs)) and set(inputs) == vertices, + 'input coverage') + require(len(outputs) == len(set(outputs)), 'output collision') + for u, v in zip(inputs, outputs): + require(v in direct_edges(u), 'illegal Gaussian edge') + require(category(norm(u), norm(v)) < (0 if strict else 1), + 'radial threshold') + + +def maximum_matching(vertices, edges): + """Check the graph by augmenting paths without the retained matching.""" + owner = {} + + def augment(u, visited): + for v in sorted(edges[u]): + if v in visited: + continue + visited.add(v) + if v not in owner or augment(owner[v], visited): + owner[v] = u + return True + return False + + for u in sorted(vertices): + augment(u, set()) + return len(owner) + + +def verify(): + require((3*DEN+LOW)**2 < 13*DEN**2 < (3*DEN+HIGH)**2, 'root bracket') + require(all(sum(H[k][i]*H[k][j] for k in range(4)) == (4 if i == j else 0) + for i in range(4) for j in range(4)), 'ideal pair isometry') + vertices = {z for z in product(range(-4, 5), repeat=2) if norm(z) <= 13} + witness = {z for z in vertices if norm(z) <= 9} | {(-2, 0), (3, 0)} + expected_neighbors = {z for z in vertices if norm(z) <= 9} + strict, weak = {}, {} + for u in vertices: + formula = candidates(u) + require(formula == direct_edges(u), 'candidate formula differs from ideal map') + strict[u] = {v for v in formula if category(norm(u), norm(v)) == -1} + weak[u] = {v for v in formula if category(norm(u), norm(v)) <= 0} + neighbors = set().union(*(strict[u] for u in witness)) + require(neighbors == expected_neighbors, 'complete strict neighborhood') + require((len(vertices), len(witness), len(neighbors)) == (22, 18, 16), 'Hall counts') + rows = json.loads((ROOT/'MATCHING.json').read_text()) + validate_matching(rows, vertices) + require(maximum_matching(vertices, strict) == 20, 'strict matching size') + require(maximum_matching(vertices, weak) == 22, 'threshold matching size') + faults = [] + bad = deepcopy(rows); bad[0]['output'] = bad[1]['output'] + faults.append(('collision', bad, False)) + faults.append(('missing input', rows[1:], False)) + bad = deepcopy(rows); bad[0]['output'] = [99, 99] + faults.append(('illegal error', bad, False)) + faults.append(('strict threshold', rows, True)) + for name, bad, strict_flag in faults: + try: + validate_matching(bad, vertices, strict_flag) + except ValueError: + pass + else: + raise ValueError('control was not rejected: '+name) + output = { + 'status': 'PASS_GAUSSIAN_EXACT_SUM_NEXT_OBSTRUCTION', + 'claim': 'global forward slack >= sqrt(13)-3; exact optimum on N<=13', + 'ball_inputs': len(vertices), 'hall_inputs': len(witness), + 'strict_neighbors': len(neighbors), 'strict_matching_size': 20, + 'threshold_matching_size': 22, 'all_error_one_edges': 4*len(vertices), + 'threshold_edges': sum(len(weak[u]-strict[u]) for u in vertices), + 'hall_shell_counts': dict(sorted(Counter(map(norm, witness)).items())), + 'hall_inputs_explicit': sorted(witness), 'strict_neighbors_explicit': sorted(neighbors), + 'root_bracket_numerators': [LOW, HIGH], 'root_bracket_denominator': DEN, + 'fault_controls': [name for name, _, _ in faults], + } + retained = ROOT/'RESULT.json' + require(json.loads(retained.read_text()) == json.loads(json.dumps(output)), + 'retained receipt differs') + return output + + +if __name__ == '__main__': + print(json.dumps(verify(), sort_keys=True, indent=2)) From 424273b0c82886d93526548faa0cbdd56ca3216b Mon Sep 17 00:00:00 2001 From: Ali Romman <226877337+aliromman@users.noreply.github.com> Date: Wed, 18 Nov 2026 01:28:07 -0500 Subject: [PATCH 2/3] Retain the exact predecessor question for standalone replay --- .../LICENSE | 201 ++++++++++++++++++ .../PREDECESSOR.json | 11 + .../README.md | 8 +- .../SOURCES.json | 7 - .../predecessor/README.md | 125 +++++++++++ .../verify.py | 9 + 6 files changed, 351 insertions(+), 10 deletions(-) create mode 100644 research/gaussian-exact-sum-next-obstruction/LICENSE create mode 100644 research/gaussian-exact-sum-next-obstruction/PREDECESSOR.json create mode 100644 research/gaussian-exact-sum-next-obstruction/predecessor/README.md diff --git a/research/gaussian-exact-sum-next-obstruction/LICENSE b/research/gaussian-exact-sum-next-obstruction/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/gaussian-exact-sum-next-obstruction/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/gaussian-exact-sum-next-obstruction/PREDECESSOR.json b/research/gaussian-exact-sum-next-obstruction/PREDECESSOR.json new file mode 100644 index 0000000000..7c13236f6c --- /dev/null +++ b/research/gaussian-exact-sum-next-obstruction/PREDECESSOR.json @@ -0,0 +1,11 @@ +{ + "repository": "petalas/integer-mult-bounds", + "commit": "317fecee459888f4e4fecd8ca62adeb7583f696d", + "path": "research/gaussian-exact-sum-forward-slack/README.md", + "url": "https://github.com/petalas/integer-mult-bounds/blob/317fecee459888f4e4fecd8ca62adeb7583f696d/research/gaussian-exact-sum-forward-slack/README.md", + "git_blob": "3fe489cbb6a3373952a7ff0d10749e2470184520", + "sha256": "2261b26dee2a3b6c698428ba52c80fdf5cd196b697f49e1d53c9a388fe72a7b4", + "retained_path": "predecessor/README.md", + "role": "Exact source question and credit; the mathematical argument and executable checks are self-contained.", + "license": "Apache-2.0" +} diff --git a/research/gaussian-exact-sum-next-obstruction/README.md b/research/gaussian-exact-sum-next-obstruction/README.md index 4f685e1dfd..aefd13e20e 100644 --- a/research/gaussian-exact-sum-next-obstruction/README.md +++ b/research/gaussian-exact-sum-next-obstruction/README.md @@ -37,11 +37,13 @@ or claimed. Independent human and formal-kernel review remain open. The package starts from canonical main `e54523517d0f03e58352e647c403a5af3e525a57`, with priority revision 8 and -selected PR #7000 unchanged. [SOURCES.json](SOURCES.json) pins the task, -selected record and the predecessor question. The predecessor is +selected PR #7000 unchanged. [SOURCES.json](SOURCES.json) pins the task and selected record. +[PREDECESSOR.json](PREDECESSOR.json) pins the exact retained source question +and its credit. The predecessor is [PR #7652 at 317fecee459888f4e4fecd8ca62adeb7583f696d](https://github.com/petalas/integer-mult-bounds/blob/317fecee459888f4e4fecd8ca62adeb7583f696d/research/gaussian-exact-sum-forward-slack/README.md). Its candidate formula is derived again in the proof; no source code is -copied. The verifier needs no predecessor file at run time. +copied. The exact predecessor README is retained in this package, with a hash +check and license. No external Git object is needed at run time. The overlap pass covered 972 open PR bodies, 6175 closed PR bodies and 7603 Discussion records, with complete remote pagination on 2026-11-18. diff --git a/research/gaussian-exact-sum-next-obstruction/SOURCES.json b/research/gaussian-exact-sum-next-obstruction/SOURCES.json index 72f2f352de..5335fa97d9 100644 --- a/research/gaussian-exact-sum-next-obstruction/SOURCES.json +++ b/research/gaussian-exact-sum-next-obstruction/SOURCES.json @@ -13,13 +13,6 @@ "usage": "provenance", "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" - }, - { - "path": "research/gaussian-exact-sum-forward-slack/README.md", - "usage": "provenance", - "pin": "head:317fecee459888f4e4fecd8ca62adeb7583f696d:research/gaussian-exact-sum-forward-slack/README.md", - "git_blob": "3fe489cbb6a3373952a7ff0d10749e2470184520", - "sha256": "2261b26dee2a3b6c698428ba52c80fdf5cd196b697f49e1d53c9a388fe72a7b4" } ] } diff --git a/research/gaussian-exact-sum-next-obstruction/predecessor/README.md b/research/gaussian-exact-sum-next-obstruction/predecessor/README.md new file mode 100644 index 0000000000..3fe489cbb6 --- /dev/null +++ b/research/gaussian-exact-sum-next-obstruction/predecessor/README.md @@ -0,0 +1,125 @@ +# Forward radial slack for exact-sum Gaussian rounding + +Any injective rounding of the ideal Gaussian pair that preserves the sum +and has Euclidean error at most one must have forward outward norm slack at +least $\sqrt5-\sqrt3$. Eight inputs in the sum-one fiber suffice. Below +that threshold they have six distinct legal outputs. At equality they have +an explicit matching, so the bound is sharp on these eight inputs. + +This is a scoped proof with an exact finite witness. It gives a necessary +bound on the whole Gaussian-integer domain for the exact-sum contract. +Global attainment remains open. The proof uses injectivity, exact sum and +the error cap. It applies to maps with arbitrary behavior outside the eight +inputs and makes no assumption about the inverse or powers of the map. + +## Proof + +Let $x,y\in\mathbb Z[i]$, $s=x+y$, and $d=x-y$. The ideal positive +Gaussian pair is +$$ +C_+(x,y)=((s+id)/2,(s-id)/2). +$$ +The norm on a pair is $\|(x,y)\|=\sqrt{|x|^2+|y|^2}$. Its forward +outward slack under a map $F$ is +$\sup_z\max(0,\|F(z)\|-\|z\|)$. + +Restrict to $s=1$. Write $x=a+ib$, so $y=1-x$, and let +$$ +N(a,b)=a^2+(1-a)^2+2b^2. +$$ +This is the squared pair norm. The first ideal output has coordinates +$(1/2-b,a-1/2)$. An exact-sum output is determined by its first +coordinate $c+ie$. Its squared pair error is twice the squared +distance from $c+ie$ to the first ideal output. Each real coordinate +of that ideal output is a half-integer. Thus error at most one holds +exactly at the four candidates +$$ +(c,e)\in\{-b,1-b\}\times\{a-1,a\}. +$$ +Every candidate has error exactly one. + +The following table exhausts $N(a,b)\le5$. The output column lists the +possible squared norms before imposing a radial bound. + +| Input squared norm | First input coordinates | Inputs | Output squared norms | +| ---: | --- | ---: | --- | +| 1 | $a\in\{0,1\}, b=0$ | 2 | $1,3$ | +| 3 | $a\in\{0,1\}, b\in\{-1,1\}$ | 4 | $1,3,5,7$ | +| 5 | $a\in\{-1,2\}, b=0$ | 2 | $3,9$ | + +Set $\alpha=\sqrt5-\sqrt3$. Below $\alpha$, a norm-one input +cannot reach squared norm 3 because $\sqrt3-1>\alpha$. +An input of squared norm 3 cannot reach 5 or 7, and an input of squared +norm 5 cannot reach 9 because $3-\sqrt5>\alpha$. To see the two strict +inequalities, square the equivalent positive comparisons +$2\sqrt3>1+\sqrt5$ and $3+\sqrt3>2\sqrt5$. They reduce to +$3>\sqrt5$ and $3\sqrt3>4$, respectively. + +The union of all allowed outputs is contained in $N(c,e)\le3$. This set +has six points by the first two rows of the table. Eight inputs cannot +map injectively into six outputs. The matching below attains the threshold +on this finite domain. It lists the first input and first output +coordinates. In both cases the second Gaussian integer is one minus +the first. + +| $(a,b)$ | $(c,e)$ | +| --- | --- | +| $(-1,0)$ | $(0,-1)$ | +| $(0,-1)$ | $(1,-1)$ | +| $(0,0)$ | $(0,0)$ | +| $(0,1)$ | $(-1,0)$ | +| $(1,-1)$ | $(2,0)$ | +| $(1,0)$ | $(1,0)$ | +| $(1,1)$ | $(0,1)$ | +| $(2,0)$ | $(1,1)$ | + +The eight outputs are distinct and obey the candidate formula, with two +edges from squared norm 3 to 5 and the rest weakly inward. Hence +$\alpha$ is also the exact optimum on this part of the sum-one fiber. + +## Reproduce + +Run from the repository root with CPython 3.12 and its standard library. + +~~~sh +python3.12 -B scripts/research_package.py --package research/gaussian-exact-sum-forward-slack +python3.12 -B scripts/check_research_commit.py --package research/gaussian-exact-sum-forward-slack --check-source-history +python3.12 -W error -B research/gaussian-exact-sum-forward-slack/verify.py +python3.12 -W error -O -B research/gaussian-exact-sum-forward-slack/verify.py +~~~ + +The verifier enumerates all eight inputs and checks the scaled error +directly in Gaussian-integer coordinates. The input scan covers +$-2\le a,b\le2$, which contains $N\le5$. Each possible first output +coordinate is within one of its half-integer center, so the output scan +over $[-3,3]^2$ includes every error-one candidate. All 32 edges have +error one. The verifier finds 16 strict edges to six distinct outputs and +four threshold ties. It checks every edge of the displayed matching and +uses integer comparisons to isolate the strict and tied cases. The +expected status is PASS_GAUSSIAN_EXACT_SUM_FORWARD_SLACK. + +## Open next questions + +Can an all-size exact-sum matching attain $\alpha$, or does a different +finite set in the sum-one fiber force more? First test complete +neighborhoods beyond squared norm five at the exact threshold. A finite +matching is only a local positive control. The existing square-to-swap +construction gives a global upper bound $\sqrt{19}-\sqrt{13}$. A +physical caller contract would also need to specify the inverse, +ordered stages and implementation cost. +[#7570 proof](https://github.com/CubeJerry/integer-mult-bounds/blob/053c42c68165cf24fd4e8bc33c2b20d6ac3d399b/research/sharp-order-four-gaussian-rounding/proof/PROOF.md) + +## Credit + +This contribution was produced by Nick Petalas. Ali Romman's #6509 supplies +the ideal pair and exact-sum rounding contract. Jerry Chen's #7570 uses +fixed-sum fibers in the square-to-swap class and leaves the forward bound +without that identity open. His #7571 gives finite Hall bounds for the +larger class of maps with no sum constraint. His #7572 treats affine +periods and the bounded-center family. The argument here uses the sum-one +fiber and the displayed finite table. Independent human and formal +proof-kernel review are unclaimed. Apache-2.0. +[#6509](https://github.com/CrocSwap/integer-mult-bounds/pull/6509), +[#7570](https://github.com/CrocSwap/integer-mult-bounds/pull/7570), +[#7571](https://github.com/CrocSwap/integer-mult-bounds/pull/7571), +[#7572](https://github.com/CrocSwap/integer-mult-bounds/pull/7572) diff --git a/research/gaussian-exact-sum-next-obstruction/verify.py b/research/gaussian-exact-sum-next-obstruction/verify.py index b28d91f59e..d4b6ef38b8 100644 --- a/research/gaussian-exact-sum-next-obstruction/verify.py +++ b/research/gaussian-exact-sum-next-obstruction/verify.py @@ -6,6 +6,7 @@ from collections import Counter from copy import deepcopy from itertools import product +import hashlib import json from pathlib import Path @@ -95,6 +96,14 @@ def augment(u, visited): def verify(): + source = (ROOT/'predecessor/README.md').read_bytes() + manifest = json.loads((ROOT/'PREDECESSOR.json').read_text()) + require(hashlib.sha256(source).hexdigest() == manifest['sha256'] == + '2261b26dee2a3b6c698428ba52c80fdf5cd196b697f49e1d53c9a388fe72a7b4', + 'predecessor source bytes') + require(hashlib.sha1(b'blob '+str(len(source)).encode()+b'\0'+source).hexdigest() + == manifest['git_blob'] == '3fe489cbb6a3373952a7ff0d10749e2470184520', + 'predecessor Git blob') require((3*DEN+LOW)**2 < 13*DEN**2 < (3*DEN+HIGH)**2, 'root bracket') require(all(sum(H[k][i]*H[k][j] for k in range(4)) == (4 if i == j else 0) for i in range(4) for j in range(4)), 'ideal pair isometry') From 8ebf5eec9188f29c98be86eb1247f2ec6b41f19f Mon Sep 17 00:00:00 2001 From: Ali Romman <226877337+aliromman@users.noreply.github.com> Date: Wed, 18 Nov 2026 01:50:18 -0500 Subject: [PATCH 3/3] Preserve multiplication signs in the rendered Hall proof --- .../gaussian-exact-sum-next-obstruction/PROOF.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/research/gaussian-exact-sum-next-obstruction/PROOF.md b/research/gaussian-exact-sum-next-obstruction/PROOF.md index 3213ca76dc..034c209042 100644 --- a/research/gaussian-exact-sum-next-obstruction/PROOF.md +++ b/research/gaussian-exact-sum-next-obstruction/PROOF.md @@ -1,7 +1,7 @@ # Exact-sum rounding needs forward slack at least sqrt(13)-3 Let G=Z[i]. For x,y in G, put s=x+y, d=x-y and -C_+(x,y)=((s+i*d)/2,(s-i*d)/2). Use the Euclidean norm on G^2. +`C_+(x,y)=((s+i*d)/2,(s-i*d)/2)`. Use the Euclidean norm on G^2. Let F:G^2 -> G^2 be injective, preserve s exactly, and satisfy ||F(z)-C_+(z)|| <= 1 at every input. Define its forward slack as sup_z max(0,||F(z)||-||z||). @@ -19,11 +19,11 @@ The equality certificate covers all 22 inputs of the larger finite domain. ## Complete candidate sets -In the sum-one fiber write x=a+i*b and y=1-x. The squared pair norm is -N(a,b)=a^2+(1-a)^2+2*b^2. The first ideal output is -(1/2-b)+i*(a-1/2). Exact sum makes the second output one minus the first. -If the first output is c+i*e, the pair error squared is -((2*c-1+2*b)^2+(2*e-2*a+1)^2)/2. +In the sum-one fiber write `x=a+i*b` and y=1-x. The squared pair norm is +`N(a,b)=a^2+(1-a)^2+2*b^2`. The first ideal output is +`(1/2-b)+i*(a-1/2)`. Exact sum makes the second output one minus the first. +If the first output is `c+i*e`, the pair error squared is +`((2*c-1+2*b)^2+(2*e-2*a+1)^2)/2`. Both terms inside the squares are odd integers. Error at most one holds exactly when both terms have absolute value one. Thus the complete legal candidate set is {-b,1-b} x {a-1,a}. All four candidates have error one. @@ -91,9 +91,9 @@ suffice without trusting a maximum-matching implementation. ## Exact comparison and scope -For integers A,B>=0 and positive p/q, set r=(B-A)*q^2-p^2. +For integers A,B>=0 and positive p/q, set `r=(B-A)*q^2-p^2`. Then sqrt(B)-sqrt(A)<=p/q exactly when r<=0 or -r^2<=4*A*p^2*q^2. This follows by moving the nonnegative radical term +`r^2<=4*A*p^2*q^2`. This follows by moving the nonnegative radical term and squaring only when its other side is positive. The verifier brackets beta between 605551275463989293/10^18 and 605551275463989294/10^18.