diff --git a/research/every-stage-gap-rank-factor/PROOF.md b/research/every-stage-gap-rank-factor/PROOF.md new file mode 100644 index 0000000000..a57f830381 --- /dev/null +++ b/research/every-stage-gap-rank-factor/PROOF.md @@ -0,0 +1,211 @@ +# The own-leaf degree-1 block has rank at most rank(Z) + +Claim type: scoped written proof with exact finite corroboration. No new +kappa, no word, no selected-frontier change. + +The setting is the every-stage schedule of unpaidmoon's open PR #7050 +(`research/g31-q26-every-stage-gap`, head +`d176f84f39ff5678b2bd3dabb53c47099a31584b`). Sections 1 and 2 are +self-contained linear algebra. Section 3 uses #7050's schedule analysis as a +cited premise. That analysis is not replayed here. + +## 1. The rank lemma + +**Lemma 1.** Let `F` be a field, `W` a finite-dimensional `F`-space, and +`P`, `Q` idempotents of `W` with `P + Q = I`. Let `Z` be an endomorphism of +`W` with `Q Z P = 0`. Then + +```text +rank(P Z P + Q Z Q) = rank(P Z P) + rank(Q Z Q) <= rank(Z). +``` + +*Proof.* `P Q = Q P = 0` because `Q = I - P`. From `Q Z P = 0`, + +```text +Z P = (P + Q) Z P = P Z P, Q Z = Q Z (P + Q) = Q Z Q. +``` + +Put `U = im Z`. The restriction of `Q` to `U` has image +`Q(U) = im(Q Z) = im(Q Z Q)` and kernel `U ∩ ker Q = U ∩ im P`. The image +of `P Z P = Z P` lies in `im Z` and in `im P`, so it lies in that kernel. +Rank-nullity on `Q|_U` gives + +```text +rank(Z) = dim Q(U) + dim(U ∩ im P) >= rank(Q Z Q) + rank(P Z P). +``` + +For the equality, write `M = P Z P + Q Z Q`. Its image lies in +`im(P Z P) + im(Q Z Q)`, and this sum is direct because +`im P ∩ im Q = 0`. Conversely `M P = P Z P` and `M Q = Q Z Q`, so both +images lie in `im M`. ∎ + +In a basis adapted to `W = im P ⊕ im Q` the hypothesis says that `Z` is +block upper triangular, `M` is its block diagonal, and the lemma is the +statement that a block triangular matrix has rank at least the sum of the +ranks of its diagonal blocks. No property of `P` and `Q` beyond +`P^2 = P`, `Q = I - P` is used, and the characteristic is arbitrary. + +**Corollary 2.** Under the hypotheses of Lemma 1, every submatrix of +`P Z P + Q Z Q`, in any basis, has rank at most `rank(Z)`. + +The hypothesis `Q Z P = 0` is needed. Without it the block diagonal of a +rank-one matrix can have rank two, which is the factor 2 that #7050 proves. + +## 2. The own-leaf block of one stage + +Use the stage of #7050, section 1. The core and the stage leaf have +dimension `d = 2q`, the stage space is `W = core ⊕ leaf`, and the two +halves are + +```text +P_+ = [[A+B, B], [B, A+B]], P_- = [[A'+B, B], [B, A'+B]], +A = diag(I_q, 0), A' = I + A, B = [[0, B12], [B21, 0]], +``` + +over a field of characteristic two, with `B12`, `B21` arbitrary. Since +`A B + B A = B`, both are idempotent and `P_+ + P_- = I_W`. + +Let `V` be the whole space, core plus all leaves, and let `Z` be an +endomorphism of `V`. Extend `P_f`, `P_s` (the two halves in either order) +by zero outside `W`, and let `Z_W` be the compression of `Z` to `W`. Then +`P_s Z P_f = P_s Z_W P_f`, and + +```text +pi_core (P_f Z P_f + P_s Z P_s) pi_leaf = pi_core (P_f Z_W P_f + P_s Z_W P_s) pi_leaf. +``` + +This is the own-leaf degree-1 core-to-leaf block of #7050, section 3. On +`W`, in characteristic two, it also equals the two-sandwich form +`pi_core (Z_W P_f + P_s Z_W) pi_leaf`, because the two expressions differ +by `2 P_s Z_W P_f`. + +**Theorem 3.** For every half width `q >= 1`, every `B12`, `B21`, either +half order and every `Z` with `P_s Z P_f = 0`, + +```text +rank( pi_core (P_f Z P_f + P_s Z P_s) pi_leaf ) <= rank(Z_W) <= rank(Z). +``` + +*Proof.* Apply Corollary 2 on `W` with `P = P_f`, `Q = P_s`, `Z = Z_W`. +The block is a submatrix of `P_f Z_W P_f + P_s Z_W P_s`. A compression +does not raise rank. ∎ + +This answers open question 1 of #7050: the factor is 1 for every `q`. + +**Sharpness.** Take `B = 0` and let `Z` be the identity from the leaf +into the core, `Z = [[0, I_d], [0, 0]]` on `W`. Then `P_s Z P_f = 0` because +`A A' = 0`, and `Z P_f + P_s Z = Z`. The block is `I_d` and +`rank(Z) = d = 2q`. So equality holds at every `q`, and 1 is the best +constant. + +## 3. Consequence on the every-stage schedule + +**Cited premise (#7050, sections 2 to 4).** In the every-stage schedule, +for each leaf `j`, the thin maps contribute `M_j I_d` on the core-to-leaf-`j` +block, where `M_j = product_{k>=j} D_k` and `d = 2q`. The monomial `M_j` +on leaf `j` receives contributions from exactly these gaps: + +- the internal gap of stage `j`, through its own-leaf degree-1 block, +- the internal gap of stage `j+1`, through `pi_core P_s Z pi_j`, +- the internal gap of stage `j-1`, through `pi_core P_f Z pi_j`, +- the external gaps after `j` and after `j+1` completed stages, through + the core-to-leaf block of the map itself, + +with out-of-range stages omitted. Each contribution is evaluated on the +sum `Z` of the thin maps in that gap, and a successful word has +`P_s Z P_f = 0` in every internal gap. + +The exponent comparison behind the list is recomputed in `verify.py` from +the formulas `lambda(t,j)` and `mu(gamma,j)` for every `g <= 64`. The +derivation of those formulas, and of the square condition, is #7050's. + +**Theorem 4.** Under the cited premise, the total thin rank `R` of a +successful every-stage word satisfies + +```text +R >= 2 q ceil(g / 3). +``` + +*Proof.* Fix a leaf `j`. By Theorem 3 the own-leaf block has rank at most +`rank(Z)` for the gap sum `Z` of stage `j`. The other four blocks are +compressions of `P_s Z`, `P_f Z` or of the map, so each has rank at most +the rank of its gap sum. The rank of a gap sum is at most the sum `r(G)` +of the ranks of the thin maps in the gap `G`. Rank is subadditive and +`I_d` has rank `2q`, so + +```text +2q <= sum of r(G) over the gaps G that contribute to leaf j. +``` + +Take the leaves `j = 0, 3, 6, ...` below `g`. There are `ceil(g/3)` of +them. Two of them differ by at least 3, so their contributing gap sets are +disjoint: internal gaps `j-1, j, j+1` and external gaps `j, j+1`. Adding +the inequalities charges every thin map at most once. ∎ + +At `g = 31`, `q = 26` the bound is `52 * 11 = 572`. #7050 proves 403, and +its predicted factor-1 weight count would give `ceil(2 q g / 3) = 538`. +The disjoint-leaf count is never smaller: `2 q ceil(g/3) >= 2 q g / 3`. +Five thin maps of rank 26 have total rank 130. + +**What rank counting cannot do.** The inequalities of the proof form a +covering problem: nonnegative numbers `r(G)` with one constraint per leaf. +Placing `2q` on the internal gaps of stages `1, 4, 7, ...` (and on stage +`g-1` when `g ≡ 1 mod 3`) satisfies every constraint with total +`2 q ceil(g/3)`. So these inequalities alone give nothing above +`2 q ceil(g/3)`. That is a statement about the inequalities. It is not a +word, and it does not show that total rank `2 q ceil(g/3)` is attained. +At `q = 1` an exhaustive census finds rank-one maps satisfying the square +condition whose three blocks, on leaves `t-1`, `t`, `t+1`, all have rank +one, so no single map's three weights can be lowered by a rank argument. + +## 4. Finite corroboration + +`verify.py` uses the standard library only and raises on any failure. + +- `q = 1`, exhaustive: all 65,536 matrices `Z` of size 4 over `F_2`, all + four `B`, both half orders, 524,288 cases. Exactly 32,768 satisfy + `P_s Z P_f = 0`. On each, the pinching equals the two-sandwich form, its + rank is additive and at most `rank(Z)`, and the own-leaf block has rank + at most `rank(Z)`. +- Control: among the 1,800 rank-one cases, 168 have own-leaf block rank 2. + Each violates the square condition. +- `q = 2, 3, 4`: 4,500 seeded random cases on the actual stage halves with + random `B12`, `B21`, both orders. +- Lemma 1 for random complementary idempotents over `F_2`, `F_3`, `F_5`, + `F_7` in dimensions 4 and 6: 3,200 seeded cases, each with a random + submatrix. +- Sharpness witness at `q = 1, 2, 3, 5, 26`, both orders. +- `q = 1`, exhaustive over 30,600 rank-one maps with columns on the stage + and the two neighbouring leaves: 1,170 satisfy the square condition and + meet all three leaves at rank one. +- Packing: for every `g` from 1 to 64 the contributor sets are recomputed + from the monomials, the chosen leaves are pairwise disjoint, and the + covering point has the same value. Spacing-two leaves and a thinned + cover are rejected. + +The random cases are corroboration. The proof is sections 1 to 3. + +## 5. What this does not prove + +- It does not prove #7050's schedule analysis, monomial formulas or square + condition. Theorem 4 is conditional on them. +- It does not bound nested or crossed stage intervals, which are outside + the schedule hypothesis. +- It does not replace the one-gap bound `q(g-3) = 728` of open PR #7025 or + the consecutive bound `q g = 806` of open PR #7005. Those are larger + numbers on smaller schedule families. +- It does not use the leaf-to-core blocks, and it does not show that 572 + is attained. +- No `g = 31`, `q = 26` word is constructed or excluded outside this + schedule. + +## 6. Credit + +unpaidmoon's #7050 supplies the schedule, the square condition, the +degree-1 block, the monomial comparison, the factor-2 estimate, the +`q = 1` census observation and the question answered here. unpaidmoon's +#7025 and #7005 supply the one-gap and consecutive bounds. The +paired-star contract and the commuting map-count are from Ali Romman's +#5747 with its predecessors #5673, #5631 and #5617, and Cinna Davis +supplied the controller and simplex lineage those packages retain. The +rank inequality for block triangular matrices is classical. diff --git a/research/every-stage-gap-rank-factor/README.md b/research/every-stage-gap-rank-factor/README.md new file mode 100644 index 0000000000..d608b4a5ee --- /dev/null +++ b/research/every-stage-gap-rank-factor/README.md @@ -0,0 +1,112 @@ +# The every-stage gap: rank factor 1 and total thin rank at least 2q⌈g/3⌉ + +This contribution was produced by Nick Petalas. Apache-2.0. + +Claim type: scoped written proof with exact finite corroboration. No new +kappa, no word, no selected-frontier change. + +unpaidmoon's open +[PR #7050](https://github.com/CrocSwap/integer-mult-bounds/pull/7050) +studies paired-star words with one internal thin gap in every stage. It +proves that the own-leaf degree-1 core-to-leaf block has rank at most +`2 rank(Z)`, deduces total thin rank at least `q g / 2`, and asks in its +open question 1 whether the factor is 1 under the square condition +`P_s Z P_f = 0` for every half width `q`. + +The answer is yes. The [proof](PROOF.md) has three results. + +1. **Rank lemma.** For complementary idempotents `P + Q = I` over any + field and any `Z` with `Q Z P = 0`, + `rank(P Z P + Q Z Q) = rank(P Z P) + rank(Q Z Q) <= rank(Z)`. +2. **Factor 1, sharp.** For every `q`, every `B12`, `B21` and either half + order, the own-leaf degree-1 block has rank at most `rank(Z)`. Equality + holds at every `q`, with `rank(Z) = 2q`. +3. **Bound.** Under #7050's schedule analysis, a successful every-stage + word has total thin rank at least `2 q ceil(g/3)`. At `g = 31`, + `q = 26` this is **572**. #7050 proves 403. Its predicted factor-1 + weight count would give 538. + +The third result counts leaves `0, 3, 6, ...`, whose contributing gaps are +pairwise disjoint. The same inequalities admit a covering point of value +`2 q ceil(g/3)`, so rank counting on these blocks gives nothing higher. +That is a limit of the method, not a word. + +#7050's schedule hypothesis, square condition and monomial comparison are +cited premises. They are not audited or replayed. The lemma and its +application to the stage halves are self-contained. + +## Evidence and reproduction + +From the repository root, with CPython 3.12 and its standard library: + +```sh +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -W error -B research/every-stage-gap-rank-factor/verify.py +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -O -W error -B research/every-stage-gap-rank-factor/verify.py +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/every-stage-gap-rank-factor +``` + +Each verifier run takes about three seconds and ends with + +```text +PASS_EVERY_STAGE_GAP_RANK_FACTOR factor=1 bound_g31_q26=572 certificate=e42b24ab6676fb20 no_new_kappa +``` + +The checks, all exact: + +- every 4 by 4 matrix over `F_2`, every `B`, both half orders: 524,288 + cases, of which 32,768 satisfy the square condition, and the lemma and + the block bound hold on each; +- a control: 168 of 1,800 rank-one cases have block rank 2, and each + violates the square condition; +- 4,500 seeded random cases on the actual stage halves at `q = 2, 3, 4`; +- 3,200 seeded random cases of the lemma over `F_2`, `F_3`, `F_5`, `F_7`; +- the sharpness witness at `q = 1, 2, 3, 5, 26`; +- 1,170 rank-one maps at `q = 1` that satisfy the square condition and + meet leaves `t-1`, `t`, `t+1` at rank one each; +- contributor sets, disjointness and the covering point for every + `g <= 64`, with two rejection controls. + +The random cases corroborate the proof. They are not a census. + +## Scope and limits + +Theorem 4 is conditional on #7050's analysis of the every-stage schedule. +Nested and crossed stage intervals are outside that schedule. The +one-gap bound 728 of #7025 and the consecutive bound 806 of #7005 concern +smaller schedule families and are not replaced. The bound 572 is not shown +to be attained, and the leaf-to-core blocks are not used. No `g = 31`, +`q = 26` word is constructed or excluded outside this schedule. No +independent human review and no formal proof-kernel review is claimed. No +Lean, Docker or selected-supplier replay was run. Source pins are in +[SOURCES.json](SOURCES.json). + +## Open next questions + +- Do the leaf-to-core blocks raise the every-stage bound above + `2 q ceil(g/3)`? The covering point of section 3 shows that the + core-to-leaf rank inequalities stop there. First step: write the + leaf-to-core degree-1 block of one internal gap under + `P_s Z P_f = 0` and test whether a map that meets leaves `t-1`, `t`, + `t+1` at full rank can also cancel its own leaf-to-core monomials. +- Is total thin rank `2 q ceil(g/3)` compatible with the other monomials + of the endpoint at `g = 3`, `q = 1`, where the bound is 2? #7050's + control word there has total rank 6. First step: an exhaustive census of + one internal map of rank at most 2 in stage 1 against every + core-to-leaf monomial. +- Does the block-triangular argument extend to nested or crossed + intervals? There the map between two halves is conjugated by another + stage's half, and the square condition changes. First step: derive the + squared-monomial condition for one nested pair. + +Structured relevance, first steps and blockers are in [TASK.json](TASK.json). + +## Credit + +unpaidmoon's #7050 supplies the schedule, the square condition, the +degree-1 block, the monomial comparison, the factor-2 bound, the `q = 1` +census observation and the question answered here. unpaidmoon's #7025 and +#7005 supply the neighbouring bounds. The paired-star contract and the +commuting map-count are from Ali Romman's #5747 with its predecessors +#5673, #5631 and #5617, and Cinna Davis supplied the controller and +simplex lineage those packages retain. The rank inequality for block +triangular matrices is classical. diff --git a/research/every-stage-gap-rank-factor/SOURCES.json b/research/every-stage-gap-rank-factor/SOURCES.json new file mode 100644 index 0000000000..c104e78c49 --- /dev/null +++ b/research/every-stage-gap-rank-factor/SOURCES.json @@ -0,0 +1,36 @@ +{ + "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" + } + ], + "external_predecessors": [ + { + "repository": "unpaidmoon/integer-mult-bounds", + "pr": 7050, + "head": "d176f84f39ff5678b2bd3dabb53c47099a31584b", + "usage": "Cited schedule analysis, square condition, monomial comparison and open question; no runtime input and no predecessor verifier execution.", + "files": [ + { + "path": "research/g31-q26-every-stage-gap/PROOF.md", + "sha256": "5af6c4205011659137e8715f716e30a788defa3acdee54d8ec5cf88f72ced7c3" + }, + { + "path": "research/g31-q26-every-stage-gap/README.md", + "sha256": "3192de854dc870c67b7bcd03c78386003ab97b92cf698d8648017e65b4d416cb" + } + ] + } + ] +} diff --git a/research/every-stage-gap-rank-factor/TASK.json b/research/every-stage-gap-rank-factor/TASK.json new file mode 100644 index 0000000000..eccd03da21 --- /dev/null +++ b/research/every-stage-gap-rank-factor/TASK.json @@ -0,0 +1,113 @@ +{ + "schema_version": 1, + "task_id": "joint-query-controller", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "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": "Prove that under the square condition P_s Z P_f = 0 the own-leaf degree-1 core-to-leaf block of the every-stage paired-star gap has rank at most rank(Z) for every half width q, show the constant 1 is attained, and deduce total thin rank at least 2 q ceil(g/3) on that schedule under the cited schedule analysis.", + "scope_change_reason": "The card asks for a changed query demand or caller. This package changes neither. It answers open question 1 of unpaidmoon's open PR #7050, a rank question about one fixed schedule family of the paired-star contract, and builds no word.", + "bottleneck_link": "Side result. It raises a lower bound on total thin rank for one schedule family of the paired-star contract, which restricts where a g=31, q=26 endpoint could be sought. It does not price a supplier or change the signed moment.", + "budget_minutes": 60, + "stop_rule": "Stop at the first verified factor-1 proof and its immediate consequence on the every-stage schedule. Leave leaf-to-core blocks, attainment and nested or crossed intervals open.", + "outcome": "completed", + "evidence": "PROOF.md proves the rank lemma for complementary idempotents over any field, the factor-1 block bound with a sharpness witness at every q, and the conditional bound 2 q ceil(g/3). verify.py exhausts the q=1 domain over F_2, runs seeded random cases at q=2,3,4 and over F_2, F_3, F_5, F_7, recomputes the contributor sets for g up to 64, and runs rejection controls.", + "author": "Nick Petalas", + "ai_assistance": "Independent human and formal proof-kernel review are unclaimed.", + "open_questions": [ + { + "question": "Do the leaf-to-core blocks of an every-stage word raise the total thin rank bound above 2 q ceil(g/3)?", + "why_it_matters": "The core-to-leaf rank inequalities admit a covering point of value 2 q ceil(g/3), so any higher bound on this schedule needs the other side of the endpoint.", + "first_step": "Write the leaf-to-core degree-1 block of one internal gap under P_s Z P_f = 0 and test whether a map meeting leaves t-1, t, t+1 at full rank can also cancel its own leaf-to-core monomials.", + "blocked_by": "The leaf-to-core monomial comparison for internal gaps is not derived here or in the source note." + }, + { + "question": "Is total thin rank 2 q ceil(g/3) compatible with every core-to-leaf monomial of the endpoint at g=3, q=1, where the bound is 2?", + "why_it_matters": "The bound is not shown to be attained. The only recorded control word at g=3, q=1 has total rank 6.", + "first_step": "Run an exhaustive census of one internal map of rank at most 2 in stage 1 against every core-to-leaf monomial, not only M_j.", + "blocked_by": "The full list of monomials that must cancel is not enumerated in this package." + }, + { + "question": "Does the block-triangular rank argument extend to nested or crossed stage intervals?", + "why_it_matters": "Those schedules are outside the hypothesis, and no bound proved here applies to them.", + "first_step": "Derive the squared-monomial condition for one nested pair of stages, where the internal map is conjugated by another stage's half.", + "blocked_by": "The square condition changes when a full call of another stage stands between the halves." + } + ], + "claim_type": "scoped written proof with exact finite corroboration", + "predecessor": { + "pr": 7050, + "author": "unpaidmoon", + "head": "d176f84f39ff5678b2bd3dabb53c47099a31584b", + "question": "README Open next questions, first item: own-leaf degree-1 block of rank at most rank(Z) for every half width q" + }, + "environment": { + "python": "3.12.15", + "implementation": "CPython", + "dependencies": "standard library only" + }, + "selected_context": { + "kappa": "363005817/100000000000", + "decimal": "0.00363005817", + "scope": "Historical source-bound orientation only; the selected record and its five assumptions are unchanged." + } +} diff --git a/research/every-stage-gap-rank-factor/VERIFY.json b/research/every-stage-gap-rank-factor/VERIFY.json new file mode 100644 index 0000000000..19d2feb6f3 --- /dev/null +++ b/research/every-stage-gap-rank-factor/VERIFY.json @@ -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": "Rank lemma on every 4 by 4 binary matrix with the square condition, factor-two control, seeded random cases at q=2,3,4 and over F_2, F_3, F_5, F_7, sharpness witness, three-leaf rank-one census, contributor sets, packing and covering for g up to 64, rejection controls." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Rank lemma on every 4 by 4 binary matrix with the square condition, factor-two control, seeded random cases at q=2,3,4 and over F_2, F_3, F_5, F_7, sharpness witness, three-leaf rank-one census, contributor sets, packing and covering for g up to 64, rejection controls." + } + ] +} diff --git a/research/every-stage-gap-rank-factor/verify.py b/research/every-stage-gap-rank-factor/verify.py new file mode 100644 index 0000000000..105fc4b098 --- /dev/null +++ b/research/every-stage-gap-rank-factor/verify.py @@ -0,0 +1,465 @@ +#!/usr/bin/env python3 +"""Exact checks for the own-leaf rank factor of the every-stage paired-star gap. + +Standard library only. Every check raises on failure, so the script behaves +the same with and without ``-O``. The written proof is in PROOF.md; this file +corroborates it on finite domains and evaluates the packing bound. +""" + +from __future__ import annotations + +import hashlib +import json +import random +import sys + +SEED = 20261110 +CENSUS_FIELD = 2 +ODD_PRIMES = (3, 5, 7) +RANDOM_HALF_WIDTHS = (2, 3, 4) +RANDOM_TRIALS = 1500 +GENERAL_TRIALS = 400 +SHARP_HALF_WIDTHS = (1, 2, 3, 5, 26) +MAX_STAGES = 64 +TARGET_G = 31 +TARGET_Q = 26 +INVERSE_ATTEMPTS = 200 + + +class CheckFailure(Exception): + """A registered check did not hold.""" + + +def require(condition: bool, message: str) -> None: + if not condition: + raise CheckFailure(message) + + +# ---------------------------------------------------------------- F_2 rows -- +# A matrix over F_2 is a list of row integers; bit c of a row is column c. + + +def f2_mul(left: list[int], right: list[int]) -> list[int]: + out = [] + for row in left: + acc = 0 + for index in range(len(right)): + if (row >> index) & 1: + acc ^= right[index] + out.append(acc) + return out + + +def f2_add(left: list[int], right: list[int]) -> list[int]: + require(len(left) == len(right), "row count mismatch") + return [a ^ b for a, b in zip(left, right)] + + +def f2_rank(rows: list[int]) -> int: + basis: list[int] = [] + for row in rows: + current = row + for vector in basis: + current = min(current, current ^ vector) + if current: + basis.append(current) + return len(basis) + + +def f2_identity(size: int) -> list[int]: + return [1 << index for index in range(size)] + + +def f2_block(rows: list[int], row_ids: range, col_ids: range) -> list[int]: + mask = (1 << len(col_ids)) - 1 + return [(rows[r] >> col_ids.start) & mask for r in row_ids] + + +def f2_random(rng: random.Random, n_rows: int, n_cols: int) -> list[int]: + return [rng.getrandbits(n_cols) for _ in range(n_rows)] + + +def stage_projectors(q: int, b12: list[int], b21: list[int]) -> tuple[list[int], list[int]]: + """P_plus and P_minus of the paired-star stage on core + leaf, d = 2q.""" + d = 2 * q + require(len(b12) == q and len(b21) == q, "B blocks must be q by q") + a_rows = [(1 << i) if i < q else 0 for i in range(d)] + a_prime = [0 if i < q else (1 << i) for i in range(d)] + b_rows = [b12[i] << q for i in range(q)] + [b21[i] for i in range(q)] + plus, minus = [], [] + for i in range(d): + diag_plus = a_rows[i] ^ b_rows[i] + diag_minus = a_prime[i] ^ b_rows[i] + plus.append(diag_plus | (b_rows[i] << d)) + minus.append(diag_minus | (b_rows[i] << d)) + for i in range(d): + diag_plus = a_rows[i] ^ b_rows[i] + diag_minus = a_prime[i] ^ b_rows[i] + plus.append(b_rows[i] | (diag_plus << d)) + minus.append(b_rows[i] | (diag_minus << d)) + return plus, minus + + +def check_complementary_f2(p_first: list[int], p_second: list[int]) -> None: + size = len(p_first) + zero = [0] * size + require(f2_mul(p_first, p_first) == p_first, "first half is not idempotent") + require(f2_mul(p_second, p_second) == p_second, "second half is not idempotent") + require(f2_add(p_first, p_second) == f2_identity(size), "halves do not sum to I") + require(f2_mul(p_first, p_second) == zero, "halves are not orthogonal") + require(f2_mul(p_second, p_first) == zero, "halves are not orthogonal") + + +def pinching_f2(z: list[int], p_first: list[int], p_second: list[int]) -> tuple[list[int], list[int]]: + """Return (P_f Z P_f, P_s Z P_s).""" + return ( + f2_mul(f2_mul(p_first, z), p_first), + f2_mul(f2_mul(p_second, z), p_second), + ) + + +def lemma_holds_f2(z: list[int], p_first: list[int], p_second: list[int], d: int) -> tuple[int, int]: + """Check the lemma on one Z with P_s Z P_f = 0. Return (rank Z, block rank).""" + size = 2 * d + require(f2_mul(f2_mul(p_second, z), p_first) == [0] * size, "square condition missing") + pzp, qzq = pinching_f2(z, p_first, p_second) + diagonal = f2_add(pzp, qzq) + two_sandwich = f2_add(f2_mul(z, p_first), f2_mul(p_second, z)) + require(diagonal == two_sandwich, "pinching differs from the two-sandwich form") + rank_z = f2_rank(z) + require(f2_rank(diagonal) == f2_rank(pzp) + f2_rank(qzq), "pinching rank is not additive") + require(f2_rank(diagonal) <= rank_z, "pinching outranks Z") + block_rank = f2_rank(f2_block(diagonal, range(0, d), range(d, size))) + require(block_rank <= rank_z, "own-leaf block outranks Z") + return rank_z, block_rank + + +def census_q1() -> dict[str, object]: + """Every 4 by 4 matrix over F_2, every B, both half orders.""" + d, size = 2, 4 + histogram: dict[str, int] = {} + legal = 0 + total = 0 + for b_bits in range(4): + plus, minus = stage_projectors(1, [b_bits & 1], [(b_bits >> 1) & 1]) + for p_first, p_second in ((plus, minus), (minus, plus)): + check_complementary_f2(p_first, p_second) + for code in range(1 << (size * size)): + total += 1 + z = [(code >> (size * r)) & 15 for r in range(size)] + if f2_mul(f2_mul(p_second, z), p_first) != [0] * size: + continue + legal += 1 + rank_z, block_rank = lemma_holds_f2(z, p_first, p_second, d) + key = f"{rank_z}:{block_rank}" + histogram[key] = histogram.get(key, 0) + 1 + require(total == 8 * 65536, "census size changed") + require(legal == 8 * 4096, "square-condition count changed") + return {"matrices": total, "square_zero": legal, "rank_pairs": dict(sorted(histogram.items()))} + + +def excess_without_square_q1() -> dict[str, int]: + """Control: a rank-one Z with P_s Z P_f != 0 can have block rank two.""" + d, size = 2, 4 + excess = 0 + examined = 0 + for b_bits in range(4): + plus, minus = stage_projectors(1, [b_bits & 1], [(b_bits >> 1) & 1]) + for p_first, p_second in ((plus, minus), (minus, plus)): + for u in range(1, 16): + for v in range(1, 16): + examined += 1 + z = [v if (u >> r) & 1 else 0 for r in range(size)] + two = f2_add(f2_mul(z, p_first), f2_mul(p_second, z)) + block_rank = f2_rank(f2_block(two, range(0, d), range(d, size))) + square = f2_mul(f2_mul(p_second, z), p_first) + if block_rank == 2: + require(square != [0] * size, "excess with the square condition") + excess += 1 + require(examined == 8 * 225, "rank-one control size changed") + require(excess > 0, "the factor-two control vanished") + return {"rank_one_matrices": examined, "block_rank_two": excess} + + +def random_actual(rng: random.Random) -> dict[str, int]: + """Random Z on the actual stage projectors for larger half widths.""" + checked = 0 + equalities = 0 + for q in RANDOM_HALF_WIDTHS: + d, size = 2 * q, 4 * q + for trial in range(RANDOM_TRIALS): + plus, minus = stage_projectors(q, f2_random(rng, q, q), f2_random(rng, q, q)) + p_first, p_second = (plus, minus) if trial % 2 == 0 else (minus, plus) + check_complementary_f2(p_first, p_second) + width = 1 + rng.randrange(size) + raw = f2_mul(f2_random(rng, size, width), f2_random(rng, width, size)) + z = f2_add(raw, f2_mul(f2_mul(p_second, raw), p_first)) + rank_z, block_rank = lemma_holds_f2(z, p_first, p_second, d) + checked += 1 + equalities += int(rank_z == block_rank) + return {"checked": checked, "block_rank_equals_rank": equalities} + + +def sharpness() -> dict[str, int]: + """Z = identity from the leaf into the core attains block rank = rank Z = 2q.""" + attained = {} + for q in SHARP_HALF_WIDTHS: + d, size = 2 * q, 4 * q + plus, minus = stage_projectors(q, [0] * q, [0] * q) + z = [(1 << (d + r)) if r < d else 0 for r in range(size)] + for p_first, p_second in ((plus, minus), (minus, plus)): + rank_z, block_rank = lemma_holds_f2(z, p_first, p_second, d) + require(rank_z == d and block_rank == d, "sharpness witness lost") + attained[str(q)] = d + return attained + + +def three_leaf_q1() -> dict[str, int]: + """Rank-one maps that meet leaves t-1, t and t+1 at rank one each (q = 1). + + Z has rows on core + leaf t and columns core, leaf t, leaf t-1, leaf t+1. + """ + d, size = 2, 4 + examined = 0 + full = 0 + for b_bits in range(4): + plus, minus = stage_projectors(1, [b_bits & 1], [(b_bits >> 1) & 1]) + for p_first, p_second in ((plus, minus), (minus, plus)): + for u in range(1, 16): + for w in range(1, 256): + examined += 1 + rows = [w if (u >> r) & 1 else 0 for r in range(size)] + z_stage = [row & 15 for row in rows] + if f2_mul(f2_mul(p_second, z_stage), p_first) != [0] * size: + continue + own = f2_add(*pinching_f2(z_stage, p_first, p_second)) + own_rank = f2_rank(f2_block(own, range(0, d), range(d, size))) + before = f2_mul(p_second, [(row >> 4) & 3 for row in rows]) + after = f2_mul(p_first, [(row >> 6) & 3 for row in rows]) + ranks = (own_rank, f2_rank(before[:d]), f2_rank(after[:d])) + require(max(ranks) <= 1, "a block outranks a rank-one map") + full += int(ranks == (1, 1, 1)) + require(examined == 8 * 15 * 255, "three-leaf domain changed") + require(full > 0, "no rank-one map meets all three leaves") + return {"rank_one_maps": examined, "meeting_three_leaves": full} + + +# ------------------------------------------------------------ general F_p -- + + +def fp_mul(left: list[list[int]], right: list[list[int]], p: int) -> list[list[int]]: + cols = len(right[0]) + return [ + [sum(row[k] * right[k][c] for k in range(len(right))) % p for c in range(cols)] + for row in left + ] + + +def fp_sub(left: list[list[int]], right: list[list[int]], p: int) -> list[list[int]]: + return [[(a - b) % p for a, b in zip(ra, rb)] for ra, rb in zip(left, right)] + + +def fp_add(left: list[list[int]], right: list[list[int]], p: int) -> list[list[int]]: + return [[(a + b) % p for a, b in zip(ra, rb)] for ra, rb in zip(left, right)] + + +def fp_eliminate(matrix: list[list[int]], p: int) -> tuple[int, list[list[int]]]: + """Reduced row echelon form. Return (rank, reduced copy).""" + rows = [list(row) for row in matrix] + rank = 0 + n_cols = len(rows[0]) if rows else 0 + for col in range(n_cols): + pivot = next((r for r in range(rank, len(rows)) if rows[r][col] % p), None) + if pivot is None: + continue + rows[rank], rows[pivot] = rows[pivot], rows[rank] + inv = pow(rows[rank][col], -1, p) + rows[rank] = [(x * inv) % p for x in rows[rank]] + for r in range(len(rows)): + if r != rank and rows[r][col] % p: + factor = rows[r][col] + rows[r] = [(x - factor * y) % p for x, y in zip(rows[r], rows[rank])] + rank += 1 + return rank, rows + + +def fp_rank(matrix: list[list[int]], p: int) -> int: + return fp_eliminate(matrix, p)[0] + + +def fp_random(rng: random.Random, n_rows: int, n_cols: int, p: int) -> list[list[int]]: + return [[rng.randrange(p) for _ in range(n_cols)] for _ in range(n_rows)] + + +def fp_random_idempotent(rng: random.Random, size: int, p: int) -> list[list[int]]: + """S diag(1^a, 0) S^-1 for a random invertible S and random a.""" + for _ in range(INVERSE_ATTEMPTS): + s = fp_random(rng, size, size, p) + augmented = [row + [int(i == j) for j in range(size)] for i, row in enumerate(s)] + rank, reduced = fp_eliminate(augmented, p) + if rank == size and all(reduced[i][i] == 1 for i in range(size)): + s_inv = [row[size:] for row in reduced] + kept = rng.randrange(size + 1) + diag = [[int(i == j and i < kept) for j in range(size)] for i in range(size)] + return fp_mul(fp_mul(s, diag, p), s_inv, p) + raise CheckFailure("no invertible matrix found") + + +def general_field(rng: random.Random) -> dict[str, int]: + """The lemma for arbitrary complementary idempotents over F_2, F_3, F_5, F_7.""" + checked = 0 + for p in (CENSUS_FIELD,) + ODD_PRIMES: + for size in (4, 6): + identity = [[int(i == j) for j in range(size)] for i in range(size)] + for _ in range(GENERAL_TRIALS): + proj = fp_random_idempotent(rng, size, p) + comp = fp_sub(identity, proj, p) + require(fp_mul(proj, proj, p) == proj, "P is not idempotent") + raw = fp_random(rng, size, size, p) + z = fp_sub(raw, fp_mul(fp_mul(comp, raw, p), proj, p), p) + zero = [[0] * size for _ in range(size)] + require(fp_mul(fp_mul(comp, z, p), proj, p) == zero, "QZP is not zero") + pzp = fp_mul(fp_mul(proj, z, p), proj, p) + qzq = fp_mul(fp_mul(comp, z, p), comp, p) + diagonal = fp_add(pzp, qzq, p) + rank_z = fp_rank(z, p) + require( + fp_rank(diagonal, p) == fp_rank(pzp, p) + fp_rank(qzq, p), + "pinching rank is not additive", + ) + require(fp_rank(diagonal, p) <= rank_z, "pinching outranks Z") + row_ids = [r for r in range(size) if rng.getrandbits(1)] or [0] + col_ids = [c for c in range(size) if rng.getrandbits(1)] or [0] + sub = [[diagonal[r][c] for c in col_ids] for r in row_ids] + require(fp_rank(sub, p) <= rank_z, "a submatrix outranks Z") + checked += 1 + return {"checked": checked} + + +# ------------------------------------------------------------ packing bound -- + + +def exponents_target(g: int, leaf: int) -> tuple[int, ...]: + """M_j = product of D_k over k >= j.""" + return tuple(int(k >= leaf) for k in range(g)) + + +def exponents_internal(g: int, stage: int, leaf: int, power: int) -> tuple[int, ...]: + """lambda(t, j) * D_t^a from the source note, section 4.""" + vector = [int(k > stage) for k in range(g)] + if leaf < stage: + vector[leaf] += 1 + vector[stage] += power + return tuple(vector) + + +def exponents_external(g: int, gap: int, leaf: int) -> tuple[int, ...]: + """mu(gamma, j): stages >= gamma act on the core, stage j < gamma on leaf j.""" + vector = [int(k >= gap) for k in range(g)] + if leaf < gap: + vector[leaf] += 1 + return tuple(vector) + + +def contributors(g: int, leaf: int) -> set[tuple[str, int]]: + """Gaps whose thin maps can contribute the monomial M_j on leaf j.""" + target = exponents_target(g, leaf) + found: set[tuple[str, int]] = set() + for stage in range(g): + for power in range(3): + if exponents_internal(g, stage, leaf, power) == target: + require(power in (0, 1), "a squared monomial met the target") + found.add(("internal", stage)) + for gap in range(g + 1): + if exponents_external(g, gap, leaf) == target: + found.add(("external", gap)) + expected = {("internal", t) for t in (leaf - 1, leaf, leaf + 1) if 0 <= t < g} + expected |= {("external", leaf), ("external", leaf + 1)} + require(found == expected, "contributor set differs from the stated one") + return found + + +def disjoint(sets: list[set[tuple[str, int]]]) -> bool: + seen: set[tuple[str, int]] = set() + for item in sets: + if seen & item: + return False + seen |= item + return True + + +def covering_stages(g: int) -> list[int]: + """Stages whose internal gaps cover every leaf (a feasible covering point).""" + stages = list(range(1, g, 3)) + if g % 3 == 1: + stages.append(g - 1) + return stages + + +def covers_all(g: int, stages: list[int]) -> bool: + chosen = {("internal", t) for t in stages} + return all(contributors(g, leaf) & chosen for leaf in range(g)) + + +def packing_bound(g: int, q: int) -> int: + """Lower bound 2q * ceil(g/3), with the matching covering point.""" + leaves = list(range(0, g, 3)) + require(len(leaves) == -(-g // 3), "leaf count is not ceil(g/3)") + require(disjoint([contributors(g, leaf) for leaf in leaves]), "chosen leaves share a gap") + stages = covering_stages(g) + require(covers_all(g, stages), "covering point misses a leaf") + require(len(stages) == len(leaves), "covering and packing values differ") + return 2 * q * len(leaves) + + +def packing_checks() -> dict[str, object]: + for g in range(1, MAX_STAGES + 1): + for q in (1, TARGET_Q): + bound = packing_bound(g, q) + require(bound == 2 * q * -(-g // 3), "closed form changed") + require(3 * bound >= 2 * q * g, "packing bound fell below 2qg/3") + require(2 * bound >= q * g, "packing bound fell below qg/2") + target = packing_bound(TARGET_G, TARGET_Q) + require(target == 572, "target bound changed") + require(TARGET_Q * TARGET_G // 2 == 403, "source bound changed") + require(-(-2 * TARGET_Q * TARGET_G // 3) == 538, "weight-count bound changed") + require(5 * TARGET_Q == 130 and 130 < target, "five rank-26 maps are not excluded") + # Rejection controls: adjacent packing leaves share a gap; a thinned cover misses a leaf. + near = [contributors(TARGET_G, leaf) for leaf in range(0, TARGET_G, 2)] + require(not disjoint(near), "spacing-two leaves were accepted") + require(not covers_all(TARGET_G, covering_stages(TARGET_G)[1:]), "a thinned cover was accepted") + return { + "stages_checked": MAX_STAGES, + "g": TARGET_G, + "q": TARGET_Q, + "packing_bound": target, + "weight_count_bound": 538, + "source_bound": 403, + "five_rank_q_maps": 130, + } + + +def main() -> int: + rng = random.Random(SEED) + result = { + "census_q1": census_q1(), + "factor_two_control_q1": excess_without_square_q1(), + "random_actual": random_actual(rng), + "general_field": general_field(rng), + "sharpness_rank": sharpness(), + "three_leaf_q1": three_leaf_q1(), + "packing": packing_checks(), + } + text = json.dumps(result, sort_keys=True, separators=(",", ":")) + digest = hashlib.sha256(text.encode("ascii")).hexdigest()[:16] + print(json.dumps(result, sort_keys=True, indent=1)) + print( + "PASS_EVERY_STAGE_GAP_RANK_FACTOR" + f" factor=1 bound_g31_q26={result['packing']['packing_bound']}" + f" certificate={digest} no_new_kappa" + ) + return 0 + + +if __name__ == "__main__": + sys.exit(main())