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
156 changes: 156 additions & 0 deletions research/four-stage-pure-shear-tariff/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# Exact four-stage pure-shear tariffs

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

## Boundary and charge

Let F be any field and K a positive integer. Both data banks contain K
arbitrary independent field coordinates. A pure stage has one direction:

```text
U(A) = [I A; 0 I], L(B) = [I 0; B I].
```

A stage may have any rank from zero to K. Zero means an unused stage. The
required complete endpoint is block antidiagonal with both off-diagonal
blocks invertible. There is no auxiliary data bank, promised input subspace,
or free cross-bank exchange. Arbitrary invertible block-diagonal bridges
may occur before, between and after stages. Their physical price is outside
this rank-tariff relaxation. Pure means the entire stage has one direction;
it may act on many independent pairs at once.

This is the one-direction-per-stage subclass of themilkman216's PR2052
multi-pair model. A simultaneous stage with both off-diagonal blocks
nonzero is outside this theorem. PR2052's general lower bound and its
finite searches are cited, not reproved or replayed.

## 1. Remove bridges without changing stage ranks

For G=diag(S,T) with S,T invertible,

```text
G U(A) G^-1 = U(S A T^-1),
G L(B) G^-1 = L(T B S^-1).
```

Move every bridge to the left using these identities. Invertible left and
right factors preserve each stage's rank. The remaining exterior bridge
preserves the zero diagonal blocks and invertibility of the off-diagonal
blocks of the required endpoint. Thus it suffices to study shear words
with no bridges. No assumption of one common port basis was added.

## 2. Complete alternating four-stage classification

Write the chronological directions as U,L,U,L, so the endpoint is

```text
M = L(D) U(C) L(B) U(A).
```

Ordinary block multiplication, without commuting any coefficients, gives

```text
M11 = I + C B,
M12 = (I + C B) A + C,
M21 = D (I + C B) + B,
M22 = D ((I + C B) A + C) + I + B A.
```

Consequently M is block antidiagonal if and only if

```text
B is invertible, C = -B^-1, D = B + B A B. (1)
```

Indeed M11=0 forces CB=-I, hence B and C are invertible. Then M12=C,
M21=B and M22=DC+I+BA, which is zero precisely at the stated D.
Conversely (1) yields M=[0,-B^-1;B,0], including both invertible
off-diagonal blocks. This works in characteristic two as well.

Put P=-AB. The complete rank profile is

```text
(rank P, K, K, rank(I-P)). (2)
```

The rank inequality for I=P+(I-P) implies total rank at least 3K.
Equality holds exactly when P is idempotent. To see necessity, equality
makes Im(P) and Im(I-P) complementary. For any vector x,

```text
P(I-P)x = (I-P)Px
```

belongs to both images, hence is zero. Thus P^2=P. Conversely an
idempotent gives the direct sum Im(P) plus Ker(P), so its two ranks sum
to K. Every equality profile (r,K,K,K-r), 0<=r<=K, is attained by B=I,
P=diag(I_r,0), A=-P, C=-I and D=I-P.

At the first named instance K=4, r=1 gives the complete rank profile
(1,4,4,3), total 12. Therefore an 11-unit four-stage swap, if it exists
in PR2052's larger model, must use a genuinely simultaneous mixed-direction
stage. Unpaidmoon's fork PR125 already reports a finite exclusion of the full
mixed model at K=4 over F2. That result is cited without replay. The present
all-field pure-stage argument leaves the mixed question open over other
fields, including Q, rather than reopening that finite F2 instance.

## 3. Exact directional tariffs

Let f_U,f_L be nondecreasing functions on {0,...,K} with f_U(0)=f_L(0)=0.
Among alternating four-stage words, the exact minimum tariff is

```text
f_U(K) + f_L(K) + min_(0<=r<=K) (f_U(r) + f_L(K-r)). (3)
```

For an arbitrary endpoint word let a=rank P and d=rank(I-P). Since a+d>=K,
choose r=K-d. Then 0<=r<=a and K-r=d. Monotonicity and (2) prove the lower
bound (3). Every r is attained by the displayed idempotent construction.
Swapping the bank names gives the same formula for L,U,L,U.

If each directional tariff is also subadditive, formula (3) is the exact
minimum over all words of at most four pure stages. Adjacent stages with
the same direction merge by U(A2)U(A1)=U(A1+A2), or the analogous lower
identity. Rank subadditivity, monotonicity and tariff subadditivity show
that merging cannot increase the bill. If the two ranks sum to more than K,
choose smaller nonnegative ranks summing to K, apply subadditivity there,
then use monotonicity. The reduced directions alternate.
Pad a shorter word with zero stages to reach four alternating positions;
zero stages cost nothing. The construction in section 2 attains (3).

