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
13 changes: 13 additions & 0 deletions research/p104-correction-support-floor/ORIGIN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"repository": "aliromman/integer-mult-bounds",
"pull_request": "https://github.com/CrocSwap/integer-mult-bounds/pull/6537",
"head": "8bc9f991afe9fde83700ff86e520230eaa4595e7",
"path": "research/p104-sparse-output-correction/RESULT.json",
"git_blob": "ed1c1b586b68c0e9d04b716ff46d75b5379c66e1",
"sha256": "4b95cc8cc0de0413ac8dcca49b13cb13abb85aad67e28bc988a55f1483f53a2e",
"retained_file": "inputs/pr6537-RESULT.json",
"used_fields": [
"correction"
],
"author": "Ali Romman"
}
102 changes: 102 additions & 0 deletions research/p104-correction-support-floor/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# A 38-ADD floor for the sparse P104 correction

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

## Model and result

Let C be the exact 799-coordinate rational operator defined by the 74 ADDs in
Ali Romman's PR6537, head `8bc9f991afe9fde83700ff86e520230eaa4595e7`.
The original RESULT.json is retained byte for byte in `inputs/`. Its construction,
factorization, upper bound and relationship to PR6529 are credited premises.
This package does not replay the old correction or the whole supplier.

Registers initially contain independent scalar inputs. A circuit uses
`r_i <- r_i + c*r_j`, with i distinct from j, and nonzero scalar SCALEs.
The ADD coefficient may be any rational number. SCALEs are free for this lower
bound. The circuit must finish with C on the original coordinates and restore
every additional dirty register. Any finite number of additional dirty or
zero-initialized registers is permitted. They initially contain no precomputed
linear combinations of the original inputs. Register names are fixed.

**Theorem.** Every such circuit uses at least 38 ADDs.

Thus the predecessor's 28 to 74 ADD gap becomes 38 to 74. This does not prove
that 38 or 74 is the optimum. It does not lower the source's scalar allowance
or change any productive or paid recursive rank.

## General first-final-ADD lemma

Suppose B specified output registers each have final coefficient support at
least s, where B is positive and s is at least two. Support means the number
of independent initial input coordinates with nonzero coefficient. Then any
circuit in the model above uses at least

`B + s - 2`

ADDs. No restrictions on cancellation, feedback, coefficient magnitudes,
interleaving or workspace size are needed.

Each specified register must receive an ADD: its initial support is at most
one, and SCALE cannot increase support. For each, mark its last ADD. These B
marked events are distinct because an ADD changes only its destination.
Let t be the earliest marked event. Subsequent SCALEs of its destination
have nonzero coefficients and preserve its support. Its row immediately
after t therefore already has support at least s.

Consider the arithmetic dependency graph of that row at this prefix. Give
each initial scalar coordinate one leaf, each SCALE one unary vertex, and
each ADD one binary vertex. Retain only ancestors of the row. The underlying
undirected graph is connected. If it has L input leaves, U unary vertices and
A binary vertices, it has at most U+2A edges and L+U+A vertices. Connectedness
gives `U+2A >= L+U+A-1`, hence `A >= L-1`. At least s distinct input leaves
occur because the row has s nonzero coefficients. Cancellation can introduce
additional leaves but cannot remove this requirement. Thus the prefix through
t contains at least s-1 ADDs.

The other B-1 marked events lie strictly after t. They are not among those
prefix ADDs. The total is at least `(s-1)+(B-1)=B+s-2`.

The argument includes workspace leaves, even if their final coefficients
cancel. It actually does not need workspace restoration, so imposing that
requirement cannot weaken the bound. Clean registers contribute zero-valued
leaves and do not reduce the number of independent leaves needed by the row.

As a function of B and s alone the lemma is sharp. Form a sum of s inputs
in one of those input registers using s-1 ADDs. Add that register to each of
B-1 other input registers. Exactly B outputs have support at least s; their
support sizes are s and s+1. The circuit uses B+s-2 ADDs. This is a generic
attainment example, not an implementation of C.

## Exact specialization

The verifier reads only the `correction` array of the retained source result.
It extracts its rational rows in two ways: forward row operations and backward
propagation of one output covector. It compares all 799 rows. This computes
the new support statistic; it does not check the predecessor's supplier claims.

There are 28 rows different from the corresponding identity row. Their complete
support histogram is `{12:3, 13:19, 25:6}`. Rows 3, 372 and 382 have support 12.
The verifier prints every changed row and its support. Hence B=28 and s=12,
giving `28+12-2=38`.

The written argument proves the lower bound for every permitted circuit.
The finite replay corroborates the specialization and checks the lemma on
all 9,331 three-register binary ADD words of lengths zero through five and
56 attaining examples. Six malformed-support controls and three source-byte
corruption controls reject. These finite checks are not an exhaustive search
for rational circuits implementing C.

## Boundaries

