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
215 changes: 215 additions & 0 deletions research/integer-gauge-maxcut/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
# An exact Max Cut reduction for constant integer gauges

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

## Priced problem

Fix a finite chronological scalar word on rational registers. Its only
instructions are `v_t += 2^e v_s`, with t distinct from s and
`e in {-1,0,1}`. One reference register r has fixed exponent zero.
Each other register i may choose any integer exponent k_i. Apply the entry
scale `v_i *= 2^k_i`, replace each coefficient by
`2^(e+k_t-k_s)`, and apply the exit scale `v_i *= 2^(-k_i)`.
The instruction order and identities of all registers remain fixed.

The tariff is the real-component copy-init tariff declared in Philipp /
mightyOil's [PR1310](https://github.com/CrocSwap/integer-mult-bounds/pull/1310),
README section "Why the finite pair census covers all integer exponents".
For a positive power of two it is

```text
ADD(2^z) costs 3 + |z| - [z=0].
SCALE(2^z) costs |z|.
```

Every ADD includes its coefficient-work cleanup. A unit ADD is a direct
ADD followed by CLEAR of that work register, costing two. A nonunit ADD
copies its source to the work register, applies |z| doubles or halves,
adds it to the target, and clears work, costing 3+|z|. The work register
can start arbitrary and ends zero. Its entry value is disposable under
this owned-work contract. It is not an extra restored donor. All data
registers, including the reference, start arbitrary.

This is an optimization over representations of a fixed word. Combining
repeated ADDs, changing the algorithm, replacing the lowerer, removing
CLEARs, free renaming, free scales and changing the reference gauge are
outside the problem.

Let `f(z)=|z|-[z=0]`. For N instructions the complete scalar bill is

```text
B(k) = 3N + 2 sum_i |k_i| + sum_(t,s,e) f(e+k_t-k_s). (1)
```

The 2|k_i| term pays both boundaries. No boundary cost is omitted.
The source's tariff and scalar conjugation interface are premises here;
its historical k8 word, counts and stationarity proofs are not replayed.

## The construction and exact optimum

Let G be any nonempty finite simple graph with n vertices, m edges and
maximum degree Delta. Isolated vertices are permitted. Put
`A=2 Delta+1`. Use one data register for each vertex and one reference r.
First, in vertex order, emit for every i

```text
A copies of v_i += v_r,
A+1 copies of v_i += (1/2) v_r.
```

Then, in lexicographic edge order, emit for every edge i<j

```text
v_i += 2 v_j,
v_j += 2 v_i.
```

These are chronological shears. The second reads the updated v_i; no
commutation or simultaneous-assignment interpretation is used. There are
`N=n(2A+1)+2m` ADDs. The reference is never written.

**Theorem.** Every globally optimal integer gauge of this word is binary,
and its complete minimum scalar bill is

```text
min_(k in Z^n) B(k)
= n(6A+4) + 8m - MaxCut(G)
= n(12 Delta+10) + 8m - MaxCut(G). (2)
```

Moreover, the optimizers are exactly the indicator vectors of maximum
cuts, including the complementary indicator of each cut.

### Two elementary estimates

The contribution of one vertex, including both scales, is

```text
U_A(x) = 2|x| + A f(x) + (A+1) f(x-1).
```

It has `U_A(0)=U_A(1)=1`. Let `c(x)=min(1,max(0,x))` on integers.
For x>=2 and x<=-1, respectively, direct substitution gives

```text
U_A(x)-1 = (2A+3)(x-1) + A+1, x>=2,
U_A(x)-1 = (2A+3)(-x) + A, x<=-1.
```

Consequently, for every integer x,

```text
U_A(x)-U_A(c(x)) >= (2A+3)|x-c(x)|. (3)
```

The two directed instructions of an edge together contribute

```text
H(d) = f(1+d)+f(1-d)
= 2 if d=0,
1 if |d|=1,
2|d| if |d|>=2.
```

