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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions research/four-axis-reversible-grid/ENGINEERING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Verification boundaries

The deliverable includes a deterministic constructor and a separate finite
predicate checker. Literal inverse, sum and native error checks exercise the
actual integer map. No predecessor replay or shared verification code is changed.

All new functions are under 60 physical lines. No recursion or dynamic code
loading is used. The augmenting path uses at most 64 sources, 4,096 graph edges
and 64 backtracking steps. The candidate generator visits at most 65,536 offsets
per key; there are 64 keys. Each offset and payload has exactly sixteen real
coordinates. The semantic fixture count is fixed at 4,164, with two directions.
Every validator raises ValueError in ordinary and optimized Python.

Power of Ten deviation, rules 3 and 9. Python allocates managed integers,
tuples, dictionaries and iterators, and the control harness uses ten bounded
callables. These language mechanisms prevent a literal allocation-free runtime
or a ban on all indirect calls. Bounds above fix all collection cardinalities;
public data have at most 4,096 bits per component. Tables are local arguments,
not a mutable global cache. The maximum live candidate set is one sixteen-value
offset and one graph with at most 4,096 offsets, not the candidate enumeration.
No files, network or subprocesses are opened by the mathematical kernel.
The verifier reads its own package files only for source-bound stdout receipts.
Follow-up is a fixed-capacity native implementation if physical costing is pursued.

The packing format is checked rather than assumed: all offsets must fit signed
bytes, and the packed key/forward/inverse payload must be exactly 3,072 bytes.
Warning-strict normal and optimized execution are registered. The dense Walsh
reference is deliberately simple. Its ordinary arithmetic, table lookup, setup,
Boolean lowering, tape movement and cleanup are not assigned a physical tariff.
9 changes: 9 additions & 0 deletions research/four-axis-reversible-grid/ORIGIN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"source_pr": 6536,
"head": "83fee59d692b0764d716e8356a7d991e4d503868",
"author": "aliromman",
"path": "research/three-axis-coset-rounding/README.md",
"sha256": "4c097c377e99fc9b490176dedb34a6cb24600c177c7236ccc6049105e2071096",
"url": "https://github.com/CrocSwap/integer-mult-bounds/blob/83fee59d692b0764d716e8356a7d991e4d503868/research/three-axis-coset-rounding/README.md",
"usage": "Question and credited context only. No runtime dependency, copied predecessor code or claim of checking its theorem."
}
156 changes: 156 additions & 0 deletions research/four-axis-reversible-grid/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# A sharp four-axis reversible grid map

This contribution was produced by Nick Petalas. Apache-2.0.

## Claim and sources

Let `pi=1+i`, `C=[[i,1],[1,i]]`, and `U=pi^-4 C^(tensor 4)` on
sixteen Gaussian entries. These are the retained native Gaussian conventions,
as in David Ganz / Dugongue's [PR5815, C1-C3](https://github.com/CrocSwap/integer-mult-bounds/blob/f0fcda576df410dc15cd5b8183d4f74d284eba2b/research/gaussian-exceptional-correction/consumer-construction.md).
Ali Romman's [PR6536](https://github.com/CrocSwap/integer-mult-bounds/pull/6536)
asks whether four or more axes have a sum-preserving optimal grid map with an
explicit inverse and practical table. Its three-axis theorem is a cited
predecessor, not a verification target here.

**Theorem.** There is an explicit bijection `F: Z[i]^16 -> Z[i]^16` fixing
zero and preserving the complex sum, such that both

`||F(x)-Ux||_2 <= sqrt(8)` and `||F^-1(y)-U* y||_2 <= sqrt(8)`.

No integer-output map can improve either uniform constant. Scaling every input
and output by a positive grid spacing h multiplies the error by h. The shared
real classification table, including both directions and keys, has a 3,072-byte
packed representation. This is a scoped proof with a finite construction
certificate, not a complete multiplication theorem, physical tariff or new kappa.

