From 4e754f953a5823aaa330dca2f74f67fd2a5dfc4b Mon Sep 17 00:00:00 2001 From: Nick Petalas Date: Thu, 29 Oct 2026 22:18:44 +0000 Subject: [PATCH 1/2] feat(research): prove confined two-clique relay paid floor --- research/p104-two-clique-relay-floor/PROOF.md | 174 +++++++++++++++ .../p104-two-clique-relay-floor/README.md | 149 +++++++++++++ .../p104-two-clique-relay-floor/SOURCES.json | 30 +++ .../p104-two-clique-relay-floor/TASK.json | 129 +++++++++++ .../p104-two-clique-relay-floor/VERIFY.json | 34 +++ research/p104-two-clique-relay-floor/model.py | 166 ++++++++++++++ .../p104-two-clique-relay-floor/verify.py | 207 ++++++++++++++++++ 7 files changed, 889 insertions(+) create mode 100644 research/p104-two-clique-relay-floor/PROOF.md create mode 100644 research/p104-two-clique-relay-floor/README.md create mode 100644 research/p104-two-clique-relay-floor/SOURCES.json create mode 100644 research/p104-two-clique-relay-floor/TASK.json create mode 100644 research/p104-two-clique-relay-floor/VERIFY.json create mode 100644 research/p104-two-clique-relay-floor/model.py create mode 100644 research/p104-two-clique-relay-floor/verify.py diff --git a/research/p104-two-clique-relay-floor/PROOF.md b/research/p104-two-clique-relay-floor/PROOF.md new file mode 100644 index 0000000000..2905c9173c --- /dev/null +++ b/research/p104-two-clique-relay-floor/PROOF.md @@ -0,0 +1,174 @@ +# A paid floor for confined two-clique relay networks + +This contribution was produced by Nick Petalas. Apache-2.0. + +## Contract + +Let G=A disjoint-union B be a finite set of binary port labels in a binary +space with a symmetric bilinear form, with both classes nonempty. Assume + + = 1 if i,j belong to the same class, and 0 otherwise. + +In particular every label has self-pairing one. Let W be the span of G. +All source coordinates are independent over Q. No source is initialized to +zero. Write e_i for the unit source row and X(g)=span_Q{e_i:p_i in g}. + +A finite ordered REL network consists of moves mu=1,...,M with binary frames + + L_mu strictly contained in g_mu contained in W, + v_mu = l_mu + sum_(nu, interpreted as the rational +number zero or one. Correctness of the pattern requires C_ji=delta_ji +whenever Gamma_ji=1. Thus H=C Hadamard-product Gamma=I_|G|. No condition +is imposed on the two off-diagonal class blocks of C. + +## Theorem + +Every such network satisfies + + rank_Q(H) + <= sum_mu [dim pi(g_mu) - dim pi(L_mu)] + <= P, (1) + +where pi:W -> F2^2 sends every A port to (1,0) and every B port to (0,1). +Consequently every correct network has P>=|G|. Equality is attainable in +REL. For two four-port cliques the exact minimum is eight. + +The first inequality is a statement about the complete network, including +all relayed source content. It is not a rank bound on each term separately. + +## The rational subspace representation + +Choose representative ports a in A and b in B. Define + + pi(x) = (,). + +The Gram assumption gives the asserted values on G. Since G spans W, this +also proves that every p_j in a fixed class has the same pairing functional +on W. For j in A it is the first coordinate of pi, and for j in B the second. + +Represent the five binary subspaces of F2^2 by rational subspaces of Q^2: + +| Binary subspace S | T(S) over Q | +| --- | --- | +| zero | zero | +| span(1,0) | span_Q(1,0) | +| span(0,1) | span_Q(0,1) | +| span(1,1) | span_Q(1,1) | +| F2^2 | Q^2 | + +This representation preserves all inclusions and dimensions. Write +T_g=T(pi(g)) and t_j=(1,0) or (0,1) according to the class of j. +Three properties follow. + +1. If p_i is in g, then t_i is in T_g. +2. If L is contained in Q_j, then the rational functional t_j^T annihilates + T_L. For a coordinate functional, binary and rational annihilation have + exactly the same zero cases in the table. +3. For L contained in g, T_L is contained in T_g and + + dim T_g - dim T_L = dim pi(g) - dim pi(L) + <= dim g - dim L. (2) + +The last inequality is the rank bound on the induced map g/L -> pi(g)/pi(L). +In particular radical-only frame drops contribute zero to the first bill +in (1), although they can cost positive P. + +## Cumulative information invariant + +For a rational source row v define the 2-by-|G| packet B(v) whose ith column +is t_i v(i). Its two rows are the A and B restrictions of v. For a local +source row l in X(g), every column of B(l) lies in T_g by property 1. + +We inductively construct a subspace D_mu of rational source rows. It obeys + + z^T B(v_nu) is in D_mu for every nu<=mu + and every rational functional z annihilating T_Lnu, (3) + +and has dimension at most the first mu summands of (1). Initially D_0=0. + +For move mu, take any z annihilating T_gmu. The local contribution vanishes. +Every permitted earlier parent nu has T_Lnu contained in T_gmu. Therefore +z also annihilates T_Lnu, and (3) for the earlier parent gives + + z^T B(v_mu) = sum_(nu= 8. +[PROOF.md](PROOF.md) proves the statement for any finite two-clique port set. + +The proof uses an inclusion-preserving rational representation of the five +binary quotient subspaces and maintains a cumulative row space. This is +needed because one term in a legal chain can have Hadamard rank two while +its own paid descent is only one. Counting that term independently would +miss its predecessor's cost. The checker includes this exact counterexample. + +The attaining endpoint has rank four, C=[[I_4,I_4],[I_4,I_4]], but still costs +eight. Thus the low completion rank in the proposed block construction +cannot itself produce a cheaper confined owned layer. + +## Exact finite evidence + +The new concrete P104 block is + +```text +A = 73, 239, 336, 502 +B = 81, 247, 328, 494 +W = span_F2(81, 502, 239, 73). +``` + +The pinned predecessor word is read only for its port definition. The replay +checks membership of these eight ports, their complete Gram table and: + +- All 67 subspaces of W and all 513 nested frame pairs, including equality. + There are 128 local-source and 128 receiving-functional checks. +- Two attaining networks, including every source-coordinate column of their + complete rank-four endpoint and identity Hadamard shadow. +- 512 deterministic sixteen-move networks, containing 18,885 nonzero parent + edges, 4,429 branching parents and 4,407 moves with multiple parents. + Literal coordinate evaluation agrees with the packet calculation. +- All 512 binary three-by-three rational matrices against a separate minor + rank oracle, five rejected invalid networks, and the shared-cost control. + +The relay fixtures are not an exhaustive network census. The all-finite-network +claim is the written proof. The finite runs test its representation and +invariant, with explicit exceptions that remain active under optimization. +The replay prints a generated receipt bound to every package file's SHA256. +No receipt is handwritten and the verifier writes no files. + +## Reproduce + +From the repository root, with CPython 3.12 and the standard library: + +```sh +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -W error -B research/p104-two-clique-relay-floor/verify.py +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -W error -O -B research/p104-two-clique-relay-floor/verify.py +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/p104-two-clique-relay-floor +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/p104-two-clique-relay-floor --check-source-history +``` + +Another CPython 3.12 path can replace the local interpreter. The scientific +marker is `PASS_P104_TWO_CLIQUE_RELAY_FLOOR`. The runner also checks exact +source pins and metadata. The publication preflight checks committed bytes +and source-history availability. These are different checks. + +## Limits and implementation bounds + +All gathering and landing frames must remain inside W. Two same-class ports +can have different pairing functionals outside W, breaking the rational +representation's reader condition. The proof grants free public re-ascents +and arbitrary rational scalar coefficients, so it excludes a larger class +than confined dyadic REL networks. It supplies no physical scalar word, +native implementation, full productive/paid invoice or supplier admission. +The five selected framework assumptions remain. No selected cold replay, +Lean, Docker or historical scientific suite is required or claimed. +Independent human and formal proof-kernel review are unclaimed. + +The finite reference implementation fixes eight ports, at most sixteen moves, +binary dimension at most nine, and rational matrices at most 64 by 16. The +registered fixtures use coefficients in {-1,0,1}. Matrix input parts are +capped at 2,048 bits. There is no recursion, dynamic code evaluation, network +access or subprocess creation. Functions stay below 60 physical lines. +The checks run with warnings treated as errors, normally and under `-O`. + +Power-of-Ten rule 3 has a managed-runtime deviation. Python allocates Fraction +and container objects during these finite replays. Fixed frame, port, move +and coefficient domains bound live state, and no network history is retained +across cases. The source is one pinned finite compressed JSON file, opened +with a context manager. The replay exercises the maximum move count and +invalid frame/arrival/receiver contracts. A fixed-capacity arithmetic backend +would be needed if this became a production checker with external inputs. + +## Open next questions + +Can an outside-reaching network reduce the eight-unit cost? First specify +one gathering/landing network and the exact source and receiving maps, then +test the rational-lift reader condition. The blocker is that classwise +pairing functionals agree only on W. Any physical successor must also pay +public helper lifetimes, restoration, native access and all other charges. +The structured question is in [TASK.json](TASK.json). + +## Provenance and credit + +This contribution was produced by Nick Petalas. Apache-2.0. + +DreamingOfClouds PR6170 supplies the open two-clique question and REL +contract, including its local-source, landing and paid definitions. Its +isolated-move result is a cited predecessor, not an audit deliverable. Ali +Romman's PR5599 supplies the retained port definition. Matarener's P104 +geometry and the retained P104/native/helper/controller/caller lineage keep +their credit. Linear rank bookkeeping and the rational rank-two subspace +representation use classical linear algebra. + +The base is canonical main `a5bff3bf133e482541c09eba4e773884bdb2b1b7`. +[SOURCES.json](SOURCES.json) binds the exact source blobs and SHA256 values. +The selected record and catalogue are historical provenance; only the port +definition is a live external input. Task scope is explicitly changed from +the card's selected-word experiment to this targeted obstruction. + +The advance [CLAIM](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19279674) +follows checks of live handoffs, active Discussions, open/merged PRs, recent +account contributions and local target reservations. The cached open snapshot +covered 338 PRs and 5,957 Discussion records with complete pagination. The +sparse local scan searched 84 notes and omitted 8,539; distinctive Git searches +against main and separate merged-PR searches supplemented it. These searches +do not cover unpublished work or prove global novelty. diff --git a/research/p104-two-clique-relay-floor/SOURCES.json b/research/p104-two-clique-relay-floor/SOURCES.json new file mode 100644 index 0000000000..14b5d975e6 --- /dev/null +++ b/research/p104-two-clique-relay-floor/SOURCES.json @@ -0,0 +1,30 @@ +{ + "schema_version": 1, + "base_commit": "a5bff3bf133e482541c09eba4e773884bdb2b1b7", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "d59b5035e7b4cbaa9d688a1d32dd0d6eb79c466a", + "sha256": "9b8d0eea95b3bf0dfcb7938a732a6439b87a2685dec2a5ab9e525b3b34debbfa" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "research/p104-designer-toolkit-v2/P104-LEMMAS.md", + "usage": "provenance", + "git_blob": "129f28dd10c9e1c43d29a9dd280e022070288a73", + "sha256": "54263ecdcabb067b1f77749ae60cb1f430c02fd720b63e5e39f358f6bfee78ec" + }, + { + "path": "research/p104-helper-subspace-splits/WORD.json.gz", + "usage": "input", + "git_blob": "e325091e3051afe37a2d9c82f85afe9028510edb", + "sha256": "bbb072bced5824a8d9094c49be2fc51fbfdd05fb2b7dab8106e1275053075099" + } + ] +} diff --git a/research/p104-two-clique-relay-floor/TASK.json b/research/p104-two-clique-relay-floor/TASK.json new file mode 100644 index 0000000000..924b407e5b --- /dev/null +++ b/research/p104-two-clique-relay-floor/TASK.json @@ -0,0 +1,129 @@ +{ + "schema_version": 1, + "task_id": "p104-side-correction", + "priority_revision": 8, + "base_commit": "a5bff3bf133e482541c09eba4e773884bdb2b1b7", + "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" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Prove the exact eight-unit owned paid floor for two-clique P104 blocks with arbitrary finite acyclic REL chains, merging and relays confined to the block span.", + "scope_change_reason": "The current card permits a targeted obstruction. This answers PR6170 P104-LEMMAS.md section 11.5, extending its isolated-move argument to whole confined networks rather than editing a selected word.", + "bottleneck_link": "The frontier needs a cheaper complete delivery/owned layer. This excludes using relays confined to an eight-port two-clique block to attain its rank-four completion at paid cost below eight; outside-reaching E8-like layers remain open.", + "budget_minutes": 60, + "stop_rule": "Ship the first proved original extension with bounded exact corroboration; do not expand into outside-reaching frames.", + "outcome": "negative-result", + "evidence": "PROOF.md proves the all-finite-network rank bound. verify.py checks all 67 frames and 513 nested pairs in a new P104 block, two exact cost-eight attainers, 512 sixteen-move networks, a separate 512-matrix minor oracle, five rejected networks and a per-move counterexample.", + "author": "Nick Petalas", + "ai_assistance": "Independent human and formal proof-kernel review are unclaimed.", + "open_questions": [ + { + "question": "Can gathering or landing frames outside the two-clique block span lower the complete owned bill?", + "why_it_matters": "The confined floor rules out the cheapest block-local use of the rank-four completion, but does not constrain the full P104 geometry.", + "first_step": "Specify one outside-reaching REL network and its complete source/landing maps; test the rational-lift reader condition before optimizing its paid profile.", + "blocked_by": "A same-class port pairing need not agree outside the block span; the present two-dimensional representation no longer proves reader availability." + } + ], + "source_question": { + "pr": 6170, + "author": "DreamingOfClouds", + "path": "research/p104-designer-toolkit-v2/P104-LEMMAS.md", + "section": "11.5", + "claim": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19279674" + }, + "environment": { + "python": "3.12.15", + "platform": "macOS-27.0.1-arm64-arm-64bit", + "dependencies": "standard library only" + } +} diff --git a/research/p104-two-clique-relay-floor/VERIFY.json b/research/p104-two-clique-relay-floor/VERIFY.json new file mode 100644 index 0000000000..297b7801a7 --- /dev/null +++ b/research/p104-two-clique-relay-floor/VERIFY.json @@ -0,0 +1,34 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/p104-helper-subspace-splits/WORD.json.gz" + ], + "commands": [ + { + "argv": [ + "{python}", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "All confined-block frames, cumulative information invariant, exact attainers, branching/merged relay fixtures, minor oracle and rejecting controls." + }, + { + "argv": [ + "{python}", + "-W", + "error", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "The same exact checks with assertions disabled; all contracts use explicit exceptions." + } + ] +} diff --git a/research/p104-two-clique-relay-floor/model.py b/research/p104-two-clique-relay-floor/model.py new file mode 100644 index 0000000000..468d37f3c5 --- /dev/null +++ b/research/p104-two-clique-relay-floor/model.py @@ -0,0 +1,166 @@ +"""Exact finite model for the confined two-clique relay theorem. + +This contribution was produced by Nick Petalas. Apache-2.0. +""" + +from fractions import Fraction + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def span(generators): + require(len(generators) <= 9, "at most nine binary generators") + result = frozenset({0}) + for vector in generators: + require(type(vector) is int and 0 <= vector < 512, "binary vector") + result |= frozenset(value ^ vector for value in result) + return result + + +def dimension(frame): + require(0 in frame and len(frame) <= 512, "nonempty bounded frame") + dim = len(frame).bit_length() - 1 + require(len(frame) == 1 << dim, "frame cardinality") + return dim + + +def row_basis(rows, width): + require(0 <= width <= 16 and len(rows) <= 64, "rational matrix capacity") + matrix = [] + for row in rows: + require(len(row) == width, "rational row width") + converted = [Fraction(value) for value in row] + require(all(max(abs(x.numerator).bit_length(), x.denominator.bit_length()) + <= 2048 for x in converted), "rational input capacity") + matrix.append(converted) + pivot_row = 0 + for column in range(width): + pivot = next((i for i in range(pivot_row, len(matrix)) + if matrix[i][column]), None) + if pivot is None: + continue + matrix[pivot_row], matrix[pivot] = matrix[pivot], matrix[pivot_row] + divisor = matrix[pivot_row][column] + matrix[pivot_row] = [x / divisor for x in matrix[pivot_row]] + for i in range(len(matrix)): + if i != pivot_row: + factor = matrix[i][column] + matrix[i] = [x - factor * y + for x, y in zip(matrix[i], matrix[pivot_row])] + pivot_row += 1 + return tuple(tuple(row) for row in matrix[:pivot_row]) + + +def in_rows(row, basis): + return len(row_basis([*basis, row], len(row))) == len(basis) + + +def tags_for(ports): + require(len(ports) == 8 and len(set(ports)) == 8, "eight distinct ports") + first = ports[0] + tags = tuple(1 if (first & p).bit_count() % 2 else 2 for p in ports) + require(tags.count(1) == tags.count(2) == 4, "two four-port classes") + for i, p in enumerate(ports): + for j, q in enumerate(ports): + require((p & q).bit_count() % 2 == (tags[i] == tags[j]), + "two-clique Gram contract") + return tags + + +def image(frame, ports, tags): + first = ports[tags.index(1)] + second = ports[tags.index(2)] + return frozenset(((x & first).bit_count() % 2) + | (((x & second).bit_count() % 2) << 1) for x in frame) + + +def annihilator(binary_image): + table = { + frozenset({0}): ((1, 0), (0, 1)), + frozenset({0, 1}): ((0, 1),), + frozenset({0, 2}): ((1, 0),), + frozenset({0, 3}): ((1, -1),), + frozenset({0, 1, 2, 3}): (), + } + require(binary_image in table, "binary quotient subspace") + return table[binary_image] + + +def packet(vector, tags, functional): + return tuple(Fraction(value) * functional[tag - 1] + for value, tag in zip(vector, tags)) + + +def check_network(ports, moves, output): + """Check REL and return the invoice, shadow rank and debt dimension.""" + tags = tags_for(ports) + universe = span(list(ports[:4]) + [ports[4]]) + require(len(moves) <= 16 and len(output) == 8, "network capacity") + require(all(len(row) == len(moves) for row in output), "output shape") + vectors, landings, debt = [], [], () + paid = effective = 0 + for move in moves: + gather, landing, local, parents = move + require(gather <= universe and landing < gather, "confined strict descent") + require(span(list(row_basis_binary(gather))) == gather, "gather subspace") + require(span(list(row_basis_binary(landing))) == landing, "landing subspace") + require(len(local) == 8 and len(parents) == len(vectors), "source shape") + require(all(not x or ports[i] in gather for i, x in enumerate(local)), + "local source availability") + require(all(not x or landings[i] <= gather for i, x in enumerate(parents)), + "ancestor arrival availability") + vector = tuple(Fraction(local[i]) + sum( + Fraction(a) * old[i] for a, old in zip(parents, vectors)) + for i in range(8)) + before = annihilator(image(gather, ports, tags)) + after = annihilator(image(landing, ports, tags)) + require(all(in_rows(packet(vector, tags, z), debt) for z in before), + "incoming debt invariant") + extended = row_basis(list(before), 2) + added = [] + for z in after: + if not in_rows(z, extended): + added.append(packet(vector, tags, z)) + extended = row_basis([*extended, z], 2) + drop = len(after) - len(before) + require(len(added) == drop, "quotient extension dimension") + require(drop <= dimension(gather) - dimension(landing), "drop bill") + debt = row_basis([*debt, *added], 8) + require(all(in_rows(packet(vector, tags, z), debt) for z in after), + "outgoing debt invariant") + vectors.append(vector) + landings.append(landing) + paid += dimension(gather) - dimension(landing) + effective += drop + shadow = [] + for j, row in enumerate(output): + functional = (1, 0) if tags[j] == 1 else (0, 1) + for coefficient, landing in zip(row, landings): + require(not coefficient or functional in + row_basis(list(annihilator(image(landing, ports, tags))), 2), + "receiver availability") + shadow.append(tuple(sum(Fraction(a) * v[i] for a, v in zip(row, vectors)) + if tags[i] == tags[j] else Fraction(0) + for i in range(8))) + rank = len(row_basis(shadow, 8)) + require(all(in_rows(row, debt) for row in shadow), "output debt containment") + require(rank <= len(debt) <= effective <= paid, "complete rank invoice") + return {"paid": paid, "effective_paid": effective, "shadow_rank": rank, + "debt_dimension": len(debt), "shadow": shadow} + + +def row_basis_binary(frame): + require(len(frame) <= 512 and all(type(x) is int and 0 <= x < 512 for x in frame), + "bounded binary frame") + basis = [] + generated = frozenset({0}) + for x in sorted(frame): + if x not in generated: + basis.append(x) + require(len(basis) <= 9, "binary dimension capacity") + generated = span(basis) + require(generated == frame, "binary subspace closure") + return tuple(basis) diff --git a/research/p104-two-clique-relay-floor/verify.py b/research/p104-two-clique-relay-floor/verify.py new file mode 100644 index 0000000000..f9bb0e8a48 --- /dev/null +++ b/research/p104-two-clique-relay-floor/verify.py @@ -0,0 +1,207 @@ +#!/usr/bin/env python3 +"""Replay new two-clique relay fixtures, not predecessor word results. + +This contribution was produced by Nick Petalas. Apache-2.0. +""" + +import gzip +import hashlib +import itertools +import json +from pathlib import Path +import random + +from model import (annihilator, check_network, dimension, image, in_rows, + packet, require, row_basis, row_basis_binary, span, tags_for) + + +PACKAGE = Path(__file__).resolve().parent +PORTS = (73, 239, 336, 502, 81, 247, 328, 494) + + +def all_frames(): + universe = span([81, 502, 239, 73]) + frames = {frozenset({0})} + for _ in range(4): + fresh = set(frames) + for frame in frames: + basis = row_basis_binary(frame) + for x in universe - frame: + fresh.add(span([*basis, x])) + frames = fresh + result = sorted(frames, key=lambda f: (len(f), tuple(sorted(f)))) + require(len(result) == 67, "all four-dimensional binary subspaces") + return result + + +def check_geometry(frames): + root = PACKAGE.parents[1] + path = root / "research/p104-helper-subspace-splits/WORD.json.gz" + with gzip.open(path, "rt", encoding="utf-8") as handle: + source_ports = json.load(handle)["ports"] + require(set(PORTS) <= set(source_ports), "fixture ports belong to the source") + tags = tags_for(PORTS) + intervals = local_tests = reader_tests = 0 + for gather in frames: + before = annihilator(image(gather, PORTS, tags)) + for i, port in enumerate(PORTS): + if port in gather: + local_tests += 1 + unit = tuple(int(j == i) for j in range(8)) + require(all(not any(packet(unit, tags, z)) for z in before), + "all local input generators lie in the rational lift") + if all(not (port & x).bit_count() % 2 for x in gather): + reader_tests += 1 + z = (1, 0) if tags[i] == 1 else (0, 1) + require(in_rows(z, row_basis(list(before), 2)), + "all binary readers annihilate the rational lift") + for landing in frames: + if landing <= gather: + intervals += 1 + after = row_basis(list(annihilator(image(landing, PORTS, tags))), 2) + require(all(in_rows(z, after) for z in before), "lift inclusion") + require(len(after) - len(before) <= + dimension(gather) - dimension(landing), "all gap bounds") + return {"frames": len(frames), "nested_pairs": intervals, + "local_generators": local_tests, "reader_tests": reader_tests} + + +def attaining_network(staged): + moves = [] + output = [[0] * (8 if staged else 4) for _ in PORTS] + for i in range(4): + local = tuple(int(j in (i, i + 4)) for j in range(8)) + gather = span([PORTS[i], PORTS[i + 4]]) + middle = span([PORTS[i] ^ PORTS[i + 4]]) if staged else frozenset({0}) + moves.append((gather, middle, local, (0,) * len(moves))) + if staged: + parents = [0] * len(moves) + parents[-1] = 1 + moves.append((middle, frozenset({0}), (0,) * 8, tuple(parents))) + output[i][len(moves) - 1] = 1 + output[i + 4][len(moves) - 1] = 1 + return moves, output + + +def check_attainers(): + results = [] + identity = [tuple(int(i == j) for j in range(8)) for i in range(8)] + for staged in (False, True): + moves, output = attaining_network(staged) + result = check_network(PORTS, moves, output) + require(result.pop("shadow") == identity, "all eight independent target rows") + require(result == {"paid": 8, "effective_paid": 8, + "shadow_rank": 8, "debt_dimension": 8}, "sharp invoice") + endpoint = [[int(i % 4 == j % 4) for j in range(8)] for i in range(8)] + require(literal_endpoint(moves, output) == endpoint, "complete source endpoint") + require(len(row_basis(endpoint, 8)) == 4, "rank-four completion control") + results.append({"moves": len(moves), **result, "completion_rank": 4}) + return results + + +def literal_endpoint(moves, output): + values = [] + for _, _, local, parents in moves: + values.append(tuple(local[i] + sum(a * v[i] for a, v in zip(parents, values)) + for i in range(8))) + return [[sum(a * v[i] for a, v in zip(row, values)) for i in range(8)] + for row in output] + + +def check_networks(frames): + rng = random.Random(103) + tags = tags_for(PORTS) + intervals = [(g, l) for g in frames for l in frames if l < g] + nonzero_relays = branches = mixed = 0 + for _ in range(512): + moves, uses = [], [0] * 16 + for count in range(16): + gather, landing = intervals[rng.randrange(len(intervals))] + local = tuple(rng.choice((-1, 0, 1)) if p in gather else 0 for p in PORTS) + parents = tuple(rng.choice((-1, 0, 1)) if old[1] <= gather else 0 + for old in moves) + nonzero_relays += sum(bool(x) for x in parents) + mixed += sum(bool(x) for x in parents) >= 2 + for i, x in enumerate(parents): + if x: + uses[i] += 1 + moves.append((gather, landing, local, parents)) + require(len(moves) == count + 1, "fixed network bound") + branches += sum(x >= 2 for x in uses) + output = [[rng.choice((-1, 0, 1)) + if all(not (p & x).bit_count() % 2 for x in move[1]) else 0 + for move in moves] for p in PORTS] + checked = check_network(PORTS, moves, output) + endpoint = literal_endpoint(moves, output) + direct = [tuple(endpoint[j][i] * int(tags[i] == tags[j]) for i in range(8)) + for j in range(8)] + require(checked["shadow"] == direct, "literal endpoint replay") + require(min(nonzero_relays, branches, mixed) > 0, "relay coverage is nonvacuous") + return {"networks": 512, "moves": 8192, "nonzero_parent_edges": nonzero_relays, + "branching_parents": branches, "mixed_parent_moves": mixed} + + +def check_rank_oracle(): + for bits in itertools.product((0, 1), repeat=9): + a, b, c, d, e, f, g, h, i = bits + determinant = a * (e * i - f * h) - b * (d * i - f * g) + c * (d * h - e * g) + rows = [bits[0:3], bits[3:6], bits[6:9]] + minors = [rows[r][x] * rows[s][y] - rows[r][y] * rows[s][x] + for r, s in itertools.combinations(range(3), 2) + for x, y in itertools.combinations(range(3), 2)] + expected = 3 if determinant else 2 if any(minors) else int(any(bits)) + require(len(row_basis(rows, 3)) == expected, "independent minor rank oracle") + return 512 + + +def must_reject(moves, output, message): + try: + check_network(PORTS, moves, output) + except ValueError as error: + require(message in str(error), "control failed for the intended reason") + else: + raise ValueError("invalid network accepted: " + message) + + +def check_controls(): + moves, output = attaining_network(True) + bad = list(moves) + g, l, local, parents = bad[1] + bad[1] = (g, l, (1,) + (0,) * 7, parents) + must_reject(bad, output, "local source availability") + bad = list(moves) + g, l, local, parents = bad[0] + bad[0] = (g, span([PORTS[0]]), local, parents) + must_reject(bad, output, "ancestor arrival availability") + bad_output = [list(row) for row in output] + bad_output[0][0] = 1 + must_reject(moves, bad_output, "receiver availability") + bad = list(moves) + g, _, local, parents = bad[0] + bad[0] = (g, g, local, parents) + must_reject(bad, output, "confined strict descent") + bad = list(moves) + g, l, local, parents = bad[0] + bad[0] = (g | {1}, l, local, parents) + must_reject(bad, output, "confined strict descent") + pair = [moves[0], moves[1]] + pair_output = [[int(j == 1 and i in (0, 4)) for j in range(2)] for i in range(8)] + result = check_network(PORTS, pair, pair_output) + require(result["shadow_rank"] == 2 and dimension(pair[1][0]) == 1, + "shared-cost counterexample to per-move rank billing") + return {"rejected_networks": 5, "per_move_counterexample": True} + + +def main(): + frames = all_frames() + result = {"status": "PASS_P104_TWO_CLIQUE_RELAY_FLOOR", "claim_type": "scoped-proof", + "geometry": check_geometry(frames), "attainers": check_attainers(), + "relay_fixtures": check_networks(frames), "rank_oracle_cases": check_rank_oracle(), + "controls": check_controls(), "no_new_kappa": True} + result["package_sha256"] = {p.name: hashlib.sha256(p.read_bytes()).hexdigest() + for p in sorted(PACKAGE.iterdir()) if p.is_file()} + print(json.dumps(result, indent=2, sort_keys=True)) + + +if __name__ == "__main__": + main() From 50540b2a7e0d219bc4920e6252e75113b5a9d8d8 Mon Sep 17 00:00:00 2001 From: Nick Petalas Date: Thu, 29 Oct 2026 22:19:20 +0000 Subject: [PATCH 2/2] fix(research): derive relay frame span from every port --- research/p104-two-clique-relay-floor/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/research/p104-two-clique-relay-floor/model.py b/research/p104-two-clique-relay-floor/model.py index 468d37f3c5..6582cfb3ea 100644 --- a/research/p104-two-clique-relay-floor/model.py +++ b/research/p104-two-clique-relay-floor/model.py @@ -97,7 +97,7 @@ def packet(vector, tags, functional): def check_network(ports, moves, output): """Check REL and return the invoice, shadow rank and debt dimension.""" tags = tags_for(ports) - universe = span(list(ports[:4]) + [ports[4]]) + universe = span(list(ports)) require(len(moves) <= 16 and len(output) == 8, "network capacity") require(all(len(row) == len(moves) for row in output), "output shape") vectors, landings, debt = [], [], ()