For one common nondecreasing subadditive tariff f, the minimum is exactly
3f(K): subadditivity forces f(r)+f(K-r)>=f(K), with equality available at
r=0 or K. In particular no fourth pure stage improves any common concave
power tariff r^theta, 0<theta<=1, even with free bridges. For different
positive coefficients c_U,c_L multiplying that same power, concavity
makes the minimum of the outer term occur at an endpoint. The exact cost
is (c_U+c_L+min(c_U,c_L))*K^theta.

Subadditivity matters. With f(r)=r^2, K=2 and r=1 the alternating word
costs 1+4+4+1=10, while every three-stage pure swap costs 12. This is a
control on the tariff hypothesis, not an improvement under a concave
recursive cost.

## Scope of the result

The theorem is all-field, all-K algebra with a complete arbitrary-input
endpoint. Its proof is the block identity, rank argument and attaining
projector family. Finite tests corroborate those statements. They do not
prove the quantified result by extrapolation.

Allowing both directions in one stage changes the stage-depth budget.
Splitting that stage into two pure stages is not justified for this
four-stage theorem. Extra banks, incomplete return contracts and different
endpoints are also outside it. No physical realization of free bridges,
Clifford phases, helper/owner program, precision, tape cost, full signed
recursive invoice, supplier admission or multiplication bound follows.
Independent human and formal proof-kernel review are unclaimed.

Credit themilkman216 / PR2052 for the explicit even-stage question and
multi-pair relaxation; Johnny Franks / cross-shear-stage-bound for the stage
potential; Jacob Alan Sussman and the archived borrowing-chain/controller
lineage for the attaining three-stage exchange. Block Gaussian elimination,
rank subadditivity and projector decompositions are classical. The new
repository result is this complete four-stage classification, equality
criterion and directional tariff formula. No literature-priority claim is
made for the elementary tools.
128 changes: 128 additions & 0 deletions research/four-stage-pure-shear-tariff/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Four pure shear stages cannot improve the three-stage swap tariff

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

For two arbitrary K-coordinate data banks over any field, the exact minimum
rank charge of a complete swap using at most four one-direction shear stages
is 3K. Arbitrary invertible within-bank bridges do not lower it. Every optimal
alternating four-stage word has a projector P and rank profile
`(rank P, K, K, rank(I-P))`. Every rank split is attained.

Claim type: scoped proof with exact finite corroboration. No new kappa.

For nondecreasing subadditive directional rank tariffs f_U,f_L, the exact
minimum is

```text
f_U(K) + f_L(K) + min_(r=0..K) [f_U(r) + f_L(K-r)].
```