## Reduction to two real Walsh maps

Index coordinates by four-bit integers. Let `W_rs=(-1)^popcount(r&s)` and
`D_jj=(-i)^popcount(j)`. Then `W^2=16 I` and

`U=-D W D/4`.

Indeed, `pi^4=-4` and
`i^(4-popcount(r xor s))=D_rr W_rs D_ss`.
The one-axis matrix `C/pi` is unitary and has row sum one, so U is unitary
and preserves the complex sum. All phases and the leading minus sign are kept.

We construct a bijection `R: Z^16 -> Z^16` approximating `W/4` and apply it
separately to real and imaginary components between these diagonal rotations.
For any integer vector z, put `q=Wz mod 4`, with residues in `{0,1,2,3}`.

## The complete finite quotient

Let v_s be column s of W. Modulo four,

`v_s=v_0 + sum_(j:bit_j(s)=1) (v_(2^j)-v_0)`.

This follows from `ab = a+b-1 mod 4` for signs a,b. Each difference has order
two and v_0 has order four. Therefore every q is represented by

`a(t,b)=(t-sum b_j)e_0 + sum b_j e_(2^j)`,

where `0<=t<4` and the four b_j are bits. The 64 keys are distinct: row zero
gives t and row `2^j` gives `t-2b_j mod 4`. This describes the whole quotient,
including all negative and arbitrarily large integer inputs. These elementary
Walsh/Smith quotient facts are prior algebra, not the new contribution.

`construction.py` independently generates the column span modulo four.
`verify.py` generates the displayed 64 representatives and requires equality
of the two key sets. No enumeration of a large input box is used to infer coverage.

## Finite correction certificate

For each key q the certificate supplies an integer offset e(q) satisfying:

1. `e(q)=-q mod 4`, component by component.
2. `||e(q)||_2^2 <= 64`.
3. `sum_j D_jj e(q)_j=0`.
4. `p(q)=W e(q)/4 mod 4` is a permutation of the 64 keys.
5. `e(0)=0`.

The construction first lists a sufficient subset of corrections. For an odd
key, start with components -1 at residue 1 and +1 at residue 3; replace up to
six selected components by their negative triple. For an even key, choose
either sign of 2 at residue 2 and zero at residue zero. Keep zero weighted-sum
corrections and select the least squared norm on each reached quotient edge.
These are candidate subsets, not an exhaustive closest-vector search.

A deterministic breadth-first augmenting-path matching chooses 64 edges.
The certificate checker checks conditions 1-5 directly, independently of the
matching search. It also checks the inverse offsets below, both weighted sums,
all table domains and the claimed norm bound. Thus correctness depends only
on the finite checked predicates, not on completeness or optimality of the
candidate search. The code uses no solver or pending Git object.

The serialized rows, in lexicographic key order, consist of sixteen unsigned
key bytes, sixteen signed forward offset bytes and sixteen signed inverse
offset bytes. Both real components use the same table. The inverse offsets
are indexed by the same sorted key set; no permutation array is needed.
The verifier emits the payload hash and all package-file hashes to stdout.
It does not write or trust a prewritten receipt.

## All-input inverse and error proof

Define `R(z)=(Wz+e(q))/4`. Condition 1 makes it integral. Also `W e(q)` is
divisible by four: e(q) is congruent to `-Wz`, and `W^2 z=16z`.
For an output y, its key is

`Wy mod 4 = W e(q)/4 mod 4 = p(q)`.

Since p is a permutation, that key identifies q. Set

`f(p(q))=-W e(q)/4`, and `R^-1(y)=(Wy+f(Wy mod 4))/4`.

Substitution gives `R^-1(R(z))=z`. Conversely, this formula is integral on
every target class because `f(p)=-p mod 4`; substituting in the other order
gives every y back. This proves bijectivity on the entire integer lattice.
Since `W/4` is orthogonal, `||f(p(q))||=||e(q)||<=8`.
Both real forward and inverse errors are at most two.

