Skip to content
Merged
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
162 changes: 162 additions & 0 deletions research/rank-two-observation-boundary/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Independent output updates still permit a cheaper boundary

Prepared by @CubeJerry with substantial OpenAI Codex assistance. Apache-2.0.
The model is commdata2338's PR2020; Nick Petalas's PR5968 asks the rank-two
question resolved here. This is a scoped written proof, with finite checks,
not a formal proof of integer multiplication.

## Model and statement

There are four arbitrary dirty coordinates `(d0,d1,w0,w1)=(x,y,a,b)` over
a nonzero vector space in characteristic two. Addition below denotes XOR for bits.
A compulsory, indivisible child `(o,s,t)` performs, in order,

1. `d[o] += w[s]`;
2. `w[t] += w[1-t]`.

An adapter is one of the two workspace additions or the four additions from
workspace to output. Each costs one. Finite adapter words are allowed before
the first child and after each child, never within a child. There are no free
gates, output feedback, output mixing, extra coordinates or clean-input premises.

The eager reference undoes each child's workspace addition immediately. An
intermediate observation constrains the indicated output rows to equal that
reference; it does not read or alter workspace, feed back, or incur an operation
in this abstract gate model. At the final boundary all four coordinates must
equal the eager reference. Both comparators may retain noncanonical workspace.

Fix children

```
(0,1,0), (0,0,0), (0,0,0), (1,0,1).
```

Observe both outputs after children 1 and 3, and only `d1` after child 2.
The complete final endpoint is

```
(x,y,a,b) -> (x+b,y+a,a,b).
```

The output-update matrix on `(a,b)` is `[[0,1],[1,0]]`, of rank two. For
q-bit coordinatewise streams with q>=1 it has rank `2q`. Neither output is redundant.

**Theorem.** This partially observed fixed-child contract has exact adapter
minimum **2**. Observing both outputs after every child has exact minimum **3**.
Including all eight compulsory child gates, the minima are **10** and **11**.

## Explicit attaining words

Write `U: w0 += w1`, `L: w1 += w0`, and `D: d0 += w1`.
For partial observation, apply U after child 2 and L after child 3.

| Boundary, including adapters | Actual state | Required eager outputs |
| --- | --- | --- |
| Child 1 | `(x+b,y,a+b,b)` | `(x+b,y)` |
| Child 2, U | `(x+a,y,a+b,b)` | only `d1=y` |
| Child 3, L | `(x+b,y,a,a+b)` | `(x+b,y)` |
| Child 4 | `(x+b,y+a,a,b)` | complete final state |

The only discrepancy at any observed-output boundary would be b in d0 after
child 2; that output alone is hidden there. Both incoming dirty workspace
values are returned exactly, with no copy or erasure.

For full observation, apply U at entry, L after child 1, and D after child 3.
The entry changes workspace to `(a+b,b)` and is charged.

| Boundary, including adapters | Actual state |
| --- | --- |
| Child 1, L | `(x+b,y,a,a+b)` |
| Child 2 | `(x+a+b,y,b,a+b)` |
| Child 3, D | `(x+b,y,a,a+b)` |
| Child 4 | `(x+b,y+a,a,b)` |

All four rows are checked at return. The full comparator is optimized over
the same alphabet, rather than restricted to eager workspace restoration.

## Lower bounds without a search assumption

Both workspace generators U and L are odd permutations of the three nonzero
vectors of `F2^2`. Data adapters leave workspace unchanged. Four compulsory
workspace shears have even parity. Therefore a restoring schedule uses an
even number of workspace adapters. With none, its workspace word is U,U,U,L,
which is nonidentity: `(a,b)` goes to `(a+b,a)`. Consequently any correct
schedule needs at least two workspace adapters. The partial word attains two.

Suppose full observation were possible with at most two total adapters. The
preceding argument forces exactly two workspace adapters and no data adapters.
Subtracting consecutive fully observed output rows shows that children 2, 3
and 4 must each read the incoming a from w0. After child 2, its U changes this
row to `a+w1`. The current workspace matrix is invertible, so its w1 row is
nonzero. At least one workspace adapter is required in the gap between children
2 and 3. The same argument requires one between children 3 and 4.

Both adapters are thus spent in those two disjoint gaps. None is available
at entry or between children 1 and 2. But then child 1 leaves workspace
`(a+b,b)`, and child 2 reads `a+b`, not the required a. This is a contradiction.
Full observation needs at least three adapters; its displayed word attains three.

The argument is about independent formal coefficient rows. Special values
such as b=0 do not invalidate it or establish arbitrary-input correctness.
It also proves the conclusion for nonzero characteristic-two vector spaces: the
allowed coefficients remain in F2 and the same formal identities apply.

## Complete local bill and composition recurrence

The displayed words have the following **complete** gate histograms. Entry,
correction and dirty restoration are included; the four children are retained.

| Gate | Partial word | Full word |
| --- | ---: | ---: |
| `w0 += w1` | 4 | 4 |
| `w1 += w0` | 2 | 2 |
| `d0 += w0` | 2 | 2 |
| `d0 += w1` | 1 | 2 |
| `d1 += w0` | 1 | 1 |
| **Total** | **10** | **11** |