Its consecutive differences have absolute value at most three. By a
finite telescoping sum, `|H(u)-H(v)|<=3|u-v|` for all integers u,v.
This estimate includes the unit-coefficient discount at d=+1 and d=-1.

### Clipping proves the unrestricted integer result

Write `F=B-3N`. Clip one coordinate k_i to c(k_i), leaving every other
coordinate fixed, even if the other coordinates are unbounded integers.
The unary part decreases by at least `(2A+3)|k_i-c(k_i)|`. The incident
edge terms together can increase by at most
`3 degree(i)|k_i-c(k_i)|`. Thus the total decrease is at least

```text
(2A+3-3 degree(i)) |k_i-c(k_i)|
>= (Delta+5) |k_i-c(k_i)|. (4)
```

This is positive for every nonbinary k_i. Clipping each coordinate once
therefore gives the quantitative inequality

```text
B(k) >= B(c(k)) + (Delta+5) sum_i |k_i-c(k_i)|. (5)
```

No finite search box is assumed. A minimum exists because the finite
binary domain contains a point at least as good as every integer point.
Every minimizer is binary by the strict part of (5).

For binary k, each unary term is one. Each edge contributes two when
uncut and one when cut. Hence

```text
F(k)=n+2m-cut_G(k),
B(k)=3[n(2A+1)+2m]+n+2m-cut_G(k).
```

This proves (2) and the optimizer characterization. In particular, the
ungauged bill B(0) is `n(12 Delta+10)+8m`, so the maximum obtainable saving
is exactly MaxCut(G).

## Complexity consequence

The decision problem for the declared fixed-word gauge tariff is
NP-complete, even when every original coefficient belongs to {1/2,1,2},
there is just one fixed reference, and both boundary scales are charged.

For hardness, use the classical Simple Max Cut decision problem. Given
G and integer q, construct the word above and set
`K=n(12 Delta+10)+8m-q`. Equation (2) gives

```text
MaxCut(G)>=q if and only if some integer gauge has B(k)<=K.
```

The word has O(n Delta+m) instructions, hence polynomial size. Repeated
instructions are explicitly present in this count. All original scalar
coefficients have constant bit length, and the threshold has polynomial
bit length. This is a many-one reduction.

For membership in NP of the full declared problem, each ADD costs at
least two and every other charge is nonnegative. A witness with bill at
most nonnegative K must satisfy `2 sum_i |k_i|<=K`. Therefore every
exponent has O(log(K+1)) bits. Evaluating (1) requires only integer
arithmetic polynomial in the word length and these bit lengths. Negative
K is immediately infeasible. Thus a polynomial-size exponent witness
exists for every yes-instance. The same conclusion holds for the
constructed subfamily, whose witnesses can be chosen binary.