Let `R_C` apply R to both components. Define

`F(x)=-D R_C(Dx)`,
`F^-1(y)=D^-1 R_C^-1(-D^-1 y)`.

All rotations and R_C are bijections. The formula proves the literal inverse;
it does not assume an ideal square or fourth-power rewrite for F.
Two real squared errors at most four give total squared error at most eight,
in either direction. The zero offset fixes zero.

The difference `F(x)-Ux` is `-D(e(q_real)+i e(q_imag))/4`.
Condition 3 makes its complex sum zero, so F preserves the exact sum.
Its bijective inverse then preserves that sum as well.

## Sharpness and what improves

Take `x=(2+2i,0,...,0)`. Every real and imaginary component of Ux is a
half-integer, because `Ux_j=-D_jj(1+i)/2`. Any Gaussian integer output has
squared error at least `32/4=8`. The same argument applies to U*.
This lower bound applies to every integer-output rule, including nonbijective
rules. The construction attains it while retaining the inverse and sum.

This answers the four-axis part of PR6536's first open question. If an ambient
tensor has N entries and one group acts independently on sixteen-point blocks,
the aggregate error is at most `h sqrt(N/2)`. In particular, one four-axis group
has half the triangle-inequality bound obtained by two separately rounded groups
of sizes three and one. This comparison uses the predecessor's stated group
guarantees; it does not replay them or assert a complete caller implementation.
Phase covariance, exact fourth power, a physical speedup and optimal whole-call
error are not claimed.

## Executed evidence and limits

The verifier checks all 64 forward/inverse correction rows and all 4,096 pairs
of independent real quotient representatives. Another 64 signed fixtures,
three inputs with 128-, 1024- and 4090-bit components and the sharp witness give
4,164 endpoint fixtures. Each runs both directions, the literal inverse, exact
sum and an independently written direct native-matrix error oracle. Ten controls
reject missing or changed offsets and malformed or oversized inputs.

The executable API caps components at 4,096 bits, keeping its allocation bounded.
For round trips, inputs with at most 4,090 bits leave ample output headroom.
The mathematical formula and written proof quantify over all Gaussian integers;
finite large-word cases do not establish that quantifier by themselves.
No inherited scientific result is audited. Independent human and formal
proof-kernel review are unclaimed. All five selected framework assumptions remain.
84 changes: 84 additions & 0 deletions research/four-axis-reversible-grid/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Sharp four-axis reversible Gaussian grid rounding

This contribution was produced by Nick Petalas. Apache-2.0.

A new sixteen-point integer-grid map has an explicit inverse, fixes zero and
preserves the exact complex sum. Its uniform Euclidean error is `sqrt(8) h`
for both the forward and adjoint ideal four-axis native Gaussian operators.
A half-grid witness proves that no integer-output rule can do better on this
block. Claim type: scoped written proof with a finite construction certificate.

