From bfba8ba43dcbf5e0841044e07f24f158b7ead96e Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 11 Nov 2026 10:36:14 +0000 Subject: [PATCH] Record that the (1, 14) shape (7, 6, 1, 1, 0, 0) forces a 12 at (18, 21). The weight-3 sums q_1 + q_14 are the 180 realizations of (7, 6, 1, 1, 0, 0) and the 120 realizations of (6, 6, 1, 1, 1, 0). The tested shape has 360 weight-3 extensions to (18, 21), and every extension carries a 12. No kappa change. Co-authored-by: unpaidmoon --- .../six-source-c6-sum15-pair114/README.md | 301 +++++++++++ .../six-source-c6-sum15-pair114/SOURCES.json | 18 + .../six-source-c6-sum15-pair114/TASK.json | 68 +++ .../six-source-c6-sum15-pair114/VERIFY.json | 34 ++ .../six-source-c6-sum15-pair114/verify.py | 494 ++++++++++++++++++ 5 files changed, 915 insertions(+) create mode 100644 research/six-source-c6-sum15-pair114/README.md create mode 100644 research/six-source-c6-sum15-pair114/SOURCES.json create mode 100644 research/six-source-c6-sum15-pair114/TASK.json create mode 100644 research/six-source-c6-sum15-pair114/VERIFY.json create mode 100644 research/six-source-c6-sum15-pair114/verify.py diff --git a/research/six-source-c6-sum15-pair114/README.md b/research/six-source-c6-sum15-pair114/README.md new file mode 100644 index 0000000000..e58209706d --- /dev/null +++ b/research/six-source-c6-sum15-pair114/README.md @@ -0,0 +1,301 @@ +# The weight-3 shape (0, 0, 1, 1, 6, 7) at (1, 14) forces a 12 at (18, 21) + +**Scoped positive result. No new κ.** In the unchanged unsigned dirty +connector, the weight-3 values of `q_1 + q_14` are the permutations of +`(7, 6, 1, 1, 0, 0)` and of `(6, 6, 1, 1, 1, 0)`. The first shape meets the +shared `q_18` multiset of families T4 and T5, and no other multiset among +the six separation-3 families of PR #7029. Its set of weight-3 extensions +to `(18, 21)` is nonempty, and every extension has two coordinates equal +to 12. The selected conditional κ remains +`363005817/100000000000`. + +## Interface, unchanged + +A floor word on `k = 6` sources in characteristic `c = 6` has length 36 and +calls each source exactly six times. `q_t` counts the first `t` letters, so +`q_0 = 0`, `q_36 = (6,6,6,6,6,6)`, and each step adds one basis vector. +Counts stay in `{0,...,6}` and are componentwise nondecreasing. A pair +realizes a **weight-3 mask** when every coordinate of `q_s + q_t` lies in +`{0,1,6,7,12}` and exactly three coordinates lie in `{1,7}`. This is the +interface of PR #4231, PR #4248 and PR #6107, as used by PR #6141, PR #6955, +PR #7029 and PR #7043. + +The pair under test is `(1, 14)`. The sum `q_1 + q_14` has coordinate sum +15. The later index is 14, so `q_18 - q_14` is four letters and +`q_21 - q_18` is three letters. PR #7043 settled the gap-three pair +`(0, 15)`. The four-letter budget is the difference. + +## The weight-3 sums at (1, 14) + +Let `q` be a vector in `{0,...,6}^6` with coordinate sum 14, and let `j` be +a coordinate with `q_j ≥ 1`. The first letter may be source `j`, and +`S = q + e_j` is a value of `q_1 + q_14`. The coordinate sum of `S` is 15. +A weight-3 mask of sum 15 has carry `λ = 2`, because the coordinate sum is +`3 + 6λ`. + +**Lemma.** The weight-3 values of `S` are exactly the following pairs. + +- Shape B, the shape tested below. `S` is a permutation of + `(7,6,1,1,0,0)` and `q_j = 6`. Then `q` is a permutation of + `(6,6,1,1,0,0)`, and `j` is one of the two coordinates equal to 6. + There are 180 such pairs and 90 such prefixes. +- Shape A, listed and not extended. `S` is a permutation of + `(6,6,1,1,1,0)` and `q_j = 5`. Then `q` is a permutation of + `(6,5,1,1,1,0)`, with the 5 in position `j`. There are 120 such pairs. + +**Proof.** A coordinate of `S` equals `q_i` for `i ≠ j` and equals +`q_j + 1` at `j`. Thus every coordinate except possibly `j` lies in +`{0,...,6}`, and `S_j` lies in `{2,...,7}`. A weight-3 coordinate lies in +`{0,1,6,7,12}`, so `S_j ∈ {6,7}` and no coordinate equals 12. In +particular the sum-15 residue `(12,1,1,1,0,0)` is not a value of +`q_1 + q_14`. + +The carry `λ = 2` is then two coordinates in `{6,7}`. The coordinate `j` +is one of them. + +If `S_j = 6`, then `q_j = 5`. This coordinate contributes carry and no +mask bit. The other carry coordinate `i ≠ j` has `S_i ≤ 6`, so `S_i = 6`. +The remaining four coordinates lie in `{0,1}` and supply all three mask +bits, so they are three 1s and one 0. The sorted shape is +`(0,1,1,1,6,6)`. Choosing `j`, then the other 6, then the three 1s gives +`6 · 5 · 4 = 120` pairs. + +If `S_j = 7`, then `q_j = 6`. This coordinate contributes carry and one +mask bit. The other carry coordinate is a 6, and the remaining four +coordinates supply two mask bits, so they are two 1s and two 0s. The +sorted shape is `(0,0,1,1,6,7)`. Choosing `j`, then the other 6, then the +two 1s gives `6 · 5 · C(4,2) = 180` pairs. + +These cases exhaust `S_j ∈ {6,7}`. ∎ + +The same list is the census of the finite domain. Inclusion-exclusion +counts the vectors in `{0,...,6}^6` of sum 14: + +```text +C(19,5) - 6 C(12,5) + 15 C(5,5) = 11628 - 4752 + 15 = 6891. +``` + +For each fixed first-letter source, the legal prefixes are the sum-13 +vectors whose distinguished coordinate is at most 5. There are +`5796 - 325 = 5471` of them, and `6 · 5471 = 32826` pairs. `verify.py` +visits every tuple in `{0,...,6}^6`, finds those 6891 vectors and 32826 +pairs, and finds that the weight-3 pairs are exactly the two orbits above. +The domain is finite and the loop visits every element. This is an +exhaustive census of length-14 count pairs. It is not a census of words. + +## One shape against the six families + +The tested shape is `(7,6,1,1,0,0)`. Its prefix `q_14` is a permutation of +`(6,6,1,1,0,0)`. PR #7029 classifies every weight-3 pair at `(18, 21)` +into six families. This package does not repeat that census. It uses the +six families through the multisets of `q_18` they allow. + +| family | `q_18` up to permutation | coordinates equal to 12 | +|---|---|---:| +| T1 | `(3,3,3,3,3,3)` | 0 | +| T2 | `(6,3,3,3,3,0)` | 1 | +| T3 | `(6,3,3,3,3,0)` | 1 | +| T4 | `(6,6,3,3,0,0)` | 2 | +| T5 | `(6,6,3,3,0,0)` | 2 | +| T6 | `(6,6,6,0,0,0)` | 3 | + +The dependency check re-solves the three recorded budget equations + +```text +n_{0,1} + n_{3,1} = 3, +n_{0,0} + n_{3,0} + n_{6,0} = 3, +3 n_{3,0} + 3 n_{3,1} + 6 n_{6,0} = 18 +``` + +on `{0,...,6}` and recovers these six rows and these four multisets. + +**Proposition.** For `q_14` a permutation of `(6,6,1,1,0,0)`, the only +reachable multiset among these four is `(6,6,3,3,0,0)`, the common +multiset of T4 and T5. + +**Proof.** Two coordinates of `q_14` are already 6, so they remain 6 in +`q_18`. T1 has no coordinate equal to 6. T2 and T3 have one. T6 has three. +A third 6 would have to be raised from a coordinate in `{0,1}`, which costs +at least five letters, and the gap supplies four. T4 and T5 require the +remaining piece `(1,1,0,0)` to become `(3,3,0,0)`. A 1 cannot fall. Both +0s therefore stay 0, and each 1 receives two letters. That bridge has sum +4 and respects the cap. ∎ + +The two families are distinguished by the three-letter bridge, not by +`q_18`. On the representative `q_14 = (6,6,1,1,0,0)` the unique four-letter +bridge into this multiset is `(0,0,2,2,0,0)`. The T4 bridges are +`(0,0,1,1,1,0)` and `(0,0,1,1,0,1)`. The T5 bridges are `(0,0,0,1,1,1)` +and `(0,0,1,0,1,1)`. Their separation sums are permutations of +`(0,1,7,7,12,12)` and `(1,1,6,7,12,12)`. Both are weight 3, and both +contain a 12. + +## Forcing, on a nonempty extension set + +In PR #7029, a mask **forces a 12** when its weight-3 extensions to +`(18, 21)` form a nonempty set and every such extension has a coordinate +equal to 12. The same definition is used here. + +**Theorem.** The shape `(7,6,1,1,0,0)` forces a 12 at `(18, 21)`. Every +count extension of its prefix has two coordinates equal to 12, and at least +one extension is weight 3. + +**Proof.** A realization has `q_14` a permutation of `(6,6,1,1,0,0)`. Those +two sources are at the cap, so every later letter lands on one of the other +four sources. Both `q_18` and `q_21` remain 6 on the capped sources, and +the separation sum is 12 on both. This holds for every four-letter bridge +and every three-letter bridge. It does not use the weight-3 predicate. + +The extension set is nonempty. The floor word + +```text +000000123111112233234223344444555555 +``` + +has `q_9 = (6,1,1,1,0,0)`, `q_14 = (6,6,1,1,0,0)`, and +`q_1 + q_14 = (7,6,1,1,0,0)`. Its separation-3 sum is +`(12,12,7,7,1,0)`, which is weight 3. The same word is also weight 3 at +`(0, 9)`. Thus the shape, the mask at `(0, 9)`, and a 12 at `(18, 21)` +occur together in one floor word. ∎ + +The word shows that the price is not an incompatibility with hypothesis +(H1) of PR #7029. The five letters from index 9 to index 14 are five calls +of source 1, taking `(6,1,1,1,0,0)` to `(6,6,1,1,0,0)`. + +## The same 12 under hypothesis (H2) + +Write `S(s) = q_s + q_{39-s}`, and keep (H2) as in PR #7029: every pair +`(s, 39-s)` for `s = 4,...,18` is weight-3. Write (H114) for the statement +that `q_1 + q_14` is a permutation of `(7,6,1,1,0,0)` with the 7 on the +first letter. + +The adjacent sums satisfy + +```text +S(s+1) = S(s) + e_{w_s} - e_{w_{38-s}}, +``` + +because `q_{s+1} = q_s + e_{w_s}` and `q_{39-s} = q_{38-s} + e_{w_{38-s}}`. +If `S(s)` and `S(s+1)` are both weight-3 and `S(s+1)_j = 12`, the letter +pair cannot move coordinate `j`: the moved values would be 11 or 13, both +outside `{0,1,6,7,12}`. Coordinate `j` stays 12. + +**Corollary.** No six-source characteristic-6 floor word satisfies (H114) +and (H2) together. + +**Proof.** (H2) at `s = 18` makes `(18, 21)` weight-3. By the theorem, a +source `j` that equals 6 in `q_14` equals 12 in `S(18)`. The one-step +identity keeps coordinate `j` equal to 12 for `s = 17, 16, ..., 4`. At +`s = 4` the partner is 35, so `S(4) = q_4 + q_35`. Each coordinate of +`q_4` is at most 4, and each coordinate of `q_35` is at most 6, so each +coordinate of `S(4)` is at most 10. It cannot be 12. ∎ + +The witness attains the bound 10 on the capped source at `s = 4`: +`S(4) = (10,6,6,6,6,5)`. That vector is not weight-3, so the witness does +not satisfy (H2). The corollary is the incompatibility of the two +hypotheses. It is not an unrestricted depth-two exclusion. + +## Exhaustive count of the extensions + +The cap argument and the explicit word prove the theorem. The checker also +counts the finite set of bridges, without using the family list to decide +which sums are weight-3. + +For the representative, two coordinates are already 6. The four letters are +supported on the other four coordinates, each with room at least 5, so the +part bound is the letter count 4. The number of first bridges is + +```text +C(4+4-1, 4) = 35. +``` + +Joining each of them to every legal three-letter bridge produces 684 pairs. +All 684 separation sums are 12 on the two capped sources, and 4 of the 684 +are weight-3. Those four are the T4 and T5 bridges named above. A second +enumerator, ranging over the same caps by a direct product, returns the +same 684 pairs and the same four hits. + +The 90 permutations of `q_14` each have this count. The orbit has +`90 · 684 = 61560` bridge pairs and `90 · 4 = 360` weight-3 extensions. +Every one of the 61560 sums is 12 on the capped sources, so every weight-3 +extension has a 12. The loops visit every pair. This is an exhaustive +finite census of count extensions of this shape. A floor word realizing +the shape determines one of these prefixes and one of these bridges, so +every such word has a 12 in `q_18 + q_21`. The census is not a census of +words. + +Two prefixes outside the orbit keep the enumerator honest. The vector +`(0,0,1,4,4,5)` has 3208 bridge pairs and no weight-3 extension. The +vector `(2,2,2,2,3,3)` has 6220 bridge pairs and 20 weight-3 extensions, +all equal to a permutation of `(6,6,6,7,7,7)`, and none contains a 12. +One of them is the T1 bridge `q_18 = (3,3,3,3,3,3)` with +`δ = (1,1,1,0,0,0)`. The same two enumerators agree on both prefixes. + +## What remains for a human c=6 proof + +Depth two requires every nonzero mask on some pair `s + t ≡ 3 (mod 6)`. +It does not require (H114), and it does not require (H2). The corollary +excludes only the words that satisfy both. The witness is a floor word in +which (H114), the mask at `(0, 9)`, and a weight-3 sum at `(18, 21)` all +hold, while `S(4)` is outside the allowed set. + +PR #6141's solver verdict remains the evidence for the unrestricted +six-source depth-two exclusion. This package does not rerun it and does +not emit a DRAT certificate. PR #7043's emptiness result for `(0, 15)` is +not recomputed. The other shape at `(1, 14)`, whose prefix is a permutation +of `(6,5,1,1,1,0)`, is counted and not extended. PR #7176 places both +`(0, 15)` and `(1, 14)` outside its endpoint-window census. The residue +shape `(12,1,1,1,0,0)` remains the second open question of PR #7043. +Characteristic 5 is not tested. No supplier, consumer, or selected frontier +changes. + +## Reproduce + +Python 3.12, standard library only, from the repository root: + +```sh +python3.12 -I -W error -B research/six-source-c6-sum15-pair114/verify.py +python3.12 -I -O -W error -B research/six-source-c6-sum15-pair114/verify.py +python3.12 -B scripts/research_package.py --package research/six-source-c6-sum15-pair114 --check-only +``` + +The marker is + +```text +PASS_SIX_SOURCE_C6_SUM15_PAIR114 vectors=6891 pairs=32826 weight3_shape_b=180 weight3_shape_a=120 shape=(0, 0, 1, 1, 6, 7) q14=(0, 0, 1, 1, 6, 6) families=6 family_hits=2 shape_trials=61560 shape_extensions=360 shape_extension_twelves=360 all_extension_sums_with_twelve=61560 live_zero_hits=0 live_t1_hits=20 live_t1_twelves=0 controls=19 +``` + +Failures raise `SystemExit`. Optimized mode cannot silence them. No Lean, +Docker, or solver replay was run. + +## Open next questions + +1. Does the other weight-3 shape at `(1, 14)`, the permutations of + `(6,6,1,1,1,0)`, force a 12 at `(18, 21)` on a nonempty extension set? + *Why:* its prefix is a permutation of `(6,5,1,1,1,0)`. Only one source + is at the cap, so the double-12 argument used for `(7,6,1,1,0,0)` does + not apply, and the four-letter bridge can raise the 5. *First step:* + test `q_14 = (6,5,1,1,1,0)` against the same six `q_18` multisets. + *Blocked by:* this package extends only `(7,6,1,1,0,0)`. +2. For the tested shape, can hypothesis (H2) be shortened below the full + chain `s = 4,...,18`? *Why:* the corollary uses every intermediate + index, while the witness fails (H2) at `s = 4` and still realizes a + weight-3 sum at `(18, 21)`. A different bridge might be weight-3 at + `s = 4` and fail at another index. *First step:* build one floor word + for each of the other three `δ` bridges on + `q_14 = (6,6,1,1,0,0)` and record the smallest `s` in `4,...,17` at + which `S(s)` is not weight-3. *Blocked by:* those three words are not + assembled here. + +## Credit + +The depth-two interface and the weight identity are Nick Petalas's +(PR #4231, PR #4248, PR #6107), with the Ross Richardson PR #934 / PR #943 +lineage. JosieElliston's PR #6141 records the c=6 solver verdict. +PR #6955 supplies the two explicit floor words used here as controls. +PR #7029 supplies the six separation-3 families, the nonempty 12-price of +the mask at `(0, 9)`, hypothesis (H2), and the one-step identity applied +in the corollary. PR #7043 settled the gap-three pair `(0, 15)` and asked +the question answered here. PR #7176 records that `(1, 14)` lies outside +its endpoint-window package. Those classifications are not re-proved. + +Prepared by unpaidmoon with substantial Cursor Grok assistance. Apache-2.0. diff --git a/research/six-source-c6-sum15-pair114/SOURCES.json b/research/six-source-c6-sum15-pair114/SOURCES.json new file mode 100644 index 0000000000..5335fa97d9 --- /dev/null +++ b/research/six-source-c6-sum15-pair114/SOURCES.json @@ -0,0 +1,18 @@ +{ + "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" + } + ] +} diff --git a/research/six-source-c6-sum15-pair114/TASK.json b/research/six-source-c6-sum15-pair114/TASK.json new file mode 100644 index 0000000000..f39b69a1dc --- /dev/null +++ b/research/six-source-c6-sum15-pair114/TASK.json @@ -0,0 +1,68 @@ +{ + "schema_version": 1, + "task_id": "connector-alphabet-change", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "connector-alphabet-change", + "question": "Does one explicit extension of the connector alphabet offer a favorable completed budget?", + "starting_points": [ + "docs/research/research-family-status.md", + "research/universal-connector-boundary/README.md", + "certificates/selected-result.json" + ], + "methods": [ + "Construct and charge a legal extra operation on a minimal instance.", + "Prove a target-specific bound after adding one specified operation family." + ], + "acceptance_gate": "State which fixed-alphabet premise changes and charge its implementation; do not declare it free. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "research/universal-connector-boundary/verify.py" + ], + "expected": "PASS_UNIVERSAL_CONNECTOR_BOUNDARY", + "inspect": "Reproduce the 945-pairing control, then read Exact interface to list the allowed calls.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Add exactly one legally priced operation and test a tiny dirty-input instance before enumerating larger cases.", + "bottleneck_link": "A new legal connector operation could change recursive interface cost; a larger census in the same alphabet is a separate side result.", + "allowed_variations": [ + "Choose one additional operation and a small source count for its first counterexample." + ], + "scope_change_triggers": [ + "Keeping the alphabet and only increasing the source count; record this as a changed assignment.", + "Extending a source-count census without naming a supplier/interface decision it could change; audit #2973 pruning concerns before relying on the affected predecessor exclusions." + ], + "overlap_terms": [ + "universal connector", + "source-toggle", + "connector alphabet" + ] + }, + "scope_status": "changed", + "actual_scope": "List the weight-3 sums q_1 + q_14 for a six-source characteristic-6 floor word, and test the shape (7,6,1,1,0,0) against the six separation-3 families of PR #7029. The weight-3 sums are the 180 realizations of (7,6,1,1,0,0) and the 120 realizations of (6,6,1,1,1,0). The tested shape meets only the shared q_18 multiset of T4 and T5. Every count extension to (18, 21) has two coordinates equal to 12, and the weight-3 extension set has 360 elements, so the shape forces a 12 on a nonempty extension set. Together with hypothesis (H2) of PR #7029 this excludes a floor word. The other shape is not extended. The unrestricted depth-two exclusion remains the solver verdict of PR #6141.", + "scope_change_reason": "The catalogue card asks for one new connector operation. This package keeps the unsigned dirty connector alphabet fixed and takes open question 1 of PR #7043: list the weight-3 sums q_1 + q_14 and test one shape against the six q_18 multisets. The pair is (1, 14), whose gap to index 18 is four letters. A new operation is not the missing step.", + "bottleneck_link": "Side result on the recursive-interface schedule. It does not change a supplier, a consumer, or kappa. The nonempty 12-price shows how this total-15 shape differs from the empty extension set at (0, 15), and it records the exact hypotheses still required for a human c=6 proof.", + "budget_minutes": 60, + "stop_rule": "Stop after the weight-3 list at (1, 14) and the test of (7,6,1,1,0,0) against the six families. Do not extend the other shape, rerun the separation-3 census, test the residue shape (12,1,1,1,0,0), or claim a complete human c=6 exclusion.", + "outcome": "completed", + "evidence": "Proof of the shape list: a weight-3 value of q_1 + q_14 has carry 2 and no coordinate 12, so it is a permutation of (7,6,1,1,0,0) with the first letter on the 7, or of (6,6,1,1,1,0) with the first letter on a 6. There are 180 and 120 such pairs. Exhaustive census: 6891 length-14 vectors and 32826 legal pairs, agreeing with inclusion-exclusion, and no other weight-3 pair. Cap argument: the tested prefix has two sources at 6, so all 61560 bridges from its 90 permutations put 12 on those sources. Explicit floor word 000000123111112233234223344444555555 realizes the shape, the (0, 9) mask, and separation sum (12,12,7,7,1,0). Census of the bridges: 360 weight-3 extensions, all inside T4 and T5. Corollary: (H114) and (H2) cannot hold together, because the forced 12 cannot occur in S(4). Nineteen controls. No SAT solver was run. No kappa change is claimed.", + "author": "unpaidmoon", + "ai_assistance": "Substantial Cursor Grok assistance: the case analysis, the exhaustive checker, and the package text.", + "open_questions": [ + { + "question": "Does the other weight-3 shape at (1, 14), the permutations of (6,6,1,1,1,0), force a 12 at (18, 21) on a nonempty extension set?", + "why_it_matters": "Its prefix is a permutation of (6,5,1,1,1,0). Only one source is at the cap, so the double-12 argument used for (7,6,1,1,0,0) does not apply, and the four-letter bridge can raise the 5.", + "first_step": "Test q_14 = (6,5,1,1,1,0) against the same six q_18 multisets.", + "blocked_by": "This package extends only (7,6,1,1,0,0)." + }, + { + "question": "For the tested shape, can hypothesis (H2) be shortened below the full chain s = 4,...,18?", + "why_it_matters": "The corollary uses every intermediate index, while the witness fails (H2) at s = 4 and still realizes a weight-3 sum at (18, 21). A different bridge might be weight-3 at s = 4 and fail at another index.", + "first_step": "Build one floor word for each of the other three delta bridges on q_14 = (6,6,1,1,0,0) and record the smallest s in 4,...,17 at which S(s) is not weight-3.", + "blocked_by": "Those three words are not assembled here." + } + ] +} diff --git a/research/six-source-c6-sum15-pair114/VERIFY.json b/research/six-source-c6-sum15-pair114/VERIFY.json new file mode 100644 index 0000000000..a3b011717d --- /dev/null +++ b/research/six-source-c6-sum15-pair114/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": 60, + "checks": "Shape list at (1, 14) and one shape against the six families. Inclusion-exclusion and a scan of {0,...,6}^6 agree on 6891 length-14 vectors and 32826 legal pairs (q_14, q_1). Exactly 180 pairs have sorted sum (0, 0, 1, 1, 6, 7) and 120 have sorted sum (0, 1, 1, 1, 6, 6). The recorded budget equations recover the six PR #7029 type-counts. From q_14 a permutation of (6, 6, 1, 1, 0, 0), only the shared q_18 multiset of T4 and T5 is reachable in four letters. The representative prefix has 35 first-gap bridges and 684 bridge pairs, of which 4 are weight-3, and all 684 sums are 12 on the two capped sources. The orbit of 90 prefixes has 61560 bridge pairs and 360 weight-3 extensions, all carrying a 12. A second product enumerator agrees on the representative, on a 3208-bridge prefix with no weight-3 extension, and on a T1 prefix with 20 weight-3 extensions and no 12. An explicit floor word realizes the shape, the (0, 9) mask, and a 12 at (18, 21). Nineteen controls." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 60, + "checks": "Same census and controls under optimized Python. Failures are SystemExit, not assertions." + } + ] +} diff --git a/research/six-source-c6-sum15-pair114/verify.py b/research/six-source-c6-sum15-pair114/verify.py new file mode 100644 index 0000000000..fdb7b3deea --- /dev/null +++ b/research/six-source-c6-sum15-pair114/verify.py @@ -0,0 +1,494 @@ +#!/usr/bin/env python3 +"""Weight-3 sums at (1, 14), and one shape against the six families. + +The written argument is in README.md. This program enumerates every legal +pair (q_14, q_1) and every cap-respecting bridge from the shape +(0, 0, 1, 1, 6, 7) to the slot (18, 21). It does not search depth-two words +and it does not call a SAT solver. +""" + +import itertools +from math import comb + +K = 6 +CAP = 6 +LENGTH = 14 +GAP_TO_18 = 4 +GAP_TO_21 = 3 +ALLOWED = (0, 1, 6, 7, 12) +ALLOWED_SET = set(ALLOWED) +MASK_BIT = {0: 0, 1: 1, 6: 0, 7: 1, 12: 0} + +# Tested shape of q_1 + q_14, and the length-14 prefix it determines. +SHAPE = (7, 6, 1, 1, 0, 0) +SORTED_SHAPE = tuple(sorted(SHAPE)) +Q14 = (6, 6, 1, 1, 0, 0) +SORTED_Q14 = tuple(sorted(Q14)) + +# The other weight-3 shape at this pair. Counted in the list, not extended. +SHAPE_A = (6, 6, 1, 1, 1, 0) +SORTED_SHAPE_A = tuple(sorted(SHAPE_A)) +Q14_A = (6, 5, 1, 1, 1, 0) +SORTED_Q14_A = tuple(sorted(Q14_A)) + +# Recorded q_18 multisets of the six separation-3 families in PR #7029. +# T2 and T3 share a multiset, as do T4 and T5. +FAMILY_Q18 = { + "T1": (3, 3, 3, 3, 3, 3), + "T2": (0, 3, 3, 3, 3, 6), + "T3": (0, 3, 3, 3, 3, 6), + "T4": (0, 0, 3, 3, 6, 6), + "T5": (0, 0, 3, 3, 6, 6), + "T6": (0, 0, 0, 6, 6, 6), +} + +# One floor word realizing the tested shape, the (0, 9) mask, and a 12 at +# (18, 21). It is a witness for the extension, not a depth-two word. +WITNESS = "000000123111112233234223344444555555" +# Separation-3 witness from the c=6 centre note. Its q_14 is not this shape. +SEPARATION3_WORD = "333333444444555555012000001111122222" +# Off-diagonal witness. Weight 3 at (0, 9), not at (18, 21). +PAIR09_WORD = "333333012000001111122222444444555555" + +ZERO_PREFIX = (0, 0, 1, 4, 4, 5) +T1_PREFIX = (2, 2, 2, 2, 3, 3) +T1_EPSILON = (1, 1, 1, 1, 0, 0) +T1_DELTA = (1, 1, 1, 0, 0, 0) + +WITNESS_HITS = ( + ((0, 0, 2, 2, 0, 0), (0, 0, 0, 1, 1, 1)), + ((0, 0, 2, 2, 0, 0), (0, 0, 1, 0, 1, 1)), + ((0, 0, 2, 2, 0, 0), (0, 0, 1, 1, 0, 1)), + ((0, 0, 2, 2, 0, 0), (0, 0, 1, 1, 1, 0)), +) +EXPECTED_SUMS = { + (0, 1, 7, 7, 12, 12): 2, + (1, 1, 6, 7, 12, 12): 2, +} +EXPECTED_ROWS = { + ((0, 0), (0, 1), (3, 1), (3, 1), (6, 0), (6, 0)): 2, + ((0, 1), (0, 1), (3, 0), (3, 1), (6, 0), (6, 0)): 2, +} + + +def fail(message): + raise SystemExit("FAIL: " + message) + + +def mask_weight(values): + bits = 0 + for value in values: + if value not in ALLOWED_SET: + return None + bits += MASK_BIT[value] + return bits + + +def weight3(values): + return mask_weight(values) == 3 + + +def bounded_count(total, cap=CAP, slots=K): + """Inclusion-exclusion count of {0,...,cap}^slots summing to total.""" + found = 0 + for excised in range(total // (cap + 1) + 1): + rest = total - excised * (cap + 1) + sign = 1 if excised % 2 == 0 else -1 + found += sign * comb(slots, excised) * comb(rest + slots - 1, slots - 1) + return found + + +def compositions(total, caps): + """Every tuple with 0 <= entry <= caps[i] and coordinate sum total.""" + + def rec(index, remain): + last = index == len(caps) - 1 + if last: + if 0 <= remain <= caps[index]: + yield (remain,) + return + for value in range(min(caps[index], remain) + 1): + for tail in rec(index + 1, remain - value): + yield (value,) + tail + + yield from rec(0, total) + + +def bridge_caps(prefix, gap): + caps = tuple(CAP - value for value in prefix) + if any(cap < 0 for cap in caps): + return None + return tuple(min(gap, cap) for cap in caps) + + +def bridges(prefix, gap): + caps = bridge_caps(prefix, gap) + if caps is None: + return + yield from compositions(gap, caps) + + +def product_bridges(prefix, gap): + caps = bridge_caps(prefix, gap) + if caps is None: + return + ranges = [range(cap + 1) for cap in caps] + for values in itertools.product(*ranges): + if sum(values) == gap: + yield values + + +def add(left, right): + return tuple(left[j] + right[j] for j in range(K)) + + +def separation_sum(q18, delta): + return tuple(2 * q18[j] + delta[j] for j in range(K)) + + +def extension_census(prefix, bridge_fn): + trials = 0 + hits = 0 + with_twelve = 0 + frozen_ok = 0 + hit_pairs = [] + sum_counts = {} + row_counts = {} + frozen = tuple(index for index in range(K) if prefix[index] == CAP) + for epsilon in bridge_fn(prefix, GAP_TO_18): + q18 = add(prefix, epsilon) + for delta in bridge_fn(q18, GAP_TO_21): + trials += 1 + summed = separation_sum(q18, delta) + if frozen and all(summed[index] == 12 for index in frozen): + frozen_ok += 1 + if 12 in summed: + with_twelve += 1 + if weight3(summed): + hits += 1 + hit_pairs.append((epsilon, delta)) + key = tuple(sorted(summed)) + sum_counts[key] = sum_counts.get(key, 0) + 1 + rows = tuple(sorted((q18[index], delta[index]) for index in range(K))) + row_counts[rows] = row_counts.get(rows, 0) + 1 + return { + "trials": trials, + "hits": hits, + "with_twelve": with_twelve, + "frozen_ok": frozen_ok, + "hit_pairs": hit_pairs, + "sums": sum_counts, + "rows": row_counts, + } + + +def prefix_counts(word, length): + counts = [0] * K + for source in word[:length]: + counts[int(source)] += 1 + return tuple(counts) + + +def reachable(prefix, target, gap): + for perm in set(itertools.permutations(target)): + if all(prefix[j] <= perm[j] <= min(CAP, prefix[j] + gap) for j in range(K)): + return True + return False + + +def family_solutions(): + """Nonnegative solutions of the recorded three-letter budget equations.""" + found = [] + for counts in itertools.product(range(K + 1), repeat=5): + n01, n31, n00, n30, n60 = counts + if n01 + n31 != 3: + continue + if n00 + n30 + n60 != 3: + continue + if 3 * n30 + 3 * n31 + 6 * n60 != 18: + continue + coords = ( + (0,) * n01 + + (3,) * n31 + + (0,) * n00 + + (3,) * n30 + + (6,) * n60 + ) + if len(coords) != K: + fail("family coordinate count drifted") + found.append({"counts": counts, "q18": tuple(sorted(coords))}) + return found + + +def constructed_pairs(): + shape_b = set() + for counts in set(itertools.permutations(Q14)): + for index, value in enumerate(counts): + if value == CAP: + shape_b.add((counts, index)) + shape_a = set() + for counts in set(itertools.permutations(Q14_A)): + for index, value in enumerate(counts): + if value == 5: + shape_a.add((counts, index)) + return shape_b, shape_a + + +def scan_pairs(): + vectors = 0 + legal_pairs = 0 + shape_b = set() + shape_a = set() + other = [] + for counts in itertools.product(range(CAP + 1), repeat=K): + if sum(counts) != LENGTH: + continue + vectors += 1 + for index in range(K): + if counts[index] < 1: + continue + legal_pairs += 1 + summed = list(counts) + summed[index] += 1 + if not weight3(summed): + continue + key = tuple(sorted(summed)) + item = (counts, index) + if key == SORTED_SHAPE: + shape_b.add(item) + elif key == SORTED_SHAPE_A: + shape_a.add(item) + else: + other.append((item, key)) + return vectors, legal_pairs, shape_b, shape_a, other + + +def main(): + controls = 0 + + if not weight3(SHAPE) or tuple(sorted(SHAPE)) != SORTED_SHAPE: + fail("tested shape is not the named weight-3 mask") + if add(Q14, (1, 0, 0, 0, 0, 0)) != SHAPE: + fail("tested prefix does not produce the named shape") + controls += 1 + if weight3((2, 1, 1, 6, 6, 0)): + fail("a coordinate equal to 2 was accepted") + controls += 1 + if weight3((11, 1, 1, 1, 1, 0)) or weight3((13, 1, 1, 0, 0, 0)): + fail("a coordinate equal to 11 or 13 was accepted") + controls += 1 + if not weight3(SHAPE_A): + fail("the other total-15 shape was rejected") + if not weight3((12, 1, 1, 1, 0, 0)) or max((12, 1, 1, 1, 0, 0)) <= CAP: + fail("the sum-15 residue with a 12 is not an illegal prefix coordinate") + controls += 1 + + closed_vectors = bounded_count(LENGTH) + closed_pairs = 6 * (bounded_count(13) - bounded_count(7, slots=5)) + vectors, legal_pairs, shape_b, shape_a, other = scan_pairs() + if (vectors, closed_vectors) != (6891, 6891): + fail(f"length-14 census changed: enumerated={vectors} closed={closed_vectors}") + controls += 1 + if (legal_pairs, closed_pairs) != (32826, 32826): + fail(f"legal pair census changed: enumerated={legal_pairs} closed={closed_pairs}") + controls += 1 + built_b, built_a = constructed_pairs() + if other or shape_b != built_b or shape_a != built_a: + fail( + "weight-3 pair list changed: " + f"B={len(shape_b)} A={len(shape_a)} other={len(other)}" + ) + if (len(shape_b), len(shape_a)) != (180, 120): + fail(f"weight-3 orbit sizes changed: B={len(shape_b)} A={len(shape_a)}") + controls += 1 + + solutions = family_solutions() + got = sorted(item["counts"] for item in solutions) + expected_counts = [ + (0, 3, 0, 3, 0), + (0, 3, 1, 1, 1), + (1, 2, 0, 2, 1), + (1, 2, 1, 0, 2), + (2, 1, 0, 1, 2), + (3, 0, 0, 0, 3), + ] + if got != expected_counts: + fail(f"family equations changed: {got}") + by_counts = {item["counts"]: item["q18"] for item in solutions} + if by_counts != { + (0, 3, 0, 3, 0): FAMILY_Q18["T1"], + (0, 3, 1, 1, 1): FAMILY_Q18["T2"], + (1, 2, 0, 2, 1): FAMILY_Q18["T3"], + (1, 2, 1, 0, 2): FAMILY_Q18["T4"], + (2, 1, 0, 1, 2): FAMILY_Q18["T5"], + (3, 0, 0, 0, 3): FAMILY_Q18["T6"], + }: + fail(f"q_18 multisets changed: {by_counts}") + controls += 1 + + reached = sorted(name for name, target in FAMILY_Q18.items() if reachable(Q14, target, GAP_TO_18)) + if reached != ["T4", "T5"]: + fail(f"family reachability changed: {reached}") + controls += 1 + + first_caps = bridge_caps(Q14, GAP_TO_18) + if first_caps != (0, 0, 4, 4, 4, 4): + fail(f"first-gap caps changed: {first_caps}") + first_bridges = list(bridges(Q14, GAP_TO_18)) + if len(first_bridges) != 35 or len(first_bridges) != comb(7, 3): + fail(f"first-gap bridge count changed: {len(first_bridges)}") + if set(first_bridges) != set(product_bridges(Q14, GAP_TO_18)): + fail("composition and product enumerators disagree on the first gap") + controls += 1 + + representative = extension_census(Q14, bridges) + representative_product = extension_census(Q14, product_bridges) + if set(representative["hit_pairs"]) != set(representative_product["hit_pairs"]): + fail("composition and product enumerators disagree on the representative") + if representative["trials"] != 684 or representative["hits"] != 4: + fail( + "representative census changed: " + f"trials={representative['trials']} hits={representative['hits']}" + ) + if representative["with_twelve"] != 684 or representative["frozen_ok"] != 684: + fail( + "representative 12-count changed: " + f"with_twelve={representative['with_twelve']} " + f"frozen_ok={representative['frozen_ok']}" + ) + if representative["sums"] != EXPECTED_SUMS or representative["rows"] != EXPECTED_ROWS: + fail( + "representative hit types changed: " + f"sums={representative['sums']} rows={representative['rows']}" + ) + if set(representative["hit_pairs"]) != set(WITNESS_HITS): + fail(f"representative hit bridges changed: {representative['hit_pairs']}") + controls += 1 + + orbit = set(itertools.permutations(Q14)) + if len(orbit) != 90 or Q14 not in orbit: + fail(f"q_14 orbit changed: {len(orbit)}") + orbit_trials = 0 + orbit_hits = 0 + orbit_twelves = 0 + orbit_frozen = 0 + for counts in orbit: + item = extension_census(counts, bridges) + orbit_trials += item["trials"] + orbit_hits += item["hits"] + orbit_twelves += item["with_twelve"] + orbit_frozen += item["frozen_ok"] + if item["trials"] != representative["trials"] or item["hits"] != 4: + fail(f"orbit member census changed at {counts}") + if item["sums"] != EXPECTED_SUMS or item["frozen_ok"] != item["trials"]: + fail(f"orbit member types changed at {counts}") + if (orbit_trials, orbit_hits, orbit_twelves, orbit_frozen) != (61560, 360, 61560, 61560): + fail( + "orbit census changed: " + f"trials={orbit_trials} hits={orbit_hits} " + f"twelves={orbit_twelves} frozen={orbit_frozen}" + ) + controls += 1 + + if tuple(sorted(ZERO_PREFIX)) in {SORTED_Q14, SORTED_Q14_A} or sum(ZERO_PREFIX) != LENGTH: + fail("zero-hit control is not a distinct length-14 vector") + zero = extension_census(ZERO_PREFIX, bridges) + zero_product = extension_census(ZERO_PREFIX, product_bridges) + if (zero["trials"], zero["hits"]) != (3208, 0): + fail(f"zero-hit control changed: trials={zero['trials']} hits={zero['hits']}") + if (zero_product["trials"], zero_product["hits"]) != (3208, 0): + fail("product enumerator disagrees on the zero-hit control") + controls += 1 + + if tuple(sorted(T1_PREFIX)) in {SORTED_Q14, SORTED_Q14_A} or sum(T1_PREFIX) != LENGTH: + fail("T1 control is not a distinct length-14 vector") + q18_t1 = add(T1_PREFIX, T1_EPSILON) + summed_t1 = separation_sum(q18_t1, T1_DELTA) + if q18_t1 != (3, 3, 3, 3, 3, 3) or summed_t1 != (7, 7, 7, 6, 6, 6) or not weight3(summed_t1): + fail(f"explicit T1 bridge changed: q18={q18_t1} sum={summed_t1}") + if 12 in summed_t1: + fail("explicit T1 bridge contains a 12") + t1 = extension_census(T1_PREFIX, bridges) + t1_product = extension_census(T1_PREFIX, product_bridges) + if (t1["trials"], t1["hits"], t1["with_twelve"]) != (6220, 20, 488): + fail( + "T1 control changed: " + f"trials={t1['trials']} hits={t1['hits']} twelves={t1['with_twelve']}" + ) + t1_hit_twelves = sum(count for key, count in t1["sums"].items() if 12 in key) + if t1["sums"] != {(6, 6, 6, 7, 7, 7): 20} or t1_hit_twelves != 0: + fail(f"T1 hit types changed: {t1['sums']}") + if (t1_product["trials"], t1_product["hits"], t1_product["sums"]) != ( + t1["trials"], + t1["hits"], + t1["sums"], + ): + fail("product enumerator disagrees on the T1 control") + controls += 1 + + if len(WITNESS) != 36 or len(SEPARATION3_WORD) != 36 or len(PAIR09_WORD) != 36: + fail("witness word length changed") + for word in (WITNESS, SEPARATION3_WORD, PAIR09_WORD): + if prefix_counts(word, 36) != (CAP,) * K: + fail(f"witness is not a six-source floor word: {word}") + controls += 1 + q1 = prefix_counts(WITNESS, 1) + q4 = prefix_counts(WITNESS, 4) + q9 = prefix_counts(WITNESS, 9) + q14 = prefix_counts(WITNESS, 14) + q18 = prefix_counts(WITNESS, 18) + q21 = prefix_counts(WITNESS, 21) + q35 = prefix_counts(WITNESS, 35) + witness_sum = separation_sum(q18, tuple(q21[j] - q18[j] for j in range(K))) + shape_sum = add(q1, q14) + endpoint = add(q4, q35) + if q14 != Q14 or shape_sum != SHAPE or not weight3(shape_sum): + fail(f"witness shape changed: q14={q14} sum={shape_sum}") + if q9 != (6, 1, 1, 1, 0, 0) or not weight3(q9): + fail(f"witness (0, 9) mask changed: {q9}") + if witness_sum != (12, 12, 7, 7, 1, 0) or not weight3(witness_sum): + fail(f"witness separation sum changed: {witness_sum}") + if endpoint != (10, 6, 6, 6, 6, 5) or weight3(endpoint): + fail(f"witness S(4) changed: {endpoint}") + if add(q9, (0, 5, 0, 0, 0, 0)) != q14: + fail("witness does not realize the recorded five-letter alignment") + controls += 1 + + q14_sep = prefix_counts(SEPARATION3_WORD, 14) + q18_sep = prefix_counts(SEPARATION3_WORD, 18) + q21_sep = prefix_counts(SEPARATION3_WORD, 21) + sep_sum = tuple(q18_sep[j] + q21_sep[j] for j in range(K)) + if q14_sep == Q14 or not weight3(sep_sum) or sep_sum != (1, 1, 1, 12, 12, 12): + fail(f"separation-3 witness changed: q14={q14_sep} sum={sep_sum}") + controls += 1 + q9_off = prefix_counts(PAIR09_WORD, 9) + q18_off = prefix_counts(PAIR09_WORD, 18) + q21_off = prefix_counts(PAIR09_WORD, 21) + off_sum = tuple(q18_off[j] + q21_off[j] for j in range(K)) + if q9_off != (1, 1, 1, 6, 0, 0) or weight3(off_sum): + fail(f"(0, 9) witness changed: q9={q9_off} separation={off_sum}") + controls += 1 + + if 4 + CAP >= 12: + fail("the s=4 coordinate bound no longer excludes 12") + controls += 1 + + if controls != 19: + fail(f"control count changed: {controls}") + + print( + "PASS_SIX_SOURCE_C6_SUM15_PAIR114 " + f"vectors={vectors} pairs={legal_pairs} " + f"weight3_shape_b={len(shape_b)} weight3_shape_a={len(shape_a)} " + f"shape={SORTED_SHAPE} q14={SORTED_Q14} " + f"families=6 family_hits={len(reached)} " + f"shape_trials={orbit_trials} shape_extensions={orbit_hits} " + f"shape_extension_twelves={orbit_hits} " + f"all_extension_sums_with_twelve={orbit_twelves} " + f"live_zero_hits={zero['hits']} live_t1_hits={t1['hits']} " + f"live_t1_twelves={t1_hit_twelves} controls={controls}" + ) + + +if __name__ == "__main__": + main()