Classical hardness is cited from Garey, Johnson and Stockmeyer,
[Some simplified NP-complete graph problems, Theoretical Computer Science
1 (1976), 237-267](https://doi.org/10.1016/0304-3975(76)90059-1),
Section 1's Simple Max Cut theorem. Their theorem is a premise, not a new
complexity result here. The new result is its exact realization in (1).
No literature-priority claim is made for graph reductions or nonconvex
integer-potential optimization in general.

## Complete endpoint and limits

After entry scaling maintain the invariant that represented register i
is `2^k_i` times its original-word value at the same cut. A transformed
ADD preserves this invariant because

```text
2^k_t v_t + 2^(e+k_t-k_s) 2^k_s v_s
= 2^k_t (v_t+2^e v_s).
```

The reference has k_r=0. The exit scales remove every remaining factor.
This proves equality of the whole linear endpoint for arbitrary rational
data, with arbitrary initial coefficient-work contents cleared as charged.
It restores the intended original-word outputs, not the initial data
registers individually. The finite checker executes the literal primitive
words on all basis columns of its endpoint fixtures, including the work
column, and on signed rational dirty states.

The theorem is about worst-case constructed words. It proves neither
hardness of the actual 237-helper instance nor a new bound on that word's
minimum. It does not supply a faster multiplication algorithm, native
admission, a changed productive or paid rank profile, rounded precision,
physical hosting, stock, tape costs, compiler closure or a new kappa.
The five selected framework assumptions remain. A different tariff or
unrestricted circuit resynthesis can escape this obstruction.
146 changes: 146 additions & 0 deletions research/integer-gauge-maxcut/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# Global integer dyadic-gauge optimization encodes Max Cut exactly

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

Claim type: scoped written proof with exact finite corroboration. Global
constant integer dyadic-gauge optimization under the boundary-inclusive
copy-init scalar tariff is NP-complete. This already holds for fixed
words with original coefficients only 1/2, 1 and 2, one fixed reference
register, arbitrary dirty data, and both entry and exit scales paid.

For every simple graph G with n>=1 vertices, m edges and maximum degree
Delta, an explicit word has exact minimum real-component scalar bill

```text
min B = n(12 Delta+10) + 8m - MaxCut(G).
```

Its ungauged bill is the same expression without the MaxCut subtraction.
Every integer optimum is binary and corresponds to a maximum cut. A
quantitative clipping inequality covers every integer gauge, including
ones outside any finite search box. [PROOF.md](PROOF.md) gives the word,
full bill, clipping argument, complexity reduction and dirty endpoint proof.
For complex arithmetic the inherited separate real/imaginary lowering
simply doubles the real bill; it does not alter the optimizing gauges.

Philipp / mightyOil's [PR1310](https://github.com/CrocSwap/integer-mult-bounds/pull/1310)
provides the exact scalar objective and explicitly separates pair
stationarity from a global optimum. This new result explains a worst-case
obstruction to a general efficient global optimizer. It does not audit,
replay or decide that predecessor's historical 237-helper instance.
Classical Simple Max Cut hardness is due to Garey, Johnson and Stockmeyer;
the [primary paper](https://doi.org/10.1016/0304-3975(76)90059-1) is cited
with its locator in the proof. No general literature-priority claim is made.

## Evidence and reproduction

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

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

Another Python 3.12 path can replace the absolute interpreter path. Direct
replay prints `PASS_INTEGER_GAUGE_MAXCUT` in a generated JSON receipt bound
to every package file and the pinned predecessor README. It writes only
standard output. The registered manifest repeats the direct verifier
normally and with optimization, with a 120-second limit per command.

The checker enumerates every simple labeled graph through four vertices.
For every graph it compares the literal event tariff with the reduced
objective on every gauge in {-2,-1,0,1,2,3}^n, verifies quantitative clipping,
and independently enumerates every binary cut and decision threshold.
The universal theorem rests on the written proof, not this finite box.
The generated counts are 75 graphs, 1,098 binary assignments, 84,750
integer assignments and 430 threshold comparisons. The complete-graph
minimum bills at n=1,2,3,4 are 10, 51, 124 and 228.

Separately, every graph through three vertices and every gauge in
{-1,0,1,2}^n is lowered to literal COPY, ADD, CLEAR, DOUBLE and HALVE
instructions. Their lengths must equal the charged bill. All basis
columns, including independent coefficient-work dirt, and two signed
rational states must match the direct ungauged linear endpoint. No
predecessor executable is imported. Controls exercise the coefficient
ratio, missing exit, truncated word, boundary price, unit discount,
frustrated triangle and invalid graph boundaries.
The literal checks cover 548 gauge words, 3,796 dirty endpoints and
419,653 executed primitives. There are 1,799 local-lemma substitutions,
six semantic controls and eight invalid-graph rejections.

## Scope and provenance

The card `complex-new-helper-inventory` is marked changed in TASK.json.
This is a scalar-search side result. It does not satisfy that card's
physical productive-inventory acceptance gate. The orientation baseline
passed source bindings only. Canonical base is
`e54523517d0f03e58352e647c403a5af3e525a57`, priority revision 8. The selected
record is #7000 at kappa 0.00363005817; the priority headline describes an
older checkpoint. Source manifests pin the original card, selection and
predecessor text. The sole live external input is that text, authenticated
before mathematical execution and included in the replay/export inventory.

The [advance claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19601582)
reserves this exact global-integer problem. Main-tree, merged-PR, open-PR
and live Discussion checks found related coframe hardness and local gauge
results, but no matching integer-gauge construction within that bounded
coverage. The overlap cache covered 846 open PRs, 7,483 Discussion records
and 10,178 HEAD notes. This is not a proof of novelty or an exhaustive
literature search.

This fixes the chronological word and the declared lowerer. Repeated
instructions may be resynthesized under a different problem. Work CLEARs
are charged and retain their owned-work semantics. No claim is made about
physical tape cost, rounded precision, stock, native operators, supplier
admission, a changed recursive moment, the selected frontier or complete
multiplication. No predecessor scientific replay, selected cold replay,
Lean or Docker ran. Independent human and formal proof-kernel review are
unclaimed.

## Open next questions

Can a useful structural restriction on the actual scalar interaction
graph yield an exact global optimizer despite this worst-case reduction?
First measure one pinned graph's treewidth or a small deletion set that
removes its frustrated edge potentials, then derive a complete-state
algorithm with both boundary scales and unit discounts retained. This
matters because the theorem leaves structured supplier instances open.
No width bound or such algorithm is supplied here.

## Credit

Credit Philipp / mightyOil #1310 for the explicit objective and global
optimality distinction, Hanson Sun / bbMisk #1214 for the earlier exact
pair method, woklerx #1161 for scalar gauge conjugation, and Sagar Thakrar
#696 for the retained copy-init lowerer, with Jeremy Kothe, Hao Yan /
icekylinx, Douglas Colkitt and the retained supplier lineage. Their files
and credit lines remain unchanged. Classical Max Cut hardness and the
standard diagonal conjugation identity keep their established credit.
The new contribution is the graph word, exact full-tariff identity,
all-integer clipping proof and its finite corroboration.

Nick Petalas #6225 is an older local exclusion on a fixed historical
instance. Nick Petalas #5888 is an older transported-coframe rank-cost
hardness result. Neither supplies this construction, objective reduction,
proof or executable. They are related background, not main predecessors.

## Checker bounds

Every loop is bounded by the fixed census domains: at most four vertices,
six edges, 72 source ADDs, 1,024 primitive instructions, 1,296 integer
gauges per graph, 16 binary gauges and seven endpoint fixtures per word.
Each function is below 60 physical lines. Exceptions keep checks active
under optimization. There is no recursion, network use, dynamic code,
subprocess or file writing in the scientific verifier.

Power of Ten rule 3 has a managed-runtime deviation. Python allocates
integers, tuples, lists and Fractions during execution. The bounds above
limit live mathematical data, while fixed file inventories limit source
reads. The largest integer gauge tested in the census is three in
absolute value, and literal endpoints use exponents from -1 through two.
No heap profile or fixed-allocation native implementation is claimed.
Rule 10 uses warning-strict normal/optimized execution and AST inspection;
a separate static analyzer is unavailable in the declared environment.
Extending these domains requires revisiting their memory and loop bounds.
24 changes: 24 additions & 0 deletions research/integer-gauge-maxcut/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"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/k8-coupled-gauge-stationarity/README.md",
"usage": "input",
"git_blob": "7a8f7b81fc6f512f0b2310f6fdca6dcda97bf23d",
"sha256": "c7c4cd089c0e0198784d16d8ec7c615d9f24fcc2c0d453a4f573f08c88dcdacf"
}
]
}
Loading
Loading