Thus the difference between these two words is one output correction, with
both workspace restoration counts equal. For assigned gate prices u,l,r00,
r01,r10, their exact bills are `4u+2l+2r00+r01+r10` and that expression plus
r01. Optimality is claimed for unit prices only, not for arbitrary weights.

For a literal q-bit stream XOR, define `X(0)=0`, `X(1)=1`, and
`X(q)=X(floor(q/2))+X(ceil(q/2))` for q>=2. There is no cross-bit mixing or
charged tape transport in this model, so `X(q)=q`. The complete fixed-child
bills are `P(q)=8X(q)+2X(q)=10q` and `F(q)=8X(q)+3X(q)=11q`.
Each XOR reads its two operands and writes its destination, giving 20q/22q
scalar reads and 10q/11q writes. Four dirty q-bit banks are occupied; additional
scratch, helper initialization, copying and erasure counts are zero.

For m invocations with this same observation pattern and a complete four-bank
return required at each block boundary, the exact sequential recurrence is
`P_0(q)=F_0(q)=0`,
`P_(m+1)(q)=P_m(q)+10q`, and `F_(m+1)(q)=F_m(q)+11q`.
The all-dirty endpoint makes each invocation legal after the previous one.
This recurrence fixes each block boundary and forbids cross-block resynthesis;
it is not a lower bound when those boundaries or children may be removed.

These are complete local scalar bills, **not** a recursive supplier tariff.
A physical integration must provide child implementations, observations,
native frame alignment, storage ownership, movement, precision and a full
caller invoice. None of those unknown costs is set to zero for the selected
multiplier. The result removes the rank-one limitation of a toy boundary;
it does not discharge a selected framework assumption. **No new kappa.**

## Finite corroboration and search scope

All words with zero, one or two adapters are enumerated, including entry,
repetitions and multiple ordered gates in one gap: counts are 1, 30 and 540.
Nondecreasing gap choices and every ordered gate tuple cover every shorter
schedule exactly once. Coefficient and separately written literal Boolean
engines agree on every boundary of every word for all 16 dirty inputs.
There are 9,136 executions and 18,272 observation-contract checks, plus 48
positive-word executions. This finite replay corroborates the written proof;
it is not a formal proof of the full multiplication theorem.

Discovery used CPython 3.12 `random.Random(57).shuffle` on the lexicographic
list of all 8^4 child chains, filtered for rank-two eager update. It completed
the first three qualifying chains and stopped at the first strict saving
through two adapters with only one hidden output at one cut. RESULT.json
records the exact inspected count and the first witness. This is not a census
of four-call chains, nor a claim of maximum possible saving in that domain.
140 changes: 140 additions & 0 deletions research/rank-two-observation-boundary/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# A four-call saving with independent output updates

**Scoped proof with exact finite corroboration. No new κ.**
Four fixed two-XOR children can return two independent output updates with
**two adapters instead of three** when one output at one intermediate cut
need not yet be correct. All arbitrary dirty workspace inputs are restored.
The complete local bills are **10 versus 11 XORs**, including entry work,
all children, correction and restoration.

