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
171 changes: 171 additions & 0 deletions research/joint-cross-merge-threshold/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# Exactly 406 cross-side merges for the frozen joint invoice

This contribution is produced by Nick Petalas. It is a scoped mathematical
proof with a finite exact accounting certificate, under Apache-2.0.

For the complete frozen role ledger of Mark / Matarener's
[PR #5298](https://github.com/CrocSwap/integer-mult-bounds/pull/5298), the minimum
number of disjoint cross-side paid-job merges that passes the signed moment at
`C = 7/2000` is **406**. Each merge replaces one complex rank `a` and one BIT
rank `b` by the paid rank `a+b`. Every productive target and every unmerged paid
job stays in the bill. All roles are optimistically eligible. No job can be
used twice, and merged jobs cannot merge again.

The constructive witness is 222 pairs of ranks `(72,63)`, two pairs `(72,56)`,
and 182 pairs `(64,56)`. Write `M = sum targets^(1-C) - sum paid^(1-C)`.
The exact verifier encloses the optimal margins in these rational intervals:

```text
405 merges: -0.197285824316 <= M <= -0.197285824315
406 merges: 0.088428560458 <= M <= 0.088428560459
```

The general pairing theorem below makes 405 an exclusion for every allowed
matching, rather than a failed heuristic search. The application and exact threshold are the new result.
The predecessor's ledger and mathematical conclusions are cited premises and
are not re-audited here. This changes the `joint-query-controller` card to a
precise accounting question at the predecessor's explicit whole-job boundary.

## Optimal pairing theorem

Let `0 < alpha < 1` and let both sides be finite lists of positive ranks.
For exactly `k` disjoint cross-side merges, the smallest paid alpha-moment
comes from selecting the largest `k` ranks on each side and pairing them in
that same descending order. This holds for arbitrary positive real ranks.

To prove it, define the saving from one merge by

```text
Delta(a,b) = a^alpha + b^alpha - (a+b)^alpha.
```

It is positive by strict concavity. Its derivative in `a` is
`alpha [a^(alpha-1) - (a+b)^(alpha-1)] > 0`, and the derivative in `b` is
positive too. Thus replacing a selected rank by a larger unselected rank
cannot reduce the saving. Repeating the exchange selects the largest `k`
ranks on both sides, including ties in any order.

The mixed derivative is
`Delta_ab = alpha(1-alpha)(a+b)^(alpha-2) > 0`.
For `a >= a'` and `b >= b'`, integrate this derivative over the rectangle to
obtain

```text
Delta(a,b) + Delta(a',b') >= Delta(a,b') + Delta(a',b).
```

Exchanging inverted pairs therefore increases or preserves the total saving.
A finite sequence of exchanges produces the descending pairing. Since the
unmerged original bill is fixed, maximizing this saving minimizes the complete
paid moment. Further disjoint merges strictly improve the margin, so failure
at the optimal 405-pair matching excludes every matching with at most 405
pairs. The explicit 406-pair witness proves sharpness.

This is a specialization of the classical supermodular rearrangement argument.
The contribution claims the exact source-bound threshold and its application,
not discovery of rearrangement or of concave merge gains.

## Exact arithmetic and evidence

The stdlib-only verifier reads the full predecessor `RESULT.json` as a frozen
input, with SHA256
`e712e5373ecbfea0c1b7c115b52eea4fb533c6c7c2ebae3aa98a2dd1f058721c`.
It computes the new complete moments from that ledger, without replaying the
predecessor's roots, six models, native words or other conclusions.

The exponent is the exact rational `alpha=1993/2000`. Powers use rational
outward bounds, without floating point, Decimal, logarithm library calls or a
root grid. Write `r=2^s u` with `1<=u<2`. For `z=(u-1)/(u+1)`, sum the first
64 terms of `log u = 2 sum z^(2j+1)/(2j+1)` on a `2^-120` grid, rounding each
term outward. The remaining positive tail is bounded by
`2 z^129/[129(1-z^2)]`. Apply the same bound to `log 2`.

For `x=C log r`, the verifier sums `exp(x)` through degree 24 and bounds its
tail by the degree-25 term times `26/25`, valid for `0<=x<=1`. Monotonicity and
reciprocal interval arithmetic then bound `r exp(-C log r)`.
All later additions, subtractions and comparisons use exact rational numbers.

An independent certificate rounds every needed power interval outward to a
`2^-36` grid and checks the defining integer-power inequalities for all 145
ranks from 1 through 145. If its endpoints are `l/2^36` and `u/2^36`, it checks
`l^2000 <= r^1993 * 2^72000 <= u^2000`. The coarser, integer-certified bounds
separately prove both moment signs. Thus the sharp 406 threshold has a finite
certificate that does not require trusting the logarithm/exponential enclosure
implementation. The general matching theorem remains a written proof.

Finite corroboration enumerates all 1,200 choices of two three-job multisets
over ranks 1 through 4 and a merge count 1 through 3. All 13,200 labeled partial
matchings agree with the optimal pairing theorem. Seven invalid input controls
reject, and a strict crossed-pair example detects reversing the pairing rule.
The source hash, mass preservation, job-count reduction and explicit pair
multiplicities are executable invariants. Every run prints a generated receipt
binding the package files by SHA256.

## Reproduce

From the repository root, use CPython 3.12, standard library only:

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

Use an available CPython 3.12 path on another machine. The expected marker is
`PASS_JOINT_CROSS_MERGE_THRESHOLD` with `minimum_merges: 406`.
Verification writes no files. See `VERIFY.json` for both registered commands.

## Scope and limitations

This is an exact threshold in an optimistic, finite accounting model of two
historical invoices. It supplies no physical merge, joint native word, compiler,
controller, dirty-state restoration, tape bill or new kappa. The target `7/2000`
is an explicit benchmark above the frozen side roots, not a selected admission
threshold. The current selected record remains unchanged.

Additional fees can consume the positive margin. Restrictions on eligible roles
can raise the minimum. Repeated merges, splitting, altered targets, extra credits
or a different invoice are outside the theorem's threshold application. Native
and all-size multiplication obligations were not run. Independent human and
formal proof-kernel review are unclaimed.

The runtime is managed Python. The verifier's largest supplied side has fewer
than 100,000 jobs and its exhaustive oracle has fixed finite loops. Dynamic
integer, rational and collection allocations are bounded by this fixture;
Python cannot enforce allocation-free execution. Memoization is limited to 512
power bounds. Functions remain below 60 physical lines. These are the applicable
Power of Ten deviations, not changes to shared repository checks. The bounded
cache decorator and seven-entry control dispatch are standard-Python deviations
from the restrictions on metaprogramming and indirect calls.

## Sources and credit

The exact source is PR #5298 head
`e63b0a32ed2c021a8f4344e5aeb7e9123ff2eaef`,
`research/joint-supplier-average-ceiling/RESULT.json`.
`inputs/PR5298-RESULT.json` retains its bytes verbatim because this pending
source is not available from the package base history. The verifier authenticates
that retained file locally; no remote Git object or network access is required.
`SOURCES.json` binds the original card and selected record at the package base.
`TASK.json` records the external source URL, head and digest explicitly.

Mark / Matarener supplied the joint invoice, whole-job boundary and merge
examples. James Reed / jwr404 identified the scope correction. zxv and the
retained #4470 lineage supplied the complex invoice; ai-nanachi and #4814 on
#4760 supplied the BIT invoice. Ali Romman's #5341 supplies separate crossing
results, which are not required or replayed here. The retained Zhihao Chen,
RaD/hipotures, icekylinx and eumemic controller and moment lineage keeps its
credit. This package adds the optimal disjoint-pair rule and exact 406 threshold.

## Open next questions

Can a native child legally realize any of the threshold witness's three rank
pairs while retaining both arbitrary payloads and their returned state? This
decides whether the relaxed accounting witness has a physical interpretation.
Start with one `(72,63)` pair and write its complete producer/consumer and fee
contract. No such joint native contract is supplied here.

Can an explicit role-eligibility graph still admit 406 effective merges? First
derive its legal edges from one actual joint word, then solve the finite weighted
matching problem with all fees. The missing physical edge relation is the blocker.
18 changes: 18 additions & 0 deletions research/joint-cross-merge-threshold/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"schema_version": 1,
"base_commit": "19fdb086ea96af9a9f87936a2b888e10af4ed810",
"files": [
{
"path": "certificates/selected-result.json",
"usage": "provenance",
"git_blob": "581f8d87008354eb5b869f7ed9de1317ad837ce8",
"sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5"
},
{
"path": "docs/research/agent-task-catalog.json",
"usage": "provenance",
"git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec",
"sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81"
}
]
}
107 changes: 107 additions & 0 deletions research/joint-cross-merge-threshold/TASK.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"schema_version": 1,
"task_id": "joint-query-controller",
"priority_revision": 8,
"base_commit": "19fdb086ea96af9a9f87936a2b888e10af4ed810",
"original_card": {
"id": "joint-query-controller",
"question": "Can a changed query demand or caller remove real work while satisfying native chronology and restoration?",
"starting_points": [
"docs/research/current-priorities.md",
"docs/research/research-family-status.md",
"certificates/selected-result.json",
"docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md"
],
"methods": [
"Construct and independently check one source-bound instance of the stated first experiment.",
"Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change."
],
"acceptance_gate": "A source-bound arbitrary-input identity and legal producer/consumer boundary with the complete paid and productive target invoice, including restoration, ownership, native alignment and extra charges. Price under the actual current model; historical ceiling.py assumptions must be established before use. A favorable optimistic relaxation keeps a route open but is not a completed supplier. A scoped local result remains useful; expansion requires the family-level budget gate.",
"first_step": {
"command": [
"python3",
"-B",
"scripts/research_selected_baseline.py"
],
"expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY",
"inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.",
"scope": "Source-bound orientation only, not a supplier replay or theorem proof."
},
"first_experiment": "Choose an exact caller and a new demand/interface hypothesis. Read the scoped #5617/#5631/#5649/#5747 and #5720/#5745 objections before rebuilding an excluded schedule. Compare the complete matched source/consumer protocols including all retained helper outputs. For an active-mode injection, first check #5745: its canonical delivery claim repays the eight removed centre jobs. Audit that exact claim or change its channel/feedback hypothesis; do not repeat the same free-injection search. Stop if the full favorable budget fails or the required restored output is unobservable.",
"bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.",
"allowed_variations": [
"One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes."
],
"scope_change_triggers": [
"Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.",
"Treating an archived proposal or local numerical pass as complete supplier admission."
],
"overlap_terms": [
"query demand",
"active mode",
"5720",
"5745",
"5747",
"caller"
],
"existing_checks": [
{
"scope": "PR #4166: author-checked installed producer/service/return/bridge connection; native-component comparison loses.",
"evidence": "research/qq16-caller-install/README.md",
"remaining": "Complete matched physical protocol bill, or changed source-compatible demand/circuit; no affordable supplier yet.",
"status": "author-checked",
"source_commit": "0b082d22a0e9a442d264ab0633e35ef26c790630",
"selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129"
},
{
"scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.",
"evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md",
"remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.",
"status": "reviewed",
"source_commit": "09dd0965711ca7eeb169057a420abab1c9052137",
"selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5"
}
]
},
"scope_status": "changed",
"actual_scope": "Sharp minimum number of disjoint cross-side paid-job merges at C=7/2000 in the exact PR5298 frozen joint invoice.",
"scope_change_reason": "The current card asks for a physically completed changed caller. This side result resolves a necessary finite accounting threshold at PR5298's explicit whole-job-premise boundary, without claiming a native realization.",
"bottleneck_link": "Quantifies the optimistic cross-side merge budget needed to escape the frozen whole-job bound; physical eligibility and all fees remain open.",
"budget_minutes": 60,
"stop_rule": "Stop at the first exact threshold certificate, or report a bounded failure. No larger saving or additional construction search.",
"outcome": "completed",
"evidence": "Optimal-pairing proof; exact rational signed-moment signs at 405 and 406, independently certified by 145 integer-power comparisons; exhaustive 13200 partial matchings; eight controls.",
"author": "Nick Petalas",
"ai_assistance": "Independent human and formal proof-kernel review are unclaimed.",
"open_questions": [
{
"question": "Can a joint native child realize a witness rank pair?",
"why_it_matters": "The accounting relaxation has no physical construction.",
"first_step": "Specify one (72,63) pair with both arbitrary inputs and exact returned states, including all fees.",
"blocked_by": "No joint native producer/consumer contract."
},
{
"question": "Can a physically derived eligibility graph support an effective 406-pair matching?",
"why_it_matters": "Restricted roles or extra fees may invalidate the relaxed witness.",
"first_step": "Derive legal cross-side edges from one actual joint word and solve its weighted matching.",
"blocked_by": "No physical edge relation or complete fee bill."
}
],
"external_sources": [
{
"pull_request": 5298,
"author": "Matarener",
"head": "e63b0a32ed2c021a8f4344e5aeb7e9123ff2eaef",
"original_path": "research/joint-supplier-average-ceiling/RESULT.json",
"url": "https://github.com/CrocSwap/integer-mult-bounds/blob/e63b0a32ed2c021a8f4344e5aeb7e9123ff2eaef/research/joint-supplier-average-ceiling/RESULT.json",
"retained_path": "research/joint-cross-merge-threshold/inputs/PR5298-RESULT.json",
"sha256": "e712e5373ecbfea0c1b7c115b52eea4fb533c6c7c2ebae3aa98a2dd1f058721c"
}
],
"environment": {
"python_implementation": "CPython",
"python_version": "3.12.15",
"platform": "macOS-27.0.1-arm64-arm-64bit",
"dependencies": "Python standard library only"
}
}
34 changes: 34 additions & 0 deletions research/joint-cross-merge-threshold/VERIFY.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"schema_version": 1,
"status": "ready",
"python": "3.12",
"requirements": [],
"inputs": [],
"commands": [
{
"argv": [
"{python}",
"-I",
"-W",
"error",
"-B",
"{package}/verify.py"
],
"timeout_seconds": 120,
"checks": "Exact 405/406 moment signs, optimal-pairing oracle, source bytes, mass/job invariants and rejection controls."
},
{
"argv": [
"{python}",
"-I",
"-O",
"-W",
"error",
"-B",
"{package}/verify.py"
],
"timeout_seconds": 120,
"checks": "Identical full verification under optimized Python."
}
]
}
Loading