This answers the four-axis part of Ali Romman's
[PR6536 open question](https://github.com/CrocSwap/integer-mult-bounds/blob/83fee59d692b0764d716e8356a7d991e4d503868/research/three-axis-coset-rounding/README.md).
The new step is a sum-preserving matching on 64 real Walsh quotient classes,
reused for the real and imaginary parts. Keys and both correction directions
pack into 3,072 bytes. The table is constructed deterministically and certified
on every replay.

For independent sixteen-point blocks in an N-entry tensor, the new group has
error at most `h sqrt(N/2)`. At four axes this halves the triangle-inequality
certificate of separately rounded groups of sizes three and one. This is an
error-bound improvement; the dense reference kernel has no claimed physical
cost advantage. No new kappa or selected-frontier change is supplied.

## Proof and evidence

[PROOF.md](PROOF.md) proves the all-input inverse, exact sum and sharp error
from the finite certificate. [construction.py](construction.py) builds the
matching; [kernel.py](kernel.py) executes the actual integer map.
[verify.py](verify.py) checks its predicates independently and emits a generated
receipt bound to every package file and the packed table hash.

The replay checks 64 correction rows in both directions, all 4,096 real-class
pairs, another 68 signed/large-word/sharp fixtures and ten rejection controls.
Every one of the 4,164 fixtures runs both directions against a direct native
matrix oracle, including literal inversion and sum preservation. Maximum squared
error times sixteen is 128, exactly the sharp bound. Missing/altered offsets,
invalid component formats and the implementation's input-size limit are checked.

From the repository root, CPython 3.12 and its standard library:

```sh
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -W error -B research/four-axis-reversible-grid/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -O -W error -B research/four-axis-reversible-grid/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/four-axis-reversible-grid
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/four-axis-reversible-grid --check-source-history
```

The absolute interpreter path is the publication environment; another CPython
3.12 executable works. Commands write only stdout. The package needs neither
pending Git objects nor network access. The code caps inputs at 4,096 bits per
component; the written algebraic proof covers all integers. Use 4,090-bit input
components to leave round-trip headroom within that executable cap.

## Credit and boundaries

Credit Ali Romman for PR6536's larger-block question and three-axis construction,
PR6534's two-axis construction and PR5821's Gaussian Smith execution. Credit
David Ganz / Dugongue for PR5815's Gaussian Smith construction.
Credit Brian / JoyboyBrian's PR5485 for the retained native rounded-call and
port context, PR4743's channel lineage, and the retained Gaussian native work
of David Ganz / Dugongue. Walsh transforms, finite quotient enumeration and
bipartite matching are classical. No predecessor result is replayed or audited.
The new result is the four-axis correction matching and its application.

Canonical base is `7c49fe32c55de02c2c873655c804b16e4c3fef0a`, priority revision 8,
selected PR6030. Scope changes the uniform-transfer card from an actual-caller
assumption audit to a constructive local precision result. It discharges none
of the five selected assumptions. Independent human and formal proof-kernel
review are unclaimed. Phase covariance, exact fourth power, pointwise nearest
output, full-call optimality, Boolean/tape lowering, supplier admission and a
complete rounded multiplier remain unproved. [ENGINEERING.md](ENGINEERING.md)
records implementation bounds and managed-runtime deviations.

## Open next questions

1. Install the four-axis map in one literal native caller. First bind its
input/output charts, adjoint schedule, arbitrary dirty banks and full error
budget. Current local optimality does not prove caller admission.
2. Give a complete physical bill for the factored lookup. First lower the two
real transforms, residue classification and shared table to a reversible
Boolean/tape program with restored workspace. Table bytes do not price access.
3. Determine whether the same optimal error permits an exact fourth-power or
phase-covariance contract. First add those identities as finite quotient
constraints. The present matching certifies its explicit inverse only.
24 changes: 24 additions & 0 deletions research/four-axis-reversible-grid/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"schema_version": 1,
"base_commit": "7c49fe32c55de02c2c873655c804b16e4c3fef0a",
"files": [
{
"path": "certificates/selected-result.json",
"usage": "provenance",
"git_blob": "d59b5035e7b4cbaa9d688a1d32dd0d6eb79c466a",
"sha256": "9b8d0eea95b3bf0dfcb7938a732a6439b87a2685dec2a5ab9e525b3b34debbfa"
},
{
"path": "docs/research/agent-task-catalog.json",
"usage": "provenance",
"git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec",
"sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81"
},
{
"path": "research/gaussian-exceptional-correction/consumer-construction.md",
"usage": "provenance",
"git_blob": "4a32aa48afd12bccd28165b4367ecb8c746accb6",
"sha256": "d88885b0a96996db56507af0062d652e9a10578b83e89d9bc757f7471483d13d"
}
]
}
Loading