The endpoint is `(x,y,a,b) -> (x+b,y+a,a,b)`: the update matrix has rank two.
This answers the first **Open next question** in Nick Petalas's
[PR5968](https://github.com/CrocSwap/integer-mult-bounds/pull/5968), whose
example updates both outputs by the same input and has rank one. It uses
commdata2338's unchanged [PR2020](https://github.com/CrocSwap/integer-mult-bounds/pull/2020)
model. The predecessors' shorter-chain census and rank-one result are cited,
not claimed as new replays. No error in either predecessor is alleged.

## Exact result and review path

[PROOF.md](PROOF.md) gives the complete model, attaining words, short lower
bounds, dirty-input traces, gate histogram and composition recurrence.
Both optimizers may carry noncanonical workspace and use any of the six
adapters before or between the mandatory children. Thus 11 is the optimized
full-observation bill, rather than the eager bill of 12.

The children are `(0,1,0), (0,0,0), (0,0,0), (1,0,1)` in PR2020 notation.
Only d0 after child 2 is hidden. The partial word adds `w1` into `w0` after
child 2 and `w0` into `w1` after child 3. The full word has a charged entry
adapter, a workspace adapter after child 1 and an output correction after
child 3. The difference in their complete gate histograms is exactly one
`d0 += w1`. Both original workspace values return without copying or erasure.

[model.py](model.py) evaluates formal coefficient rows. [verify.py](verify.py)
also uses a separately written literal bit interpreter that does not call
those child semantics. It enumerates all **571** schedules of adapter costs
0, 1 and 2. Exactly two cost-two schedules satisfy the partial contract;
none satisfy full observation. The literal interpreter checks every boundary
on all 16 dirty inputs: **9,136 executions / 18,272 contract checks**, plus
48 executions of the three positive words. The written argument establishes
the nonzero characteristic-two vector-space statement; this finite replay is not
formal verification of the multiplication theorem.

[RESULT.json](RESULT.json) is generated, not handwritten. It binds the exact
traces, counts, discovery coverage, predecessor inputs and implementation
hashes. Twelve semantic controls include a newly visible output, omitted
restoration, delayed correction, rank-one substitution, a clean-input false
positive and forbidden feedback. [test_faults.py](test_faults.py) injects
nine real faults per mode into private package/source copies and requires
the expected rejection in normal and optimized Python.

## Reproduce

Python 3.12, standard library only, from the repository root:

```sh
python3 -B scripts/research_package.py --package research/rank-two-observation-boundary
```

Expected: `PASS_RANK_TWO_OBSERVATION_BOUNDARY rank=2 partial=2 full=3 xor=10/11 no_new_kappa`
in normal and optimized modes; `PASS_RANK_TWO_BOUNDARY_FAULTS rejected=18 modes=normal,optimized`;
then `PASS_REGISTERED_RESEARCH_PACKAGE`.

Direct Git-free scientific replay is
`python3 -I -W error -B research/rank-two-observation-boundary/verify.py`.
It is read-only. To regenerate, pass `--write-result NEW_PATH` and compare
that new file with RESULT.json. An existing output path is refused.

## Provenance and bounded selection

Base: `721c03822c421b7f7fcbb2598993b947c4d88419`; priority revision 8.
[SOURCES.json](SOURCES.json) pins both predecessor contracts by Git blob and
SHA256 at this base, as well as the historical selected record and catalogue.
PR5968's publication head is `8a3fcbcbc6dd83f3f1af3e34df700847f35c9645`;
PR2020's is `f4f8d2afdd3fec60c7739dcd826497e9738f80c1`. Execution uses the
exact base-pinned contract files, not a moving PR head. No predecessor code
is imported. PR2020 is incorporated in the ledger; PR5968 is partially reviewed.

Fresh OS randomness selected **57**, the recursive-interfaces track. The
catalogue's `joint-query-controller` card is marked **changed** in
[TASK.json](TASK.json): this is a historical abstract boundary side result,
not an active-mode injection or a changed supplier on the selected P104 word.
Three candidates and the local advance claim are recorded there. No pinned
sprint issue was found; the connector has no Discussion-writing operation.
The claim is local, with no separate reservation issue.

Seed 57 shuffles all 4,096 four-child lists in the specified lexicographic
order. Rank-two filtering leaves three fully checked candidates among the
first eleven inspected lists before the first witness is found. Each of the
three completes all 571 shorter schedules; search then stops. The seed changes
ordering; the independent-output requirement is what distinguishes this work.
No complete four-call census or maximum saving claim is made.

Open PR bodies, exact overlap searches, the ledger, relevant negative results
and visible Discussion1166 handoffs were checked before selection. The local
overlap helper reports sparse coverage and unavailable CLI remote refresh;
the GitHub connector supplies the separate live checks. Neither search
coverage nor the absence of a match excludes unpublished work. Freshness and
the final compatibility decision are recorded in TASK.json.

## Limits

If the mandatory children can be replaced, two direct XORs implement the
endpoint. Ten is therefore not an unrestricted circuit minimum. Observations
are read-only correctness constraints in this model, not a physical consumer.
The exact 10q/11q bit bill and returned-block recurrence in PROOF.md assume
coordinatewise XORs without cross-bit mixing or tape transport. They must not
be substituted for a native recursive-child tariff.

No actual recursive caller, physical observation service, native alignment,
stock allocation, tape movement, finite precision or complete outer invoice
is supplied. All five selected framework assumptions remain. The selected
κ=781451/250000000 is unchanged. Source-binding orientation is distinct from
the selected scientific cold replay, which was not run. No hosted CI,
independent human acceptance or proof-kernel verification is claimed.

## Open next questions

Does a named mandatory child chain in an actual caller
permit this exact missing observation? First extract its input/output maps,
all later reads and dirty returns, then compare the complete physical bill.
Without those contracts, further abstract enumeration would not establish
a useful supplier improvement. This package stops at the rank-two witness.

Power of Ten scope: managed Python allocates bounded tuples, lists and integers.
The finite verifier uses four rows, five gaps, 571 shorter schedules streamed
one at a time, 16 inputs and a 4,096-chain ordering. The fault harness alone
uses bounded subprocesses and private temporary copies. No scientific
network access or dynamic predecessor import occurs.

## Credit

Prepared for **@CubeJerry** with substantial **OpenAI Codex** assistance.
Credit Nick Petalas's PR5968 for the explicit rank-two handoff and its
rank-one witness; commdata2338's PR2020 for the model and earlier census;
Aaron Wang / navinor's PR1155, Adam Gall's observer-safe restoration and
Sagar Thakrar's restored-cut planner for the retained lineage. The classical
linear-circuit and permutation-parity arguments are not claimed as new.
This contribution supplies one independent-update witness, its sharp minima,
full local accounting and reproducible checks. New files are Apache-2.0;
predecessor files, licenses and attribution remain unchanged.
Loading
Loading