Free register permutations, multi-target operations, COPY, INIT/CLEAR inside
the circuit, native maps, nonlinear operations, precomputed input encodings
and approximate or rounded implementation are outside this model. A circuit
with such operations needs a separate lower-bound argument. SCALEs are
nonzero; every actual scalar and routing cost remains payable by a consumer.
The theorem requires the complete operator C on independent coordinates.
Matching C only on states reachable from a particular preceding supplier
word is a different problem and is not covered by this bound.

This local arithmetic floor does not prove supplier admission, a complete
multiplication theorem or a new kappa. All five selected framework assumptions
remain. Independent human and formal proof-kernel review are unclaimed.
91 changes: 91 additions & 0 deletions research/p104-correction-support-floor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# The sparse P104 correction needs at least 38 ADDs

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

The exact correction operator constructed by Ali Romman in
[PR6537](https://github.com/CrocSwap/integer-mult-bounds/pull/6537) needs at least
38 one-target ADDs, even with free nonzero SCALEs, arbitrary rational ADD
coefficients and arbitrary restored dirty workspace. This raises the prior
target-write lower bound from 28 to 38. The credited 74-ADD construction remains
the upper bound. Claim type: scoped written proof with exact finite support
evidence. No new kappa or selected-frontier change is claimed.

[PROOF.md](PROOF.md) gives the general lemma. If B specified outputs each have
support at least s>=2, the first output to receive its final ADD needs at least
s-1 ADDs in its dependency graph; the other B-1 final ADDs come later. Thus
there are at least B+s-2 ADDs. The source operator has 28 changed rows and
minimum support 12. The complete histogram is `{12:3,13:19,25:6}`.

This settles a bounded part of PR6537's open unrestricted circuit gap. It
changes the task card from productive helper splitting to a local correction
obstruction. The result constrains scalar resynthesis after a changed native
boundary; it does not change the recursive moment or provide an actual supplier.

## Reproduction

From the repository root:

```sh
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B research/p104-correction-support-floor/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/p104-correction-support-floor
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/p104-correction-support-floor --check-source-history
```

Any CPython 3.12 standard-library installation can run the direct verifier.
It writes only stdout. Normal and optimized registered checks extract all
799 rows independently, print every changed support, examine all 9,331 binary
words through length five, check 56 sharp examples and reject six invalid
support declarations and three actual byte corruptions. The success marker is
`PASS_P104_CORRECTION_SUPPORT_FLOOR`. The replay does not run or audit a
predecessor verifier.

The original source RESULT.json and NOTICE are retained byte for byte at the
head named in ORIGIN.json. The original blob and SHA256 are checked directly;
no unmerged Git commit, network access or predecessor executable is required.
SOURCES.json pins the task catalogue and selected record as historical
provenance. The retained source data is authenticated by ORIGIN.json rather
than an unavailable side-branch ancestry pin. Only its `correction` array is
used. Other numbers in the imported result are neither recomputed nor adopted
as new claims here.

## Limitations and verification scope

The exact optimum remains between 38 and the credited 74. The model uses fixed
register names and ADD/SCALE operations. Free permutations, multi-target calls,
native maps, COPY and in-circuit resets need different arguments. The theorem
requires the complete operator on independent coordinates; a restriction to
states reachable from a preceding word is outside the claim. The theorem
is a written proof, not a proof-kernel result. Native/compiler, ownership,
physical scalar and tape costs, rounding, stock and analytic recovery remain
outside the result. All five selected framework assumptions remain.

The verifier uses bounded Python allocations, a managed-runtime deviation from
Power of Ten rule 3. Live symbolic storage is at most 799 rows of 799 rational
entries and one backward row; gate count is fixed at 74. Binary enumeration
uses three integer rows and a word of length at most five. Rational sizes are
bounded by those 74 pinned coefficients. Functions stay below 60 lines, loops
have explicit finite domains, and explicit exceptions preserve checks under
optimization. Warning-strict normal and optimized replay supply the available
Python diagnostics. No shared configuration or historical verifier is changed.

## Open next questions

- Can a cancellation-sensitive circuit invariant raise 38? Start with the
dependency graph of one of the three support-12 rows. The support lemma
alone is sharp and cannot settle this operator's optimum.
- Can interleaved synthesis lower 74? Start with a new exact ADD/SCALE word
and prove its arbitrary-input endpoint, then charge every scalar operation
and any changed physical boundary. This lower bound supplies no such word.

## Credit and related work

Ali Romman supplied PR6537's correction, factorization and open circuit gap.
Credit PR6529, Rohan Arun's PR6399, Erwan L.'s PR6453 and the retained P104
lineage. The imported NOTICE is unchanged. Arithmetic dependency-graph
counting is classical; the new contribution is its first-final-ADD application
and the 38 floor for this exact operator.

PR6542 gives a rounded implementation of the same correction; it asks a
different precision question. PR6529 is its native-transport predecessor.
Neither is replayed here. Independent human and formal proof-kernel review
are unclaimed.
18 changes: 18 additions & 0 deletions research/p104-correction-support-floor/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"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"
}
]
}
Loading