diff --git a/research/p104-receiver-relay/PROOF.md b/research/p104-receiver-relay/PROOF.md new file mode 100644 index 0000000000..23f02a20bc --- /dev/null +++ b/research/p104-receiver-relay/PROOF.md @@ -0,0 +1,45 @@ +# Ten minimal-grade cooperative repairs + +## Frozen communication model + +Use the 1,289-coordinate rational word from #7786. Delete paid slots 95914 and 88, the original route from chart 278 to chart 288 to chart 127. Keep every other paid rule, its schedule, the 1,103 chart assignments, the initial atoms and the exterior terminal operators fixed. Slot 95914 has only one reader, slot 88. The only readers of 88 are terminals 155442 and 155490 at 127. Thus every surviving paid deposit is the same function of the public input as before. Receiver 127 has no public atom or paid egress and retains 901 arrivals. We grant arbitrary local arithmetic and require exact terminal outputs. The only permitted senders and intermediate nodes are original chart labels. The inputs, coefficients, destinations and values of surviving paid rows stay fixed; new information can leave a chart only over a replacement message or the granted equal-span sharing. The paid comparison freezes the productive ledger and charges only the replacement communication. [Incumbent word](https://github.com/CrocSwap/integer-mult-bounds/tree/89a67c404226d51028e135de2b9169e9020d57af/research/p104-iterated-returns/continuation) · [Predecessor cut](https://github.com/CrocSwap/integer-mult-bounds/blob/864d15105ceb2f7a5cdbc6bedc72a9bc273d5e8e/research/p104-receiver-single-send/PROOF.md) + +A chart's frame spans a binary subspace of the nine-dimensional ambient space. Each new paid send joins nested spans in either direction and has integer grade equal to the absolute difference of their dimensions. We even allow unrestricted sharing between labels with the same span. A fixed chronological protocol may add any finite number of sends, with arbitrary deterministic payloads depending on local stock and earlier arrivals. The lower bound gives each chart every surviving deposit it ever receives in the frozen word; the improved access can only help the protocol. Local choices cannot signal to other charts without communication. The constructive programs use only chronological rational-linear forms. [Predecessor chart-comparability and pricing check](https://github.com/CrocSwap/integer-mult-bounds/blob/0893abefcc894991b67b2315f7e85e0dc4d58c5e/research/p104-paid88-stock-cones/cones/portable.py) + +## Information must travel seven grades + +For a public input, call a chart live when its frozen local stock differs from its stock at zero. Quotient all equal-span labels into free communication classes. There is only one nonsingleton class, labels 1091 and 1092, and neither label is live on any of the four tests. The original terminal 155442 is one on every test and zero at the origin. Here are the only nonzero public coordinates of each test. + +| Test | Input | Live charts | Use | +|---|---|---:|---| +| A | $x_{674}=x_{722}=1$ | 3 | Exactly 11, 58 and 278, of ranks 1, 1 and 2 | +| B | $x_{722}=1, x_{780}=-1$ | 293 | Chart 11 is silent | +| C | $x_{674}=1, x_{825}=-1$ | 295 | Chart 58 is silent | +| D | $x_{674}=x_{722}=1, x_{1288}=-1/845660160$ | 26 | Only 288 is live between the spans of 278 and 127, inclusive | + +The underlying test inputs appeared in #7807; test D originates in #7795. We recompute their observations on the immutable word and independently intersect the live set with the span interval. All 901 receiver deposits vanish on each test. [Four-column and interval check](check_paths.py) · [Origin of D](https://github.com/CrocSwap/integer-mult-bounds/blob/0893abefcc894991b67b2315f7e85e0dc4d58c5e/research/p104-paid88-stock-cones/STOCK.md) + +On each test there must be a chronological path from some live class to 127. Otherwise, induction over the transmissions shows that every datum reaching the receiver agrees with its value on zero. Even one paid send is impossible: its sending class must be live on all four tests, and their intersection is empty. Let $G$ be the sum of the grades of all new sends. The path forced by A starts at rank at most two and ends at rank nine. The triangle inequality for the rank differences gives $G\ge7$. + +If $G=7$, its source must be chart 278. Every positive send belongs to this path, every rank step increases and every participating span lies in the closed interval from 278 to 127. In particular, other incoming branches, duplications and reverse sends each force a larger total grade. On D the path must pick up information in the same interval. The computed intersection forces chart 288. Below 288 the only possible strict intermediate chart above 278 is 561, of rank three. Above 288 and below 127 the only possibilities are 239, 267, 477 and 1100, all of rank eight, with distinct spans. Thus a minimal-grade path uses 561 optionally before 288 and at most one of the four upper charts afterwards. There are exactly ten paths. + +For a receiver that directs successive sends using only its own transcript, the same lower bound applies to the zero-input branch and hence to the worst case. Until the receiver first distinguishes a test, it makes the same requests and broadcasts the same transcript as on zero. A differing arrival must therefore have a chronological paid path from a live class in this common prefix. Apply that observation to each test on the zero-input branch. The ten-path classification refers to a fixed successful topology or to such a branch when its total grade equals seven. + +## Realizing every path + +Take either original send $a\to b$. To insert chart $m$, transmit the exact original payload from $a$ to $m$ immediately before its old slot, and forward that one scalar from $m$ to $b$ at the old slot. The strict containments above give legal nested routes. Every original rule sees its original inputs at its original position. The substitutions on the two original legs can be chosen independently. Each path therefore determines a chronological word with the full original operator. The replay builds all ten words, checks source ownership and chronology at every instruction, contracts inserted copies and compares every original rule, then independently expands the two affected terminal rows in the 1,289 coordinates. A sign error on the lower subdivision changes the protected output. [Constructive operator check](check_operators.py) + +## Target price and separation + +Write $p(d)=d^{1-\kappa}$ with the enrolled $\kappa=0.00387981257853$. Any nonnegative increasing concave tariff with $p(0)=0$ orders the four grade-seven classes weakly in the table's order. The two optional subdivisions add $2p(1)-p(2)$ and $p(4)+p(1)-p(5)$ respectively. Concavity makes the former nonnegative and at most the latter. At the enrolled exponent both inequalities are strict. Across 48 rational calls, each printed decimal below is a strict lower endpoint with enclosure width $10^{-24}$, except for the exact zero. + +| Grade sequence | Distinct routes | Additional paid cost against incumbent | +|---|---:|---:| +| 2, 5 | 1 | 0 | +| 1, 1, 5 | 1 | 0.257824154185337662623932 | +| 2, 4, 1 | 4 | 0.464055177013712144726725 | +| 1, 1, 4, 1 | 4 | 0.721879331199049807350658 | + +All other successful positive-send topologies have $G\ge8$ and at least two positive grades. Their cost is at least $p(7)+p(1)$. If a grade is already seven or larger, a second positive grade proves this. Otherwise trim the integer grades to a sum of eight, then transfer units from smaller to larger entries until they reach seven and one. Increasingness allows trimming and concavity makes each concentration nonincreasing in cost. At the target, $48[p(7)+p(1)-p(2)-p(5)]$ lies in $47.224621260611063462113308+(0,10^{-24})$. We use this as a lower bound on the outside class, without claiming attainment. It strictly separates every other topology from all ten. [Rational tariff enclosure](check_prices.py) · [Enrolled target](https://github.com/CrocSwap/integer-mult-bounds/blob/0893abefcc894991b67b2315f7e85e0dc4d58c5e/research/p104-paid88-stock-cones/cones/SOURCE.json) + +More generally the same strict separation holds whenever $p(7)+p(1)>p(4)+3p(1)$. At the enrolled tariff the incumbent is the unique optimal positive topology after free sharing is contracted. The four-return invoice needs a positive saving even before any local costs of a recoding are charged. This complete frozen-cut comparison yields zero best saving and leaves repairs that alter the surviving paid operators, frames or productive terms open. diff --git a/research/p104-receiver-relay/README.md b/research/p104-receiver-relay/README.md new file mode 100644 index 0000000000..7b7de090d7 --- /dev/null +++ b/research/p104-receiver-relay/README.md @@ -0,0 +1,31 @@ +# All minimum-grade cooperative repairs of P104 receiver 127 + +On the rational word of #7786, delete transfers 95914 and 88 and let the 1,103 original charts exchange any finite number of new nested-span messages to restore receiver 127. Keep the surviving paid rules, chart assignments and exterior terminals fixed. **Every successful repair spends at least seven total grades. Exactly ten positive-transfer topologies attain seven, and the incumbent is the unique cheapest at the enrolled target.** The result allows arbitrary deterministic local encodings. All ten attaining paths also work as exact chronological rational-linear programs. [Proof, scope and tariff table](PROOF.md) + +Every seven-grade path must run from 278 through 288 to 127. It may pass through 561 before 288 and through one of 239, 267, 477 or 1100 after 288. The unique runner-up, through 561 alone, adds **0.257824154185337662623932…** signed units across the 48 rational calls. Even the most expensive of the ten adds less than 0.722. Every other positive-transfer topology adds more than **47.224621260611063462113308** units. The best saving from rerouting this frozen cut is exactly zero. The selected multiplication bound is unchanged. [Exact price verification](check_prices.py) + +The direct-send optimization in #7807 allowed communication only into the receiver. Here relay charts may pool old stock, exchange new messages and forward the result. The proof contracts equal-span labels, traces a necessary information path, identifies a second independently necessary waypoint, and exhausts its two intervals in the actual atlas. Equality constructions preserve the complete 1,289-coordinate operator. [Earlier direct-only result](https://github.com/CrocSwap/integer-mult-bounds/pull/7807) · [Coordination thread](https://github.com/CrocSwap/integer-mult-bounds/discussions/7111#discussioncomment-19755743) · [Source pins](SOURCE-PINS.json) + +## Reproduce + +From the repository root, run the registered package with standard-library CPython 3.12. + +~~~sh +python3.12 -B scripts/research_package.py --package research/p104-receiver-relay +~~~ + +The three standalone checks below also work from a read-only export without Git or network access. + +~~~sh +python3.12 -IB check_paths.py +python3.12 -IB check_operators.py +python3.12 -IB check_prices.py +~~~ + +## Open next questions + +Can an edit to an existing ingress at chart 278 or 288 eliminate the mandatory waypoint? A concrete first test is to identify a surviving ingress whose recoded payload is nonzero on witness D at chart 278 while preserving the 901 old receiver deposits and all exterior terminals. Such a modification changes the frozen-stock hypothesis. Its altered bill, propagation to later readers, restoration costs and productive credits would all need to be checked against the signed target. [Earlier six-pair constraints](https://github.com/CrocSwap/integer-mult-bounds/pull/7795) + +## Credit + +Clear1nsight supplied the four-return word in #7786 and the first three-coordinate separating input in #7795, building on the signed P104 framework from Ali Romman and predecessors credited in the original notices. The other inputs, source reader and frozen direct-cut calculation come from apoursh's #7807. The cooperative path classification, constructive subdivisions and signed separation were prepared by apoursh with substantial OpenAI Codex assistance under Apache-2.0. [Retained original notice](retained/PR7786-NOTICE) · [Predecessor notice](retained/PR7795-NOTICE) · [License](retained/LICENSE) diff --git a/research/p104-receiver-relay/SOURCE-PINS.json b/research/p104-receiver-relay/SOURCE-PINS.json new file mode 100644 index 0000000000..5a66e4f51c --- /dev/null +++ b/research/p104-receiver-relay/SOURCE-PINS.json @@ -0,0 +1,58 @@ +{ + "artifacts": [ + { + "local": "retained/WORD.json.gz", + "source": 7786, + "head": "89a67c404226d51028e135de2b9169e9020d57af", + "original_path": "research/p104-iterated-returns/continuation/WORD.json.gz", + "bytes": 614180, + "git_blob": "337a9d4f8b36f3bd4acc5651810e4e846e287435", + "sha256": "fde0f7eaa3749d0934a9fc0d6320074f021cd722ed6753f3a59a62fb5b221949", + "uncompressed_sha256": "c447b6d5ba956fbe40834fe3c1bc69af2f225736f1b97ecd84b57bab9dd283cb" + }, + { + "local": "retained/PR7795-NOTICE", + "source": 7795, + "head": "0893abefcc894991b67b2315f7e85e0dc4d58c5e", + "original_path": "research/p104-paid88-stock-cones/NOTICE", + "bytes": 1432, + "git_blob": "6cbfdc843fd7cd3227c7bd7925c891499d93098d", + "sha256": "8df09db925c14a4ec17e578455dd68b72714e15990cee40936212ce7408132cc" + }, + { + "local": "word.py", + "source": 7807, + "head": "864d15105ceb2f7a5cdbc6bedc72a9bc273d5e8e", + "original_path": "research/p104-receiver-single-send/word.py", + "bytes": 1769, + "git_blob": "c42aa2db122c612f08e7f559ff02cc5b6d4f0844", + "sha256": "6d0af9a2699a34d6df36b20cd24d441b1c6cc0645483bbc0affec8aacc6b0e28" + }, + { + "local": "retained/PR7786-NOTICE", + "source": 7807, + "head": "864d15105ceb2f7a5cdbc6bedc72a9bc273d5e8e", + "original_path": "research/p104-receiver-single-send/retained/PR7786-NOTICE", + "bytes": 1048, + "git_blob": "3b083891bf59f449b49df024ab7df3feaf6054b8", + "sha256": "4f7d16a4dcaae02de7e7583f7fbb14d5edd19dc4c10b4f47571c145204505844" + }, + { + "local": "retained/LICENSE", + "source": 7807, + "head": "864d15105ceb2f7a5cdbc6bedc72a9bc273d5e8e", + "original_path": "research/p104-receiver-single-send/retained/LICENSE", + "bytes": 11357, + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + } + ], + "tariff": { + "pr": 7795, + "head": "0893abefcc894991b67b2315f7e85e0dc4d58c5e", + "path": "research/p104-paid88-stock-cones/cones/SOURCE.json", + "git_blob": "c0da8ca07dc256f47a980e5ad1a969f7616ab08a", + "sha256": "f5087c4d8aa394049eb0ab08adace0d295009306900f29e9db1a07706a10fba2", + "use": "Tariff and incumbent price context. The replay computes its own rational intervals." + } +} diff --git a/research/p104-receiver-relay/SOURCES.json b/research/p104-receiver-relay/SOURCES.json new file mode 100644 index 0000000000..1623dbbdb1 --- /dev/null +++ b/research/p104-receiver-relay/SOURCES.json @@ -0,0 +1,41 @@ +{ + "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" + } + ], + "cited_research": [ + { + "pr": 7786, + "head": "89a67c404226d51028e135de2b9169e9020d57af", + "author": "Clear1nsight", + "title": "Conditional κ ≥ 0.00387944011068 from four additional rational returns", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/7786" + }, + { + "pr": 7795, + "head": "0893abefcc894991b67b2315f7e85e0dc4d58c5e", + "author": "Clear1nsight", + "title": "Bound six paid-slot repairs and 73 linked chart cones on #7786", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/7795" + }, + { + "pr": 7807, + "head": "864d15105ceb2f7a5cdbc6bedc72a9bc273d5e8e", + "author": "apoursh", + "title": "Prove the exact all-chart direct replacement cost of P104 paid slot 88", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/7807" + } + ] +} diff --git a/research/p104-receiver-relay/TASK.json b/research/p104-receiver-relay/TASK.json new file mode 100644 index 0000000000..4880903bfc --- /dev/null +++ b/research/p104-receiver-relay/TASK.json @@ -0,0 +1,127 @@ +{ + "schema_version": 1, + "task_id": "p104-side-correction", + "original_card": { + "id": "p104-side-correction", + "question": "Can joint helper bases and a legal causal split improve the complete P104 productive/paid invoice?", + "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", + "research/p104-helper-subspace-splits/README.md", + "research/dyadic-helper-channel-capacity/README.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": "An exact arbitrary-input identity, source/target frame availability and restoration at the chosen cut, plus the complete channel+correction+idle/hosting bill or an explicit favorable bound. The native channel alone is not a supplier. 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", + "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": "Start with the selected #5599 emitted word and review pending #5718 distinct input/output bases plus #5717/#5719 coverage before claiming work. Pick one uncovered source word, helper group and cut region. Prove the arbitrary-input relation and legal entry/exit corrections, then compare full target and paid profiles. Reject if completion, owned lifetimes or consumer costs repay the gain. A static pairing rank alone is not a physical split.", + "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": [ + "P104", + "helper basis", + "helper split", + "5718", + "dyadic capacity" + ], + "existing_checks": [ + { + "scope": "PR #4133: literal-slot defect", + "evidence": "research/p104-literal-slot-defect/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "88666f1dee93fbd85b31fd5d6f91a219e111b5f4", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4136: uniform commutation gap", + "evidence": "research/p104-uniform-commutation-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "281ce601a8be9db470de630759179c23e1dfaa88", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4140: uniform encoding gap", + "evidence": "research/p104-uniform-encoding-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "de25c6525aa866962309df5d107b32d55e6e5628", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4153: source-chart shortcut exhausts its optimistic allowance", + "evidence": "research/p104-source-chart-shortcut/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "9123241fea53df77e51ffe30d9aca1625d4bf3a8", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4154: fiber-tag seam mismatch", + "evidence": "research/p104-fiber-tag-seam/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "4ffcdaee5d6255a9cea1fe53a5424435068089d0", + "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" + } + ] + }, + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "selection_nonce": "b7f4df3b24795138f0bd9a3c8ba6c7bf", + "scope_key": "de10dd0ec51d85515c05", + "scope_status": "refined", + "actual_scope": "Determine the optimal paid communication topology for restoring the #7807 receiver-127 cut when arbitrary cooperative transfers among original charts are allowed.", + "scope_change_reason": "The direct-only optimum in #7807 left the handoff about cooperative routing unresolved. This studies the same frozen rules and target, including free equal-span sharing.", + "bottleneck_link": "Tests whether full cooperative rerouting of the two deleted paid slots can reduce the incumbent invoice while preserving the other paid observations.", + "stop_rule": "Prove a lower bound for every finite cooperative repair, characterize the attaining topologies and replay every minimum-grade realization in chronological order.", + "outcome": "completed", + "evidence": "The package README, proof and registered verification commands describe the exact scope and controls.", + "author": "apoursh", + "ai_assistance": "Substantial OpenAI Codex assistance with mathematical derivation, verification and review.", + "open_questions": [ + { + "question": "Can a modified surviving paid ingress yield a cheaper replacement for the chart-127 cut?", + "why_it_matters": "The frozen communication optimum gives exactly zero saving against the incumbent.", + "first_step": "Select an existing ingress and enumerate its downstream readers before changing its operator.", + "blocked_by": "Every altered stock needs a legal chronological reconstruction and a complete signed invoice." + } + ], + "claim": "https://github.com/CrocSwap/integer-mult-bounds/discussions/7111#discussioncomment-19755743", + "overlap": "Read #1163, recent #1166 handoffs, active #7111 work and recent PRs; checked relevant all-state PR searches. The local overlap cache and sparse inventory have limited coverage. Checked #7804 and the #7786 continuations for a distinct boundary.", + "upstream_refresh": { + "date_utc": "2026-11-19", + "canonical_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "selected_orientation": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "selected": "The selected result is #7000. The revision-8 catalogue refers to the earlier #5599.", + "before_submission": "Fetched canonical main again and checked the current work against the live PR queue." + } +} diff --git a/research/p104-receiver-relay/VERIFY.json b/research/p104-receiver-relay/VERIFY.json new file mode 100644 index 0000000000..f7b7b77ba9 --- /dev/null +++ b/research/p104-receiver-relay/VERIFY.json @@ -0,0 +1,90 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-E", + "-s", + "-W", + "error", + "-B", + "{package}/check_paths.py" + ], + "timeout_seconds": 180, + "checks": "Four public-input separators, original atlas, complete positive minimal-grade path census" + }, + { + "argv": [ + "{python}", + "-E", + "-s", + "-O", + "-W", + "error", + "-B", + "{package}/check_paths.py" + ], + "timeout_seconds": 180, + "checks": "Four public-input separators, original atlas, complete positive minimal-grade path census under optimized Python" + }, + { + "argv": [ + "{python}", + "-E", + "-s", + "-W", + "error", + "-B", + "{package}/check_operators.py" + ], + "timeout_seconds": 180, + "checks": "Chronology, operator equality of all ten concrete routings and detection of a sign error" + }, + { + "argv": [ + "{python}", + "-E", + "-s", + "-O", + "-W", + "error", + "-B", + "{package}/check_operators.py" + ], + "timeout_seconds": 180, + "checks": "Chronology, operator equality of all ten concrete routings and detection of a sign error under optimized Python" + }, + { + "argv": [ + "{python}", + "-E", + "-s", + "-W", + "error", + "-B", + "{package}/check_prices.py" + ], + "timeout_seconds": 180, + "checks": "Directed rational enclosures of all grade-seven surcharges and the outside-tariff lower bound" + }, + { + "argv": [ + "{python}", + "-E", + "-s", + "-O", + "-W", + "error", + "-B", + "{package}/check_prices.py" + ], + "timeout_seconds": 180, + "checks": "Directed rational enclosures of all grade-seven surcharges and the outside-tariff lower bound under optimized Python" + } + ] +} diff --git a/research/p104-receiver-relay/check_operators.py b/research/p104-receiver-relay/check_operators.py new file mode 100644 index 0000000000..63fa655998 --- /dev/null +++ b/research/p104-receiver-relay/check_operators.py @@ -0,0 +1,83 @@ +"""Lift the native incumbent to each of the ten paths and compare terminal operators.""" +from collections import Counter +from pathlib import Path +import sys + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from word import check_causality, read_word, require + +IN, OUT = 95914, 88 + + +def subdivide(word, forms, routes, first_mid, last_mid): + new_forms, new_routes = forms.copy(), routes.copy() + insertions = {} + for old, mid in ((IN, first_mid), (OUT, last_mid)): + if mid is None: + continue + # Use an unoccupied paid identifier below the terminal range. + new = next(i for i in range(word['first_output']) if i not in new_forms) + source, dest = routes[old] + new_forms[new] = forms[old] + new_forms[old] = {new: 1} + new_routes[new], new_routes[old] = (source, mid), (mid, dest) + insertions[old] = new + schedule = [] + for key in word['schedule']: + if key in insertions: + schedule.append(insertions[key]) + schedule.append(key) + return schedule, new_forms, new_routes, insertions + + +def pullback(schedule, forms, key): + row = {key: 1} + for k in reversed(schedule): + a = row.pop(k, 0) + if a: + for t, q in forms[k].items(): + total = row.get(t, 0) + a*q + if total: + row[t] = total + else: + row.pop(t, None) + require(all(t < 0 for t in row), 'all terminal coefficients are public') + return row + + +def main(): + word, forms, routes, terminals = read_word() + y = {k: pullback(word['schedule'], forms, k) for k in (155442, 155490)} + require(y[155442] == {~674: 1, ~780: -1}, 'literal protected difference') + grades = Counter() + for first in (None, 561): + for last in (None, 239, 267, 477, 1100): + order, modified, wires, ins = subdivide(word, forms, routes, first, last) + check_causality(word | {'schedule': order}, modified, wires, terminals) + legs = [a for old in (IN, OUT) for a in ([ins[old], old] if old in ins else [old])] + ds = tuple(len(word['frames'][wires[k][1]]) - len(word['frames'][wires[k][0]]) + for k in legs) + require(all(d > 0 for d in ds) and sum(ds) == 7, 'seven increasing grades') + grades[ds] += 1 + # Eliminate each new degree-two copy and compare every original row, + # its destination and source, and the original chronological sequence. + require([k for k in order if k in forms] == word['schedule'], 'source timing') + for old, new in ins.items(): + require(modified[old] == {new: 1} and modified[new] == forms[old] + and wires[new][1] == wires[old][0] + and (wires[new][0], wires[old][1]) == routes[old], 'contracted leg') + require(all(modified[k] == forms[k] and wires.get(k) == routes.get(k) + for k in forms if k not in ins), 'all other local operators') + require(all(pullback(order, modified, k) == row for k, row in y.items()), + 'exact expansion of both receiver terminals') + if first and not last: + broken = modified | {IN: {ins[IN]: -1}} + require(pullback(order, broken, 155442) != y[155442], 'sign-flip control') + require(grades == {(2, 5): 1, (1, 1, 5): 1, (2, 4, 1): 4, (1, 1, 4, 1): 4}, + 'exact histogram by paid grade sequence') + print('PASS: ten chronological paid words, 1,289 terminal operators each,') + print('one wrong-sign rejection, verified path counts:', dict(grades)) + + +if __name__ == '__main__': + main() diff --git a/research/p104-receiver-relay/check_paths.py b/research/p104-receiver-relay/check_paths.py new file mode 100644 index 0000000000..bbc53f3aea --- /dev/null +++ b/research/p104-receiver-relay/check_paths.py @@ -0,0 +1,94 @@ +"""Reconstruct the observable stock, span quotient and complete grade-seven path set.""" +from collections import defaultdict +from fractions import Fraction +from pathlib import Path +import sys + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from word import check_causality, read_word, require + +DONOR, RELAY, RECEIVER = 278, 288, 127 +OLD_IN, OLD_OUT = 95914, 88 +TERMINALS = {155442, 155490} + +# Four rational separators from #7807, in A,B,C,D order. +COLUMNS = ( + {674: 1, 722: 1}, + {722: 1, 780: -1}, + {674: 1, 825: -1}, + {674: 1, 722: 1, 1288: -Fraction(1, 845660160)}, +) + + +def span(frame): + points = {0} + for v in frame: + require(0 < v < 512 and v not in points, 'dependent or out-of-range frame') + points |= {x ^ v for x in points} + return frozenset(points) + + +def live_stocks(word, forms, routes, public): + atoms = {~j: public.get(j, 0) for j in range(len(word['initial']))} + live = {word['initial'][j] for j in public} + for k in word['schedule']: + if k not in routes and k not in TERMINALS: + continue + atoms[k] = sum(a * atoms[s] for s, a in forms[k].items()) + if k in routes and k not in {OLD_IN, OLD_OUT} and atoms[k]: + live.add(routes[k][1]) + require(atoms[155442] == 1, 'the protected output distinguishes zero') + require(RECEIVER not in live, 'unmodified receiver deposits vanish') + return live + + +def classify(word, forms, routes, terminals): + check_causality(word, forms, routes, terminals) + require(routes[OLD_IN] == (DONOR, RELAY) and routes[OLD_OUT] == (RELAY, RECEIVER), + 'removed path') + dependants = {s: {k for k, row in forms.items() if s in row} for s in (OLD_IN, OLD_OUT)} + require(dependants == {OLD_IN: {OLD_OUT}, OLD_OUT: TERMINALS}, 'frozen stock closure') + require(RECEIVER not in word['initial'] and all(a != RECEIVER for a, b in routes.values()), + 'receiver has no initial stock or outgoing leg') + require(sum(b == RECEIVER for a, b in routes.values()) - 1 == 901, + 'surviving receiver deposits') + + spaces = list(map(span, word['frames'])) + require(len(spaces) == 1103 and len(spaces[RECEIVER]) == 512, 'original atlas and receiver') + require(all(spaces[a] <= spaces[b] or spaces[b] <= spaces[a] for a, b in routes.values()), + 'every unmodified paid transfer joins nested chart spans') + classes = defaultdict(list) + for chart, space in enumerate(spaces): + classes[space].append(chart) + require([ids for ids in classes.values() if len(ids) > 1] == [[1091, 1092]], + 'unique free communication between distinct chart labels') + hits = [live_stocks(word, forms, routes, v) for v in COLUMNS] + require([len(x) for x in hits] == [3, 293, 295, 26] and hits[0] == {11, 58, DONOR}, + 'all-time four-column census') + require(not any({1091, 1092} & x for x in hits), 'free class silent on every witness') + require(not set.intersection(*hits), 'one paid sender cannot distinguish all tests') + require([len(spaces[j]) for j in (11, 58, DONOR)] == [2, 2, 4], + 'first witness sources have ranks one, one and two') + + between = {j for j, space in enumerate(spaces) if spaces[DONOR] <= space <= spaces[RECEIVER]} + require(between & hits[3] == {RELAY}, 'mandatory waypoint for witness D') + lower = [j for j in between if spaces[DONOR] < spaces[j] < spaces[RELAY]] + upper = sorted(j for j in between if spaces[RELAY] < spaces[j] < spaces[RECEIVER]) + require(lower == [561] and upper == [239, 267, 477, 1100], 'strict interval census') + require(len(spaces[561]) == 8 and len(spaces[RELAY]) == 16 + and all(len(spaces[j]) == 256 for j in upper), 'intermediate ranks') + paths = [] + for first in ((), tuple(lower)): + for chart in [None, *upper]: + last = () if chart is None else (chart,) + paths.append((DONOR, *first, RELAY, *last, RECEIVER)) + return paths + + +if __name__ == '__main__': + paths = classify(*read_word()) + require(len(paths) == len(set(paths)) == 10, 'complete positive route family') + print('PASS: 1,103 labels, 1,102 span classes, 901 receiver deposits, four exact probes.') + print('Necessary grade-seven paths:') + for path in paths: + print(' -> '.join(map(str, path))) diff --git a/research/p104-receiver-relay/check_prices.py b/research/p104-receiver-relay/check_prices.py new file mode 100644 index 0000000000..ce23d72d93 --- /dev/null +++ b/research/p104-receiver-relay/check_prices.py @@ -0,0 +1,62 @@ +"""Exact rational bounds for the three surcharges and the off-path lower floor.""" +from fractions import Fraction as F +from pathlib import Path +import sys + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from word import require + + +def logarithm(x): + # Sum 2 atanh((x-1)/(x+1)) on [1,2], with a geometric upper tail. + require(1 <= x <= 2, 'logarithm reduction') + z = (x - 1) / (x + 1) + z2 = z*z + term = z + total = F(0) + for n in range(45): + total += 2*term / (2*n + 1) + term *= z2 + return total, total + 2*term / (91*(1-z2)) + + +def exp_bounds(x): + require(0 <= x <= F(1, 50), 'alternating exponential range') + total = term = F(1) + for j in range(1, 14): + term *= -x/j + total += term + return total, total - term*x/14 + + +def price(d): + k = d.bit_length() - 1 + base = logarithm(F(2)) + rem = logarithm(F(d, 1 << k)) + kappa = F('0.00387981257853') + left, right = (kappa * (k*base[i] + rem[i]) for i in (0, 1)) + return d*exp_bounds(right)[0], d*exp_bounds(left)[1] + + +def main(): + tariff = {d: price(d) for d in (1, 2, 4, 5, 7)} + # Coefficients of the change relative to grades 2,5. In the last row + # the comparison price is p(1)+p(7), a certified lower bound. + cases = [ + ('split lower', {1: 2, 2: -1}, '0.257824154185337662623932'), + ('split upper', {1: 1, 4: 1, 5: -1}, '0.464055177013712144726725'), + ('split both', {1: 3, 2: -1, 4: 1, 5: -1}, '0.721879331199049807350658'), + ('outside floor', {1: 1, 7: 1, 2: -1, 5: -1}, '47.224621260611063462113308'), + ] + previous = F(0) + for name, coeffs, expected in cases: + low = 48*sum(n*tariff[d][n < 0] for d, n in coeffs.items()) + high = 48*sum(n*tariff[d][n > 0] for d, n in coeffs.items()) + require(previous < low and F(expected) < low <= high < F(expected) + F(1, 10**24), + name + ' price enclosure') + previous = high + print('PASS:', name, '48-call change in', expected, '+ (0, 1e-24)') + + +if __name__ == '__main__': + main() diff --git a/research/p104-receiver-relay/retained/LICENSE b/research/p104-receiver-relay/retained/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/p104-receiver-relay/retained/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/p104-receiver-relay/retained/PR7786-NOTICE b/research/p104-receiver-relay/retained/PR7786-NOTICE new file mode 100644 index 0000000000..3b083891bf --- /dev/null +++ b/research/p104-receiver-relay/retained/PR7786-NOTICE @@ -0,0 +1,16 @@ +Iterated returns on the P104 ordinary suppliers + +Clear1nsight prepared the successor construction, explicit witnesses and verification +with substantial OpenAI Codex assistance, including independent computational checks. +The new material is offered under Apache-2.0. + +The exact starting words and the rational and binary replay interfaces are from +Clear1nsight's PR #7781. The paid and productive scalar operations, the 48-call +complex schedule, the punctured binary supplier and the common outer application +come from Ali Romman's PR #7776. The two paid projections build on the local +quotient and terminal repair in #7774 and #7781. The binary paired caller and +finite compiler use work by DreamingOfClouds, Jerry Chen (CubeJerry), zxv and the +contributors cited in their retained sources. SYLforge, Rohan Arun, Cinna Davis, +Douglas Colkitt and other predecessors contributed the caller, physical and +analytic framework. The source-fetch helper is adapted from #7774. The immutable +source manifest identifies the public inputs and their notices. diff --git a/research/p104-receiver-relay/retained/PR7795-NOTICE b/research/p104-receiver-relay/retained/PR7795-NOTICE new file mode 100644 index 0000000000..6cbfdc843f --- /dev/null +++ b/research/p104-receiver-relay/retained/PR7795-NOTICE @@ -0,0 +1,23 @@ +Paid slot 88 and linked chart bounds on the P104 four-return word + +Clear1nsight prepared the scoped arguments, source binding and replay package +with substantial OpenAI Codex assistance, including separate computational +checks of causal stock and directed price. New material is Apache-2.0. + +The source material from PR #7786 and the #7781 predecessor is credited to +Clear1nsight. Ali Romman's #7776 supplies the paid and productive scalar +operation model, the 48-call complex schedule, the punctured binary supplier +and the common outer application. The inherited reconstruction used the +restored-chain and local quotient work in #7774 and #7781. The chart-237 +operator and receiving-bank audit in Ali Romman's #7791 is a distinct earlier +source-aware check. Ali Romman's #7793 supplies a nearby one-source broadcast +result on a different information boundary. + +The cone roster, chart extraction, anchor closure and prior 66 integer-price +certificates preserve Clear1nsight's earlier P104 chart experiments. The +directed power enclosure retains the predecessor evaluate_recursive_power.py +implementation under Apache-2.0. DreamingOfClouds, Jerry Chen (CubeJerry), zxv, +SYLforge, Rohan Arun, Cinna Davis, Douglas Colkitt and the credited predecessor +contributors supplied the caller, compiler, physical and analytic framework. +See the source project's NOTICE and the source package's attribution for the +complete inherited lineage. diff --git a/research/p104-receiver-relay/retained/WORD.json.gz b/research/p104-receiver-relay/retained/WORD.json.gz new file mode 100644 index 0000000000..337a9d4f8b Binary files /dev/null and b/research/p104-receiver-relay/retained/WORD.json.gz differ diff --git a/research/p104-receiver-relay/word.py b/research/p104-receiver-relay/word.py new file mode 100644 index 0000000000..c42aa2db12 --- /dev/null +++ b/research/p104-receiver-relay/word.py @@ -0,0 +1,48 @@ +"""Read the source-bound rational P104 word. apoursh with OpenAI Codex, Apache-2.0.""" +from fractions import Fraction +from functools import cache +import gzip +import hashlib +import json +from pathlib import Path + + +def require(test, message): + if not test: + raise ValueError(message) + + +@cache +def scalar(value): + return Fraction(value) + + +def read_word(): + raw = (Path(__file__).parent / 'retained' / 'WORD.json.gz').read_bytes() + require(hashlib.sha256(raw).hexdigest() == + 'fde0f7eaa3749d0934a9fc0d6320074f021cd722ed6753f3a59a62fb5b221949', + 'original archive') + data = gzip.decompress(raw) + require(hashlib.sha256(data).hexdigest() == + 'c447b6d5ba956fbe40834fe3c1bc69af2f225736f1b97ecd84b57bab9dd283cb', + 'literal source word') + word = json.loads(data) + program = {k: {s: scalar(q) for s, q in row} for k, row in word['forms']} + routes = {k: (a, b) for k, a, b in word['moves']} + terminals = {word['first_output'] + j: c for j, c in enumerate(word['final'])} + require(len(word['schedule']) == len(program) == 6998 and + len(routes) == 5709 and len(terminals) == len(word['initial']) == 1289, + 'source dimensions') + require(set(word['schedule']) == set(program) == routes.keys() | terminals.keys(), + 'complete schedule') + return word, program, routes, terminals + + +def check_causality(word, program, routes, terminals): + homes = {~i: chart for i, chart in enumerate(word['initial'])} + for k in word['schedule']: + owner = routes[k][0] if k in routes else terminals[k] + require(all(homes.get(s) == owner for s in program[k]), + f'wrong causal stock at {k}') + if k in routes: + homes[k] = routes[k][1]