For a common concave power tariff r^theta, 0<theta<=1, this is exactly
3 K^theta. A fourth pure stage buys no saving. The named K=4 witness has
profile `(1,4,4,3)` and total rank 12. Any 11-unit four-stage witness in
PR2052's larger model must include a simultaneous mixed-direction stage.
Unpaidmoon already reports a finite exclusion of the full mixed K=4 model
over F2 in [fork PR125](https://github.com/unpaidmoon/integer-mult-bounds/pull/125),
head `d9f9103be548e5b1b4a4ee1bf216ac5084ca7824`. Its broader F2 exclusion is
cited without replay. The mixed question here remains open over other fields.

[PROOF.md](PROOF.md) gives the complete block classification, bridge reduction,
projector equality criterion and tariff theorem. These are written all-field,
all-K results. They are not inferred from finite examples. For the alternating
four-stage class alone, the displayed tariff formula needs monotonicity only;
subadditivity allows merging equal-direction neighbors in a general word.
The convex square tariff at K=2 is a useful control: four stages cost 10
while three cost 12, so the subadditive/common-tariff hypothesis matters.

## Reproduce

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

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

Another CPython 3.12 path can replace the local path. The direct command emits
`PASS_FOUR_STAGE_PURE_SHEAR_TARIFF` inside a generated JSON receipt with actual
enumeration counts and SHA256 hashes of all six package files. It writes
nothing. Normal and optimized commands have identical mathematical coverage.
No predecessor executable or scientific replay is imported.

The oracle exhausts all alternating four-stage words on two-dimensional
banks over F2 and one-dimensional banks over F2,F3,F5,F7. It compares literal
full-matrix execution with the independently transcribed block criterion,
checks every accepted word's rank bound and equality condition, and records
actual minima for linear and square tariffs. A separate oracle checks every
monotone directional tariff pair with values in 0..4 on these finite
profiles. Separate complete-input constructions cover K=1..8, every projector rank and four fields, including
within-bank basis transport. Exact integer tariff fixtures extend through
K=32. Controls exercise omission, singular versus invertible endpoints,
nonprojectors, field-dependent rank, identity versus exchange and the convex
tariff escape. The receipt contains the exact finite coverage.

## Limitations

A pure stage acts in one direction on any number of pairs. This theorem does
not allow both directions simultaneously in one stage. Splitting a mixed
stage changes the depth and cannot apply this bound to PR2052's whole model.
The physical price of free bridges and all helper/native/owner/precision,
tape, compiler and outer costs remain unpriced. No selected cold replay,
Lean, Docker, complete supplier or multiplication theorem is supplied.
Independent human and formal proof-kernel review are unclaimed. The selected
record and all five framework assumptions remain unchanged.

## Open next questions

Can a four-stage simultaneous mixed-direction word over Q attain the eleven-unit
K=4 lower bound? Start with nonzero H and E in at least one stage and enforce
HE=EH=0, every bridge and the complete arbitrary-input endpoint. The present
pure-stage classification cannot price that altered depth contract. This is
the unclosed part of PR2052's question, with its structured first step in
[TASK.json](TASK.json).

## Credit and overlap

Credit themilkman216 / [PR2052](https://github.com/CrocSwap/integer-mult-bounds/pull/2052)
for the model, general stage bound and even-stage open question; Johnny
Franks / cross-shear-stage-bound for the earlier stage potential; Jacob Alan
Sussman and the archived borrowing-chain/controller lineage for the standard
three-stage exchange. Exact main-tree source documents are pinned as
provenance. No predecessor result is reverified or claimed as new. Block
elimination, rank subadditivity and projector decompositions are classical.
The new repository contribution is the complete four-stage pure classification,
its equality condition and directional tariff formula.

Base is canonical main `7c49fe32c55de02c2c873655c804b16e4c3fef0a`, priority
revision 8. The selected source-binding positive control passed. Live open
PRs, active Discussions, recent account work, local reservations, merged
object/formula searches and main README searches were checked before the
[advance CLAIM](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19360723).
The entry cache covers 351 open PRs and 6251 Discussion records with complete
remote pagination; sparse local notes cover only 108 of 8917 tracked notes.
Targeted all-main searches supplement that incomplete local coverage. No
search miss certifies novelty or covers unpublished work.

## Implementation bounds

The checker is finite, deterministic, nonrecursive and read-only. Matrices
have at most 16 rows; exhaustive banks have dimension at most two; the
largest alphabet has 16 matrices. The main complete word census visits
16^4 candidates. Construction loops cover eight widths, four fields and
at most nine projector ranks. Tariff loops cover 32 widths and 25 positive
price pairs. Functions fit within 60 physical lines, checks remain enabled
under -O, state is local and there is no subprocess, network, dynamic import
or code generation.

Power of Ten rule 3 has a bounded managed-runtime deviation in verify.py.
Python allocates tuples, lists and integers during each finite calculation.
The exhaustive oracle stores at most 256 pair matrices with 16 scalar
entries each, 81 possible rank profiles and 15 monotone tariffs. Construction
matrices have at most 256 entries. Each hashed package file is limited to one megabyte before reading. These are storage
bounds for this checker, not fixed-pool or measured runtime heap guarantees.
Reassess the bounds and introduce fixed buffers before lifting any input cap
or using the code in a steady service. Warning-strict normal and optimized
runs are the available Python diagnostics; no repository-wide analyzer or
native allocator check is claimed.
30 changes: 30 additions & 0 deletions research/four-stage-pure-shear-tariff/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"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/cross-shear-stage-bound/README.md",
"usage": "provenance",
"git_blob": "b7b20d76adc0c604e428947049fe0e4a880bc209",
"sha256": "ce4260fd4ed62217c063ff188463a652d99d0cdacf9da1cebe036401b7886492"
},
{
"path": "research/multipair-schedule-bound/README.md",
"usage": "provenance",
"git_blob": "a01bb3bda99ff8e3c7342829ccad5bd815e712bc",
"sha256": "b70972e022fa1b275993dacb30338f698ca50ce8d19ee056239c4320458d5276"
}
]
}
Loading