From 4c0ef119c6bad986ff633ecf1cfa8ebdf661755d Mon Sep 17 00:00:00 2001 From: Clear Insight Date: Mon, 19 Oct 2026 07:48:21 +1100 Subject: [PATCH 1/3] research: test source-bound centre sheaf and integer-fibre reduction Draft bounded follow-up to PR3147/3656. Reuse the frozen PR3071 source extractor; do not change selected sources or claim physical sharing. --- research/centre-sheaf-fibre/PROOF.md | 99 +++++++++++ research/centre-sheaf-fibre/README.md | 58 +++++++ research/centre-sheaf-fibre/SOURCES.json | 10 ++ research/centre-sheaf-fibre/TASK.json | 35 ++++ research/centre-sheaf-fibre/VERIFY.json | 12 ++ research/centre-sheaf-fibre/sheaf.py | 190 ++++++++++++++++++++++ research/centre-sheaf-fibre/test_sheaf.py | 106 ++++++++++++ research/centre-sheaf-fibre/verify.py | 93 +++++++++++ 8 files changed, 603 insertions(+) create mode 100644 research/centre-sheaf-fibre/PROOF.md create mode 100644 research/centre-sheaf-fibre/README.md create mode 100644 research/centre-sheaf-fibre/SOURCES.json create mode 100644 research/centre-sheaf-fibre/TASK.json create mode 100644 research/centre-sheaf-fibre/VERIFY.json create mode 100644 research/centre-sheaf-fibre/sheaf.py create mode 100644 research/centre-sheaf-fibre/test_sheaf.py create mode 100644 research/centre-sheaf-fibre/verify.py diff --git a/research/centre-sheaf-fibre/PROOF.md b/research/centre-sheaf-fibre/PROOF.md new file mode 100644 index 0000000000..2fceac5f32 --- /dev/null +++ b/research/centre-sheaf-fibre/PROOF.md @@ -0,0 +1,99 @@ +# Local-to-global reduction for a fixed subgroup block + +A general exact lemma, followed by a finite application that must be checked. +All observations are scalar maps over Q. The same conclusions hold over +characteristic-zero extensions. No physical caller or recursive cost is proved. + +## Coset elimination + +Let G contain involutions rho_p and a finite subgroup H. Let r_p be the columns +of a full-row-rank d-by-n rational matrix R. Arrays x(g,p) are supported on H +and extended by zero outside H. Set + + Sx(g) = sum_p r_p x(g,p), + 4Tx(z) = sum_p r_p x(z rho_p,p). + +Partition ports by H rho_p=H rho_q, equivalent to rho_p rho_q in H. For a class +C and an output z in its coset, only C contributes. If R_C has independent +columns, Tx(z)=0 forces each incoming coordinate to zero. Every source/port +coordinate appears at z=g rho_p, so all coordinates in such classes vanish. + +Suppose the only deficient class is P={a,b,c}, rank two, with the unique +relation r_a-r_b-r_c=0. The source equations force + + x(g,a)=alpha(g), x(g,b)=x(g,c)=-alpha(g). + +At z=g rho_a, the later equation is + + r_a alpha(g)-r_b alpha(g rho_a rho_b)-r_c alpha(g rho_a rho_c)=0. + +Independence of r_b,r_c forces equality of these three amplitudes. If the two +even route products generate H, alpha is constant. Conversely every constant +works. Hence the full common kernel is Qv, where v equals(1,-1,-1) on P at +every owner of H and is zero on all other ports. This uses every port; absence +of other individual routes from a larger group cannot replace the coset test. + +## Cellular sheaf + +Use the bipartite graph of source owners and touched output owners. Source +vertex stalks are ker R; an output vertex for class C has stalk ker R_C. Each +port edge has stalk Q, with restriction maps given by the corresponding source +and output coordinates. Global sections are exactly ker S intersect ker T. +Independent output stalks vanish and eliminate their incident coordinates. +Remaining triple stalks have dimension one. Normalising by their nonzero +coefficients makes every edge restriction equality. Connectivity therefore +gives a one-dimensional global-section space. No higher-cohomology assertion +about the unreduced sheaf is needed. + +## Information and proper subblocks + +S has rank dh. Thus rank(T restricted to ker S)=(n-d)h-1. If linear additional +observations L permit recovery of T from(S,L), even by a nonlinear decoder, +then ker S intersect ker L is contained in ker T. Consequently L needs at +least(n-d)h-1 scalar coordinates; a linear quotient attains this abstractly. +This does not give a native programme or tariff. + +Any kernel vector on a proper B subset H extends by zero to H, hence is a +multiple of v. Because v is nonzero at every owner, that multiple must be +zero. The proper-subblock requirement is therefore(n-d)|B|. Left translates +of H have the same result, but arbitrary equally sized owner sets do not +follow from it. + +## Primitive integer fibres + +When R is integral, stack S and4T into an integer matrix A. Since v has an +entry one, ker_Z A=Zv. A nonempty nonnegative integer fibre equals + + {n0+t v: t integer, lower<=t<=upper}, + lower=max_{v_i=1}(-n0_i), upper=min_{v_i=-1}(n0_i). + +The single primitive move v in either direction connects every such fibre. +The associated toric ideal is generated by the binomial for v-positive and +v-negative. This is a coefficient-fibre statement, not an operation-scheduling +model. In particular sum(v)=-h, so imposing a fixed total-count row kills the +kernel. Extra resource invariants cannot be silently discarded. + +## Proposed finite application + +PR3071/3147/3656 give n=112,d=8,h=4080. If the full coset certificate passes, +there are456960 variables, old rank32640, common kernel dimension one, and +424319 additional linear observations are necessary and sufficient abstractly. +The move has4080 positive and8160 negative entries. Source-dependent execution +is pending in this draft. Physical phases, payload covariance, acquisition, +chronology, dirty restoration, precision, hosting and a favourable complete +supplier bill remain outside this scalar theorem. + +## References and credit + +Hansen and Ghrist, Toward a spectral theory of cellular sheaves, Journal of +Applied and Computational Topology3 (2019),315-358, DOI10.1007/s41468-019-00038-7. +Diaconis and Sturmfels, Algebraic algorithms for sampling from conditional +distributions, Annals of Statistics26(1) (1998),363-397, DOI10.1214/aos/1030563990. +These established theories motivate the formulation; they do not prove the +source-specific premises. + +Credit Matarener/3656 for the4080-owner subgroup and witness, dcharb78/3147 for +the programme, Ross Richardson/3071 for the observation model and extractor, +Sagar Thakrar/3291 and Sudarsh Chaturvedi/3168 for the corrected graph/census +lineage, and all selected source notices. Clear1nsight with substantial OpenAI +assistance; Apache-2.0. No separate human or formal-kernel acceptance claimed. diff --git a/research/centre-sheaf-fibre/README.md b/research/centre-sheaf-fibre/README.md new file mode 100644 index 0000000000..307ed48eca --- /dev/null +++ b/research/centre-sheaf-fibre/README.md @@ -0,0 +1,58 @@ +# Centre sheaf and primitive integer fibre + +Draft source-bound investigation of PR3147's centre-sharing lineage, answering +PR3656's full-kernel question on its explicit4080-owner subgroup. This does not +supply a physical shared centre, a recursive tariff, or a new kappa. + +## Precise test + +The known triple(0,6,85) gives one common-kernel vector. Group all112 port +routes by right cosets of its even subgroup H. Full-column-rank output classes +force their input coordinates to zero. If the only deficient class is the +known rank-two triple, remaining compatibility forces one constant amplitude +across H. This would prove that the known vector spans the entire common +kernel, even when all112 ports can vary. + +The conditional reduction is in PROOF.md. The actual coset certificate must +pass before the application is claimed. The verifier deliberately rejects any +additional deficient class instead of assuming it away. + +## Verification boundary + +Eight generic tests passed normally and with -O under local CPython3.13.5. +They compare an independently assembled full matrix on a noncommutative small +group, every proper support subset, and all binary nonnegative fibre points. +They are not a substitute for the actual selected geometry. + +The container cannot fetch the selected archive. Source-dependent execution is +registered for the repository's existing Python3.12 workflow. No successful +source-dependent execution is claimed in this draft. + +```sh +python3.12 -B scripts/research_package.py --package research/centre-sheaf-fibre +``` + +`verify.py --emit-geometry` exports derived rational columns and binary routes +after source authentication. `--geometry FILE` is explicitly arithmetic-only. +Default commands preserve inputs. No predecessor heavy census is run. + +## Open next questions + +TASK.json records the exact dimension test and later physical-contract question. +Stop after a useful source-bound result. Information dimension is not a native +child rank, paid storage quantity, or permission to discard borrowed state. + +## Credit + +Matarener/PR3656 supplies the actual subgroup and witness. David Charbonneau/ +dcharb78/PR3147 supplies the dependent-column and route programme. Ross +Richardson/PR3071 supplies the observation model and authenticated extractor +reused unchanged. Sagar Thakrar/PR3291 supplies the corrected small-block floor; +Sudarsh Chaturvedi/PR3168 supplies separate route checks. Aaron Wang/navinor/ +PR2391, ywz65, and the retained selected geometry/compiler lineage keep credit. + +Sheaf and integer-fibre methods are classical, not invented here. Prepared by +Clear1nsight with substantial OpenAI assistance. No separate agent, independent +human, proof-kernel or full multiplication verification is claimed. Apache-2.0. +Existing sources and frontier are unchanged. The upstream coordination-comment +attempt received HTTP403 and is not a published reservation. diff --git a/research/centre-sheaf-fibre/SOURCES.json b/research/centre-sheaf-fibre/SOURCES.json new file mode 100644 index 0000000000..46fa01a11f --- /dev/null +++ b/research/centre-sheaf-fibre/SOURCES.json @@ -0,0 +1,10 @@ +{ + "schema_version": 1, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "files": [ + {"path": "certificates/selected-result.json", "usage": "provenance", "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129"}, + {"path": "docs/research/agent-task-catalog.json", "usage": "provenance", "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0"}, + {"path": "research/centre-block-repair-information/independent.py", "usage": "input", "git_blob": "d2db50ec7a595b1a1a87b7843fd5ca043c43fd25", "sha256": "b298ff3902c14db11e4ed057259785efc185e8ae3bb39c0d1c432e2340ceb4ea"}, + {"path": "research/community-frontier1094-audit/selected-replay.tar.gz", "usage": "input", "git_blob": "c24daf067f9c543421d89ca2eeaa4eb78a57fb6f", "sha256": "f1da80610bf33c58527f18ad63b4350d0b864e1d4486141ee17ac9bed4d529d6"} + ] +} diff --git a/research/centre-sheaf-fibre/TASK.json b/research/centre-sheaf-fibre/TASK.json new file mode 100644 index 0000000000..81213aa8ee --- /dev/null +++ b/research/centre-sheaf-fibre/TASK.json @@ -0,0 +1,35 @@ +{ + "schema_version": 1, + "task_id": "centre-path-sharing", + "priority_revision": 6, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "original_card": { + "id": "centre-path-sharing", + "question": "Can the 64-per-call centre path (eight rank-8 COPY/ERASE totals through the private temporary) be shared across calls or shrunk?", + "starting_points": ["docs/research/research-family-status.md", "research/complex-local-word-ceiling/README.md", "research/split-centres-global/proofs/PR386-BIT-GEOMETRY.txt", "certificates/selected-result.json"], + "methods": ["Derive a fully charged favorable relaxation for sharing one centre path across k calls, including restoration, hosting and precision.", "Prove a lower bound on copied information per call for the selected decoder contract."], + "acceptance_gate": "Show the changed centre charge and copy profile per call with every added restoration or hosting cost charged, and its ceiling via ceiling.ceiling(centre=...). 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/complex-local-word-ceiling/verify.py"], "expected": "PASS_COMPLEX_LOCAL_WORD_CEILING", "inspect": "Read the selected word's per-call local profile, its packing ceiling and the lever table; run levers.py for the ideal budget of the lever you target.", "scope": "Positive control and planning budget only; this is not a new construction or full cold replay."}, + "first_experiment": "Write the per-call centre charge and copy children for sharing across k = 2 calls, charge the sharing overhead, and screen it; stop this route if even the ideal sharing gains under 10%. Ideal budgets: free 2.80x, shared by two 1.90x (levers.py).", + "bottleneck_link": "The centre path consumes 64 of about 99.6 unpaid coordinates per call, i.e. about 64% of the raw deficit.", + "allowed_variations": ["One sharing pattern across a fixed number of calls.", "One reduced copied-total contract for the existing decoder.", "If the coverage law, template or guard changes, derive an applicable fully charged replacement bound instead of applying the incumbent ceiling outside its scope."], + "scope_change_triggers": ["Removing copies without a replacement contract for the decoder's copied totals.", "Continuing a partial cost improvement while leaving the same unpriced consumer, restoration or central-readout obligation unresolved; refresh the family expansion decision first. Local product-retiming evidence has a narrow scope and is not a ban on changed graphs or contracts."], + "overlap_terms": ["centre path", "copied totals", "private temporary", "shared centre", "batching"] + }, + "scope_status": "changed", + "actual_scope": "User-assigned sheaf and integer-fibre approach to PR3147, refined to the complete112-port common observation kernel on PR3656's4080-owner subgroup. Test exact coset elimination and global compatibility before claiming a dimension.", + "scope_change_reason": "The simple circle route already has PR3151 and PR3194 obstructions. PR3656 supplies a concrete common-kernel witness but leaves its full kernel dimension open. This closes a different information obligation rather than repeating a circle cancellation or the single-triple census.", + "bottleneck_link": "Determines whether the first concrete large block has useful hidden information capacity or only its known one-dimensional perturbation. Information coordinates are not recursive tariffs.", + "budget_minutes": null, + "stop_rule": "Stop after one complete source-bound local-to-global kernel certificate or a counterexample to the proposed reduction. No physical supplier expansion without a changed favourable full boundary and cost ledger.", + "outcome": "partial", + "evidence": "Eight generic finite-group, matrix and nonnegative-fibre control tests pass normally and with -O on local CPython3.13.5. Actual archive-dependent subgroup and coset reduction await execution; draft status until verified.", + "author": "Clear1nsight", + "ai_assistance": "Substantial OpenAI assistance in proof, implementation, tests and writing. No separate agent, independent human or proof-kernel review is claimed.", + "open_questions": [ + {"question": "Does exact outgoing-coset elimination reduce all112 ports on the named block to the known triple?", "why_it_matters": "It decides the full common-kernel dimension without an enormous dense matrix.", "first_step": "Run the authenticated source extractor and finite coset/rank certificate, then independently verify the derived geometry.", "blocked_by": "Archive-dependent execution not yet completed."}, + {"question": "Can a different owner block or output contract yield an affordable physical sharing mechanism?", "why_it_matters": "A scalar kernel does not remove a paid recursive call.", "first_step": "Specify the actual source and return interfaces, chronology and all cost allowances before expanding search.", "blocked_by": "No native acquisition, restoration, hosting or complete supplier bill is supplied."} + ], + "coordination": {"assigned_pr": 3147, "specific_predecessor_pr": 3656, "specific_predecessor_head": "69e745992b966c647e10696b980cb4c96d7ebeed", "entry_canonical_main": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", "overlap": "Targeted live PR searches for sheaf, centre, kernel and the named predecessors; current PR3656 had no comments. Not a complete Discussion or arbitrary-diff census.", "claim_attempt": "Upstream PR3656 claim comment rejected by integration with HTTP403. Not published.", "environment": "Container DNS unavailable; no local repository/selected archive. Fork branch is writable. Registered source-dependent CI, if available, will be distinguished from local generic tests."}, + "family_gate": {"decision": "narrow", "reason": "One bounded information theorem and primitive fibre result only; no numerical saving, no full supplier or selected-frontier change."} +} diff --git a/research/centre-sheaf-fibre/VERIFY.json b/research/centre-sheaf-fibre/VERIFY.json new file mode 100644 index 0000000000..16289cd13f --- /dev/null +++ b/research/centre-sheaf-fibre/VERIFY.json @@ -0,0 +1,12 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": ["research/centre-block-repair-information/independent.py", "research/community-frontier1094-audit/selected-replay.tar.gz"], + "commands": [ + {"argv": ["{python}", "-I", "-B", "{package}/test_sheaf.py"], "timeout_seconds": 60, "checks": "Independent small matrix, proper-subblock and bounded nonnegative-fibre controls; not actual physical semantics."}, + {"argv": ["{python}", "-I", "-B", "{package}/verify.py", "--emit-geometry"], "timeout_seconds": 300, "checks": "Authenticate original selected archive and credited source extractor, test the full112-port subgroup/coset reduction and emit bounded derived geometry."}, + {"argv": ["{python}", "-I", "-O", "-B", "{package}/verify.py"], "timeout_seconds": 300, "checks": "Repeat all actual mathematical guards under optimization."} + ] +} diff --git a/research/centre-sheaf-fibre/sheaf.py b/research/centre-sheaf-fibre/sheaf.py new file mode 100644 index 0000000000..0d72453e09 --- /dev/null +++ b/research/centre-sheaf-fibre/sheaf.py @@ -0,0 +1,190 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Exact local-to-global kernel certificates for a routed observation block. + +Clear1nsight, with substantial OpenAI assistance. Classical sheaf/coset and +integer-fibre methods are credited in PROOF.md. This is not a native program. +""" +from __future__ import annotations + +from collections import Counter, deque +from fractions import Fraction as Q +from hashlib import sha256 +from itertools import combinations +import json + + +def need(condition: bool, message: str) -> None: + if not condition: + raise ValueError(message) + + +def canonical(value: object) -> bytes: + return json.dumps(value, sort_keys=True, separators=(",", ":")).encode() + + +def digest(value: object) -> str: + return sha256(canonical(value)).hexdigest() + + +def apply(columns: tuple[int, ...], vector: int) -> int: + out = 0 + while vector: + low = vector & -vector + out ^= columns[low.bit_length() - 1] + vector ^= low + return out + + +def compose(left: tuple[int, ...], right: tuple[int, ...]) -> tuple[int, ...]: + """The product left*right, represented by columns over F2.""" + return tuple(apply(left, column) for column in right) + + +def closure(generators: list[tuple[int, ...]], cap: int = 10000) -> list[tuple[int, ...]]: + need(bool(generators), "nonempty generating set") + identity = tuple(1 << i for i in range(len(generators[0]))) + found = {identity} + queue = deque([identity]) + while queue: + element = queue.popleft() + for generator in generators: + other = compose(element, generator) + if other not in found: + need(len(found) < cap, "group closure exceeds declared cap") + found.add(other) + queue.append(other) + return sorted(found) + + +def rref(matrix: list[list[Q]]) -> tuple[list[list[Q]], list[int]]: + if not matrix: + return [], [] + width = len(matrix[0]) + need(all(len(row) == width for row in matrix), "rectangular matrix") + work = [[Q(x) for x in row] for row in matrix] + pivots: list[int] = [] + for column in range(width): + pivot = next((i for i in range(len(pivots), len(work)) if work[i][column]), None) + if pivot is None: + continue + at = len(pivots) + work[at], work[pivot] = work[pivot], work[at] + divisor = work[at][column] + work[at] = [x / divisor for x in work[at]] + for i in range(len(work)): + if i != at and work[i][column]: + scalar = work[i][column] + work[i] = [x - scalar * y for x, y in zip(work[i], work[at])] + pivots.append(column) + if len(pivots) == len(work): + break + return work, pivots + + +def rank(matrix: list[list[Q]]) -> int: + return len(rref(matrix)[1]) + + +def coset_classes(routes: list[tuple[int, ...]], subgroup: set[tuple[int, ...]]) -> list[list[int]]: + """Partition involutory ports by H*rho_p = H*rho_q. + + This is equivalent to rho_p*rho_q in H. Test every pair, including both + directions and diagonal, rather than treating a union-find guess as proof. + """ + width = len(routes[0]) + identity = tuple(1 << i for i in range(width)) + need(all(compose(route, route) == identity for route in routes), "routes must be involutions") + classes: list[list[int]] = [] + assignment = [] + for p, route in enumerate(routes): + found = next((j for j, block in enumerate(classes) + if compose(route, routes[block[0]]) in subgroup), None) + if found is None: + found = len(classes) + classes.append([]) + classes[found].append(p) + assignment.append(found) + for p in range(len(routes)): + for q in range(len(routes)): + need((compose(routes[p], routes[q]) in subgroup) == (assignment[p] == assignment[q]), + "right-coset equivalence failed") + return classes + + +def analyse(rows: list[list[Q]], routes: list[tuple[int, ...]], triple=(0, 6, 85), cap=10000) -> dict: + """Compute a finite certificate; fails unless full kernel reduces to triple. + + The proof in PROOF.md, not floating-point rank or toy sampling, lifts these + exact premises to the full routed kernel over Q and its integer fibre. + """ + ports = len(routes) + need(len(rows) == 8 and all(len(row) == ports for row in rows), "eight query rows") + need(len(set(routes)) == ports, "distinct routes") + need(rank(rows) == 8, "full old-query rank") + a, b, c = triple + need(len(set(triple)) == 3 and all(0 <= p < ports for p in triple), "triple range") + need(all(row[a] - row[b] - row[c] == 0 for row in rows), "triple relation is (1,-1,-1)") + need(rank([[row[p] for p in triple] for row in rows]) == 2, "triple rank two") + generators = [compose(routes[a], routes[b]), compose(routes[a], routes[c])] + elements = closure(generators, cap) + subgroup = set(elements) + classes = coset_classes(routes, subgroup) + table = [] + for block in classes: + matrix = [[row[p] for p in block] for row in rows] + table.append({"ports": block, "rank": rank(matrix)}) + deficient = [entry for entry in table if entry["rank"] != len(entry["ports"])] + need(deficient == [{"ports": sorted(triple), "rank": 2}], + "full-block reduction has additional dependent coset classes: " + str(deficient)) + # Build an undirected compatibility graph independently of group closure. + # Edges say alpha(h)=alpha(h*rho_a*rho_b/c). Keep both directions, with + # separate endpoint and spanning-tree checks. + index = {g: i for i, g in enumerate(elements)} + adjacency = [set() for _ in elements] + for i, element in enumerate(elements): + for generator in generators: + j = index[compose(element, generator)] + adjacency[i].add(j) + adjacency[j].add(i) + start = index[tuple(1 << i for i in range(len(routes[0])))] + parent = {start: None} + queue = deque([start]) + tree = [] + while queue: + i = queue.popleft() + for j in sorted(adjacency[i]): + if j not in parent: + parent[j] = i + tree.append([i, j]) + queue.append(j) + need(len(parent) == len(elements) and len(tree) + 1 == len(elements), "compatibility graph connected") + variables = ports * len(elements) + old_rank = 8 * len(elements) + ambient_old_kernel = variables - old_rank + return { + "schema_version": 1, + "status": "PASS_CENTRE_SHEAF_FIBRE", + "ports": ports, + "active_dimension": len(routes[0]), + "owners": len(elements), + "right_coset_classes": table, + "class_size_histogram": {str(k): v for k, v in sorted(Counter(map(len, classes)).items())}, + "deficient_coset_classes": deficient, + "compatibility_vertices": len(elements), + "compatibility_edges": sum(map(len, adjacency)) // 2, + "spanning_tree_edges": len(tree), + "spanning_tree_sha256": digest(tree), + "subgroup_sha256": digest(elements), + "geometry_sha256": digest({"rows": [[str(x) for x in row] for row in rows], "routes": routes}), + "full_variables": variables, + "old_rank": old_rank, + "old_kernel_dimension": ambient_old_kernel, + "full_joint_kernel_dimension": 1, + "additional_linear_observations_required": ambient_old_kernel - 1, + "primitive_move_positive_entries": len(elements), + "primitive_move_negative_entries": 2 * len(elements), + "primitive_move_support": 3 * len(elements), + "constant_count_constraint_kills_kernel": True, + "scope": "Fixed H block and all declared ports, exact scalar observations only; no native tariff or physical caller.", + } diff --git a/research/centre-sheaf-fibre/test_sheaf.py b/research/centre-sheaf-fibre/test_sheaf.py new file mode 100644 index 0000000000..ea1f40f77d --- /dev/null +++ b/research/centre-sheaf-fibre/test_sheaf.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Small complete matrix/fibre oracles, not a substitute for real-source replay.""" +from fractions import Fraction as Q +from itertools import product +from pathlib import Path +import types +import unittest + +HERE = Path(__file__).resolve().parent +engine = types.ModuleType("tested_sheaf") +engine.__file__ = str(HERE / "sheaf.py") +exec(compile((HERE / "sheaf.py").read_bytes(), engine.__file__, "exec"), engine.__dict__) +ROUTES = [(2, 1), (1, 3), (3, 2)] +ROWS = [[1, 1, 0], [1, 0, 1]] + + +def full_operator(rows, routes, owners, omit_outputs=()): + """Independent direct assembly: send each (owner,port) to its actual output. + + The later equation is multiplied by four, harmless over Q/Z for kernels. + """ + width = len(owners) * len(routes) + old = [[0] * width for _ in range(len(owners) * len(rows))] + outputs = sorted({engine.compose(owner, route) for owner in owners for route in routes}) + outputs = [x for x in outputs if x not in omit_outputs] + positions = {owner: i for i, owner in enumerate(outputs)} + later = [[0] * width for _ in range(len(outputs) * len(rows))] + for i, owner in enumerate(owners): + for p, route in enumerate(routes): + col = i * len(routes) + p + target = engine.compose(owner, route) + for k, row in enumerate(rows): + old[i * len(rows) + k][col] = row[p] + if target in positions: + later[positions[target] * len(rows) + k][col] = row[p] + return old + later + + +def matvec(matrix, vector): + return tuple(sum(a * b for a, b in zip(row, vector)) for row in matrix) + + +class Tests(unittest.TestCase): + def setUp(self): + self.owners = engine.closure([engine.compose(ROUTES[0], ROUTES[1]), engine.compose(ROUTES[0], ROUTES[2])]) + self.matrix = full_operator(ROWS, ROUTES, self.owners) + self.move = (1, -1, -1) * len(self.owners) + + def test_noncommuting_routes(self): + self.assertEqual(len(self.owners), 3) + self.assertNotEqual(engine.compose(ROUTES[0], ROUTES[1]), engine.compose(ROUTES[1], ROUTES[0])) + self.assertEqual(engine.coset_classes(ROUTES, set(self.owners)), [[0, 1, 2]]) + + def test_complete_operator_kernel(self): + self.assertEqual(engine.rank(self.matrix), 8) + self.assertEqual(matvec(self.matrix, self.move), (0,) * len(self.matrix)) + echelon, pivots = engine.rref(self.matrix) + self.assertEqual(len(pivots), 8) + self.assertEqual(len(self.move) - len(pivots), 1) + + def test_every_proper_owner_subset(self): + for bits in product((0, 1), repeat=3): + subset = [g for b, g in zip(bits, self.owners) if b] + if subset and len(subset) < 3: + self.assertEqual(engine.rank(full_operator(ROWS, ROUTES, subset)), 3 * len(subset)) + + def test_exact_nonnegative_fibres(self): + fibres = {} + for point in product((0, 1), repeat=9): + fibres.setdefault(matvec(self.matrix, point), []).append(point) + multiple = 0 + for points in fibres.values(): + if len(points) > 1: + multiple += 1 + first = points[0] + for point in points: + t = point[0] - first[0] + self.assertEqual(tuple(a + t * v for a, v in zip(first, self.move)), point) + self.assertGreater(multiple, 0) + + def test_count_constraint(self): + self.assertEqual(sum(self.move), -3) + self.assertEqual(engine.rank(self.matrix + [[1] * 9]), 9) + + def test_wrong_sign_breaks_witness(self): + wrong = (1, 1, -1) * 3 + self.assertNotEqual(matvec(self.matrix, wrong), (0,) * len(self.matrix)) + + def test_omitting_later_constraints_is_unsafe(self): + old_only = self.matrix[:6] + self.assertEqual(engine.rank(old_only), 6) + self.assertLess(engine.rank(old_only), engine.rank(self.matrix)) + + def test_wrong_port_permutation(self): + changed = list(ROUTES) + changed[0], changed[1] = changed[1], changed[0] + matrix = full_operator(ROWS, changed, self.owners) + # Source equality alone cannot detect a route change on a constant + # global mode. An impulse response does detect it. + impulse = (1, 0, 0, 0, 0, 0, 0, 0, 0) + self.assertNotEqual(matvec(matrix, impulse), matvec(self.matrix, impulse)) + + +if __name__ == "__main__": + unittest.main() diff --git a/research/centre-sheaf-fibre/verify.py b/research/centre-sheaf-fibre/verify.py new file mode 100644 index 0000000000..cb9f931c68 --- /dev/null +++ b/research/centre-sheaf-fibre/verify.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Source-bound sheaf reduction, deliberately separate from supplier admission.""" +from __future__ import annotations +import argparse +from fractions import Fraction as Q +from hashlib import sha256 +import json +from pathlib import Path +import sys +import types + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +PINS = { + "research/centre-block-repair-information/independent.py": + "b298ff3902c14db11e4ed057259785efc185e8ae3bb39c0d1c432e2340ceb4ea", + "research/community-frontier1094-audit/selected-replay.tar.gz": + "f1da80610bf33c58527f18ad63b4350d0b864e1d4486141ee17ac9bed4d529d6", +} + + +def local_module(name: str, filename: str): + # Execute the named source bytes directly, ignoring pre-existing bytecode. + module = types.ModuleType(name) + module.__file__ = str(HERE / filename) + exec(compile((HERE / filename).read_bytes(), module.__file__, "exec"), module.__dict__) + return module + + +def geometry(root: Path = ROOT): + for name, expected in PINS.items(): + path = root / name + if not path.is_file() or path.is_symlink(): + raise ValueError("missing regular source: " + name) + if sha256(path.read_bytes()).hexdigest() != expected: + raise ValueError("source SHA256 mismatch: " + name) + name = "research/centre-block-repair-information/independent.py" + module = types.ModuleType("credited_pr3071_source_extractor") + module.__file__ = str(root / name) + exec(compile((root / name).read_bytes(), module.__file__, "exec"), module.__dict__) + word, phases = module.sources() + rows, later = module.query_rows(word) + if later != [[x / 4 for x in row] for row in rows]: + raise ValueError("source contract H=R/4 fails") + routes, products, _ = module.route_certificates(word, phases) + if len(products) != 112 * 111: + raise ValueError("source route uniqueness") + for route in routes: + if len(route) != 73 or any(route[k] != 1 << k for k in range(17, 73)): + raise ValueError("spectator identity") + if any(x >> 17 for x in route[:17]): + raise ValueError("active subspace invariant") + return rows, [tuple(route[:17]) for route in routes] + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--emit-geometry", action="store_true", help="Print authenticated derived geometry for offline verification") + parser.add_argument("--geometry", type=Path, help="Use an explicitly labelled derived geometry export rather than re-read the source archive") + parser.add_argument("--root", type=Path, default=ROOT) + args = parser.parse_args() + engine = local_module("centre_sheaf_engine", "sheaf.py") + if args.geometry: + raw = json.loads(args.geometry.read_text()) + rows = [[Q(x) for x in row] for row in raw["rows"]] + routes = [tuple(row) for row in raw["routes"]] + source_mode = "derived geometry only; archive extraction not rerun" + else: + rows, routes = geometry(args.root) + source_mode = "authenticated archive and credited PR3071 extractor" + if args.emit_geometry: + print("GEOMETRY_JSON=" + json.dumps({"rows": [[str(x) for x in row] for row in rows], "routes": routes}, separators=(",", ":"))) + # Print finite diagnostic before the stronger assertion, so a failed model + # reduction remains a reproducible result rather than a silent truncation. + a, b, c = 0, 6, 85 + group = engine.closure([engine.compose(routes[a], routes[b]), engine.compose(routes[a], routes[c])]) + blocks = engine.coset_classes(routes, set(group)) + diagnostic = [{"ports": block, "rank": engine.rank([[row[p] for p in block] for row in rows])} for block in blocks] + print("COSET_DIAGNOSTIC=" + json.dumps(diagnostic, separators=(",", ":"))) + result = engine.analyse(rows, routes) + engine.need(result["owners"] == 4080, "pinned subgroup order differs from 4080") + result["source_mode"] = source_mode + print("RESULT_JSON=" + json.dumps(result, sort_keys=True, separators=(",", ":"))) + print("PASS_CENTRE_SHEAF_FIBRE owners=4080 all_ports=112 kernel=1 integer_generator_owners=4080 no_new_kappa") + + +if __name__ == "__main__": + try: + main() + except (ValueError, KeyError, OSError, TypeError) as error: + print("FAIL_CENTRE_SHEAF_FIBRE " + str(error), file=sys.stderr) + raise SystemExit(1) from error From 403ef45de40e41baaf8b1f4cfddaf3ba1d57af1c Mon Sep 17 00:00:00 2001 From: Clear Insight Date: Mon, 19 Oct 2026 08:01:32 +1100 Subject: [PATCH 2/3] research: independently reconstruct the routed centre kernel Add a separate archive parser, sparse forward coefficient propagation, row-matrix closure, modular rank certificate and direct residual controls. --- research/centre-sheaf-fibre/VERIFY.json | 6 +- research/centre-sheaf-fibre/independent.py | 248 +++++++++++++++++++++ 2 files changed, 252 insertions(+), 2 deletions(-) create mode 100644 research/centre-sheaf-fibre/independent.py diff --git a/research/centre-sheaf-fibre/VERIFY.json b/research/centre-sheaf-fibre/VERIFY.json index 16289cd13f..192d030d62 100644 --- a/research/centre-sheaf-fibre/VERIFY.json +++ b/research/centre-sheaf-fibre/VERIFY.json @@ -6,7 +6,9 @@ "inputs": ["research/centre-block-repair-information/independent.py", "research/community-frontier1094-audit/selected-replay.tar.gz"], "commands": [ {"argv": ["{python}", "-I", "-B", "{package}/test_sheaf.py"], "timeout_seconds": 60, "checks": "Independent small matrix, proper-subblock and bounded nonnegative-fibre controls; not actual physical semantics."}, - {"argv": ["{python}", "-I", "-B", "{package}/verify.py", "--emit-geometry"], "timeout_seconds": 300, "checks": "Authenticate original selected archive and credited source extractor, test the full112-port subgroup/coset reduction and emit bounded derived geometry."}, - {"argv": ["{python}", "-I", "-O", "-B", "{package}/verify.py"], "timeout_seconds": 300, "checks": "Repeat all actual mathematical guards under optimization."} + {"argv": ["{python}", "-I", "-B", "{package}/verify.py", "--emit-geometry"], "timeout_seconds": 300, "checks": "Authenticate original selected archive and credited source extractor, test all112 ports and emit derived geometry."}, + {"argv": ["{python}", "-I", "-O", "-B", "{package}/verify.py"], "timeout_seconds": 300, "checks": "Repeat source-bound primary guards under optimization."}, + {"argv": ["{python}", "-I", "-B", "{package}/independent.py"], "timeout_seconds": 120, "checks": "Separate raw-archive parser, sparse forward coefficient propagation, row-matrix routes, left group closure, modular minors and direct routed residuals."}, + {"argv": ["{python}", "-I", "-O", "-B", "{package}/independent.py"], "timeout_seconds": 120, "checks": "Repeat the independent source and algebra audit with explicit checks under optimization."} ] } diff --git a/research/centre-sheaf-fibre/independent.py b/research/centre-sheaf-fibre/independent.py new file mode 100644 index 0000000000..c085d6de5f --- /dev/null +++ b/research/centre-sheaf-fibre/independent.py @@ -0,0 +1,248 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Separate row-matrix and modular-minor audit, with no primary code imports. + +Clear1nsight, substantial OpenAI assistance. A separately coded check in this +same session, not an independent human review or a native execution proof. +""" +from __future__ import annotations + +import argparse +from collections import Counter, deque +from fractions import Fraction +from hashlib import sha256 +import gzip +import json +from pathlib import Path +import tarfile + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +ARCHIVE = 'research/community-frontier1094-audit/selected-replay.tar.gz' +ARCHIVE_SHA = 'f1da80610bf33c58527f18ad63b4350d0b864e1d4486141ee17ac9bed4d529d6' +MEMBERS = { + 'candidate/strict/global/base/providers/gauge44/CANONICAL-WORD.json.gz': + '16bc0ebb04b4be6c0ade74badc6a0c0cdba4215eda86e4ff9f13abf8ecebd219', + 'candidate/strict/global/base/work/complex-nine-native/DATA-PHASES.json': + 'c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa', +} + + +def need(ok, reason): + if not ok: + raise ValueError(reason) + + +def digest(value): + return sha256(json.dumps(value, sort_keys=True, separators=(',', ':')).encode()).hexdigest() + + +def sparse_add(destination, source, multiplier): + for key, value in source.items(): + destination[key] = destination.get(key, Fraction(0)) + multiplier*value + if destination[key] == 0: + del destination[key] + + +def push_source_rows(word, backwards=False): + events = word['precondition'] + word['compensation'] + word['A'] + extent = 1+max(max(e[1:3]) if e[0] == 'add' else e[1] for e in events + word['cut']) + state = [{i: Fraction(1)} if i < 112 else {} for i in range(extent)] + if backwards: + for i in range(112): + state[112+i] = {i: Fraction(1)} + for event in events: + if event[0] == 'scale': + target = event[1] + value = Fraction(event[2], event[3]) + need(value != 0, 'invertible scale') + multiplier = 1/value if backwards else value + state[target] = {i: x*multiplier for i,x in state[target].items()} + else: + need(event[0] == 'add', 'canonical elementary event') + target, source = event[1:3] + value = Fraction(event[3], event[4]) + if backwards: + target, source, value = source, target, -value + need(target != source, 'distinct elementary roles') + sparse_add(state[target], state[source], value) + if not backwards: + return [[state[c].get(i, Fraction(0)) for i in range(112)] for c in word['centers']] + rows = [] + for centre in word['centers']: + out = {} + for event in word['cut']: + need(event[0] == 'add', 'canonical cut') + if event[2] == centre: + sparse_add(out, state[event[1]], Fraction(event[3], event[4])) + rows.append([out.get(i, Fraction(0)) for i in range(112)]) + return rows + + +def transpose(rows): + n = len(rows) + return tuple(sum(((rows[i] >> j)&1) << i for i in range(n)) for j in range(n)) + + +def multiply(a,b): + """Binary row-matrix product, using parity dot products.""" + columns = transpose(b) + return tuple(sum(((row & col).bit_count()&1) << j for j,col in enumerate(columns)) for row in a) + + +def own_extract(root): + path = root / ARCHIVE + need(path.is_file() and not path.is_symlink(), 'archive regular file') + need(sha256(path.read_bytes()).hexdigest() == ARCHIVE_SHA, 'archive SHA256') + data = [] + with tarfile.open(path) as archive: + for name,expected in MEMBERS.items(): + matches = [item for item in archive.getmembers() if item.name == name] + need(len(matches) == 1 and matches[0].isfile(), 'unique regular member') + raw = archive.extractfile(matches[0]).read() + need(sha256(raw).hexdigest() == expected, 'member SHA256') + data.append(json.loads(gzip.decompress(raw) if name.endswith('.gz') else raw)) + word,phases = data + rows = push_source_rows(word) + later = push_source_rows(word, True) + need(later == [[x/4 for x in row] for row in rows], 'independent later query') + need(phases['m'] == 73 and len(phases['recipes']) == 112, 'source dimensions') + routes = [] + for index,record in enumerate(phases['recipes']): + q = record['q'] + axes = record['idle_children'][0]['orthogonal_axes'][:8] + need(q == word['ports'][index], 'source port ordering') + basis = [q] + axes + need(len(basis) == 9 and all(0 < v < 512 for v in basis), 'chart dimensions') + need(all(((a&b).bit_count()&1) == int(i==j) + for i,a in enumerate(basis) for j,b in enumerate(basis)), 'orthonormal chart') + upper = tuple((q if (q>>i)&1 else 0) | + sum(((axis>>i)&1) << (9+j) for j,axis in enumerate(axes)) for i in range(9)) + route = upper+tuple(axes) + identity = tuple(1< Date: Mon, 19 Oct 2026 08:26:32 +1100 Subject: [PATCH 3/3] research: certify the full centre sheaf kernel and primitive integer fibre Record the source-dependent 112-port, 4080-owner kernel result, its sharp proper-subblock and linear-observation consequences, and the primitive fibre limitation. Add strict cross-implementation receipt replay. Preserve all original source bytes and the selected frontier. No native supplier or kappa claim. --- research/centre-sheaf-fibre/PROOF.md | 268 +++++++++++++------ research/centre-sheaf-fibre/README.md | 133 ++++++--- research/centre-sheaf-fibre/RESULT.json | 41 +++ research/centre-sheaf-fibre/TASK.json | 23 +- research/centre-sheaf-fibre/VERIFY.json | 52 +++- research/centre-sheaf-fibre/receipt_check.py | 134 ++++++++++ 6 files changed, 506 insertions(+), 145 deletions(-) create mode 100644 research/centre-sheaf-fibre/RESULT.json create mode 100644 research/centre-sheaf-fibre/receipt_check.py diff --git a/research/centre-sheaf-fibre/PROOF.md b/research/centre-sheaf-fibre/PROOF.md index 2fceac5f32..f676ac48ed 100644 --- a/research/centre-sheaf-fibre/PROOF.md +++ b/research/centre-sheaf-fibre/PROOF.md @@ -1,99 +1,193 @@ -# Local-to-global reduction for a fixed subgroup block +# Exact full kernel on the 4,080-owner block -A general exact lemma, followed by a finite application that must be checked. -All observations are scalar maps over Q. The same conclusions hold over -characteristic-zero extensions. No physical caller or recursive cost is proved. +Clear1nsight, with substantial OpenAI assistance. Apache-2.0. -## Coset elimination +This is a scalar-information theorem for the inherited selected calls-0/4 +observation model. It is not a native programme, physical sharing construction, +recursive tariff, or multiplication theorem. The finite premises below were +reconstructed in fork-hosted CPython 3.12.15 runs at scientific head +`403ef45de40e41baaf8b1f4cfddaf3ba1d57af1c`. The original source archive and +predecessor implementations are unchanged. -Let G contain involutions rho_p and a finite subgroup H. Let r_p be the columns -of a full-row-rank d-by-n rational matrix R. Arrays x(g,p) are supported on H -and extended by zero outside H. Set +## 1. Fixed observation contract - Sx(g) = sum_p r_p x(g,p), - 4Tx(z) = sum_p r_p x(z rho_p,p). +Let R be the selected 8-by-112 rational reader matrix and let rho_p be its +112 involutory owner routes. The complete routes act on 73 binary coordinates; +they preserve a 17-coordinate active space and fix 56 spectators. Computation +on the active block is therefore faithful, not a projection that identifies +otherwise different routes. -Partition ports by H rho_p=H rho_q, equivalent to rho_p rho_q in H. For a class -C and an output z in its coset, only C contributes. If R_C has independent -columns, Tx(z)=0 forces each incoming coordinate to zero. Every source/port -coordinate appears at z=g rho_p, so all coordinates in such classes vanish. +Set a=0, b=6, c=85 and -Suppose the only deficient class is P={a,b,c}, rank two, with the unique -relation r_a-r_b-r_c=0. The source equations force + H = . - x(g,a)=alpha(g), x(g,b)=x(g,c)=-alpha(g). +Arrays x(g,p) are arbitrary rational scalars on H times the 112 ports, and +are extended by zero to all other owners. The two observations are -At z=g rho_a, the later equation is + Sx(g) = sum_p R_p x(g,p), + 4Tx(z) = sum_p R_p x(z rho_p,p). - r_a alpha(g)-r_b alpha(g rho_a rho_b)-r_c alpha(g rho_a rho_c)=0. +Here R_p is a column. Every touched output owner z is retained, including +owners outside H. Dropping those output equations changes the problem. +The inherited source slice and common-frame/constant-payload interpretation +remain assumptions of its physical application. No statement about arbitrary +704-field native states or the complete chronological word follows. -Independence of r_b,r_c forces equality of these three amplitudes. If the two -even route products generate H, alpha is constant. Conversely every constant -works. Hence the full common kernel is Qv, where v equals(1,-1,-1) on P at -every owner of H and is zero on all other ports. This uses every port; absence -of other individual routes from a larger group cannot replace the coset test. +The separately reconstructed finite premises are -## Cellular sheaf +* |H|=4,080 and rank_Q(R)=8. +* R_a-R_b-R_c=0, and these three columns have rank two. +* The right cosets H rho_p partition the ports into the single class + {0,6,85} and 109 singleton classes. Every singleton column is nonzero. +* The undirected compatibility graph on H, with right multiplications by + rho_a rho_b and rho_a rho_c, is connected. It has 8,160 edges and a + certified 4,079-edge spanning tree. -Use the bipartite graph of source owners and touched output owners. Source -vertex stalks are ker R; an output vertex for class C has stalk ker R_C. Each -port edge has stalk Q, with restriction maps given by the corresponding source -and output coordinates. Global sections are exactly ker S intersect ker T. -Independent output stalks vanish and eliminate their incident coordinates. -Remaining triple stalks have dimension one. Normalising by their nonzero -coefficients makes every edge restriction equality. Connectivity therefore -gives a one-dimensional global-section space. No higher-cohomology assertion -about the unreduced sheaf is needed. - -## Information and proper subblocks - -S has rank dh. Thus rank(T restricted to ker S)=(n-d)h-1. If linear additional -observations L permit recovery of T from(S,L), even by a nonlinear decoder, -then ker S intersect ker L is contained in ker T. Consequently L needs at -least(n-d)h-1 scalar coordinates; a linear quotient attains this abstractly. -This does not give a native programme or tariff. - -Any kernel vector on a proper B subset H extends by zero to H, hence is a -multiple of v. Because v is nonzero at every owner, that multiple must be -zero. The proper-subblock requirement is therefore(n-d)|B|. Left translates -of H have the same result, but arbitrary equally sized owner sets do not -follow from it. - -## Primitive integer fibres - -When R is integral, stack S and4T into an integer matrix A. Since v has an -entry one, ker_Z A=Zv. A nonempty nonnegative integer fibre equals - - {n0+t v: t integer, lower<=t<=upper}, - lower=max_{v_i=1}(-n0_i), upper=min_{v_i=-1}(n0_i). - -The single primitive move v in either direction connects every such fibre. -The associated toric ideal is generated by the binomial for v-positive and -v-negative. This is a coefficient-fibre statement, not an operation-scheduling -model. In particular sum(v)=-h, so imposing a fixed total-count row kills the -kernel. Extra resource invariants cannot be silently discarded. - -## Proposed finite application - -PR3071/3147/3656 give n=112,d=8,h=4080. If the full coset certificate passes, -there are456960 variables, old rank32640, common kernel dimension one, and -424319 additional linear observations are necessary and sufficient abstractly. -The move has4080 positive and8160 negative entries. Source-dependent execution -is pending in this draft. Physical phases, payload covariance, acquisition, -chronology, dirty restoration, precision, hosting and a favourable complete -supplier bill remain outside this scalar theorem. - -## References and credit - -Hansen and Ghrist, Toward a spectral theory of cellular sheaves, Journal of -Applied and Computational Topology3 (2019),315-358, DOI10.1007/s41468-019-00038-7. -Diaconis and Sturmfels, Algebraic algorithms for sampling from conditional -distributions, Annals of Statistics26(1) (1998),363-397, DOI10.1214/aos/1030563990. -These established theories motivate the formulation; they do not prove the -source-specific premises. - -Credit Matarener/3656 for the4080-owner subgroup and witness, dcharb78/3147 for -the programme, Ross Richardson/3071 for the observation model and extractor, -Sagar Thakrar/3291 and Sudarsh Chaturvedi/3168 for the corrected graph/census -lineage, and all selected source notices. Clear1nsight with substantial OpenAI -assistance; Apache-2.0. No separate human or formal-kernel acceptance claimed. +The primary certificate checks all 112^2 ordered coset comparisons, using +binary column matrices and rational ranks. The second implementation uses +its own archive parser, forward coefficient propagation, binary row matrices, +left-generated group closure, and nonzero minors modulo 101. Integrality of R +is checked before the modular rank test. A nonzero minor modulo 101 proves +the corresponding rational lower rank; the displayed exact relation gives +the matching upper rank for the triple. + +## 2. Coset elimination theorem + +For involutions, H rho_p=H rho_q exactly when rho_p rho_q belongs to H. +The coordinates contributing to an output z belong to a single such class. +For a class C, an output equation has the form + + R_C (x(z rho_p,p))_{p in C} = 0. + +If R_C has independent columns, all its incoming coordinates vanish. Every +source coordinate x(g,p) appears at the output z=g rho_p, so this eliminates +that entire port class, not just one output sample. + +For the selected H, 109 singleton classes consequently eliminate +109*4,080=444,720 variables. The only possible nonzero coordinates are those +on ports a,b,c. The source equations then force, uniquely at each g, + + (x(g,a),x(g,b),x(g,c)) = alpha(g) (1,-1,-1). + +At z=g rho_a, the remaining output equation is + + R_a alpha(g) + - R_b alpha(g rho_a rho_b) + - R_c alpha(g rho_a rho_c) = 0. + +Independence of R_b and R_c forces all three amplitudes to agree. Connectivity +makes alpha constant on H. Conversely, any constant amplitude satisfies every +source and output equation. Thus, with v equal to (1,-1,-1) on these three +ports at every owner of H and zero elsewhere, + + ker(S) intersect ker(T) = Q v. + +This establishes the FULL 112-port kernel. The predecessor's existence of v +and its single-triple census alone did not establish this equality. Merely +checking which individual routes lie in is insufficient; +the outgoing right-coset comparisons are the essential additional test. + +## 3. Cellular sheaf interpretation + +Take the bipartite graph of source owners and touched output owners, with a +port edge from g to g rho_p. Give source vertices stalk ker(R), an output +vertex in class C stalk ker(R_C), and every edge stalk Q. Restriction maps +are the corresponding coordinate maps. A global section is exactly a choice +of all x(g,p) satisfying both observation equations. + +The independent output stalks are zero. Eliminating their incident coordinates +reduces every remaining source and output stalk to the same one-dimensional +triple relation. Dividing each nonzero restriction by its relation coefficient +makes edge compatibility ordinary equality. The reduced graph is connected, +so its global sections form one copy of Q. + +Equivalently, eliminating output amplitudes leaves the constant sheaf on the +4,080-vertex compatibility graph. Its zeroth cohomology has dimension one. +This is a local-to-global calculation, not a claim that scalar consistency +certifies chronological access, native phases, or a physical implementation. +No assertion about higher cohomology of the unreduced sheaf is needed. + +## 4. Sharp information dimension and proper subblocks + +There are 112*4,080=456,960 scalar variables. S has rank 8*4,080=32,640, hence +its kernel has dimension 424,320. The theorem gives + + rank(T restricted to ker(S)) = 424,319, + rank(stack(S,T)) = 456,959. + +Suppose extra LINEAR observations L allow recovery of all T from (S,L), even +by an otherwise arbitrary nonlinear decoder. Equal (S,L) observations must +give equal T, so ker(S) intersect ker(L) is contained in ker(T). Rank-nullity +on ker(S) therefore requires at least 424,319 additional scalar observations. +A linear quotient of ker(S) by Qv attains that count abstractly. This existence +statement supplies neither an efficient decoder nor a recursive cost. + +For every proper subset B of H, extend a supported common-kernel vector by +zero to H. It must equal t v. Since v is nonzero at every owner of H and B +omits at least one owner, t=0. Therefore all proper subblocks have zero common +kernel and require 104|B| additional linear observations under the same +whole-output contract. The result also holds on left translates of H. +It does not decide equally sized arbitrary owner sets, unions of several +cosets, other triples' subgroups, or the global support minimum. + +## 5. Primitive integer fibres and their limitation + +R is integral. Stack S and 4T into an integer matrix A. Since v has a coordinate +one, every integer vector in its rational kernel is an integer multiple of v. +Thus ker_Z(A)=Zv. Every nonempty nonnegative integer fibre is precisely + + {n0+t v : t is an integer and lower <= t <= upper}, + lower = max_{v_i=1}(-n0_i), + upper = min_{v_i=-1}(n0_i). + +All zero coordinates of v remain fixed. Unit moves by v and -v connect this +interval, so {v} is a Markov basis, with both move directions permitted. +For the polynomial-to-Laurent-monomial map specified by A, the toric ideal +is principal, generated by z^(v+) - z^(v-). Indeed, every integer kernel +relation is t v, and a difference of positive integer powers factors by that +binomial. This is classical rank-one lattice-ideal reasoning. + +The primitive move has 4,080 positive and 8,160 negative unit entries, hence +support 12,240 and sum(v)=-4,080. Adding a fixed total-count row therefore +kills the kernel over Q and Z. More generally, an extra linear resource row +w retains it exactly when w*v=0. This explicitly prevents interpreting an +information-preserving coefficient move as a free legal scheduling move. +No operation-count, ownership, or conservation constraint is silently dropped. +These fibre moves preserve both observations at each move. A physical programme +may temporarily leave the fibre and later restore its outputs; such programmes +are not excluded by this integer statement. + +## 6. Decision, evidence, and credit + +The known witness spans all invisible directions on this fixed block. Its +abstract information saving is exactly one out of 424,320 coordinates, not +an unexplored large family of savings. No recursive child is shown removable. +The decision is NARROW and COMPLETE for this information question. A larger +construction requires a named changed block or consumer, actual returned-state +contract, and a favourable fully charged cost screen before expansion. + +The source-dependent primary and independent implementations passed normally +and under -O on GitHub's fork-hosted Ubuntu 24.04.5 / CPython 3.12.15 runner. +The source archive, both relevant member hashes, query ordering, H=R/4, +faithful active restriction, coset partition, and graph premises were checked. +The independent direct residual calculation checks all 4,080 touched outputs +of v and detects exactly three failures when one owner is removed. Eight +small-group tests cover full matrices, all six nonempty proper subblocks, +512 binary coefficient assignments, signs, routes, and the total-count row. +These are separate same-author implementations, not independent human review. +The committed receipt hook additionally compares typed results and rejects +receipt/JSON mutations. Its final publication replay is recorded on the PR. + +Credit Matarener/#3656 for the subgroup and witness; David Charbonneau/#3147 +for the investigation; Ross Richardson/#3071 for the model and extractor; +Sagar Thakrar/#3291 and Sudarsh Chaturvedi/#3168 for the corrected graph/census +lineage; ywz65 and Aaron Wang/navinor for the observation/centre lineage; and +all original selected-source notices. The earlier circle-elision proposals +are not reopened; #3151 and #3194 retain their distinct obstruction credit. + +The mathematical formulation uses established theory from Jakob Hansen and +Robert Ghrist, Toward a spectral theory of cellular sheaves, Journal of Applied +and Computational Topology 3 (2019), 315-358, DOI 10.1007/s41468-019-00038-7; +and Persi Diaconis and Bernd Sturmfels, Algebraic algorithms for sampling from +conditional distributions, Annals of Statistics 26(1) (1998), 363-397, +DOI 10.1214/aos/1030563990. No literature-wide novelty is claimed. diff --git a/research/centre-sheaf-fibre/README.md b/research/centre-sheaf-fibre/README.md index 307ed48eca..2c8168eee3 100644 --- a/research/centre-sheaf-fibre/README.md +++ b/research/centre-sheaf-fibre/README.md @@ -1,58 +1,109 @@ -# Centre sheaf and primitive integer fibre +# Full centre kernel through sheaves and integer fibres -Draft source-bound investigation of PR3147's centre-sharing lineage, answering -PR3656's full-kernel question on its explicit4080-owner subgroup. This does not -supply a physical shared centre, a recursive tariff, or a new kappa. +A source-bound contribution to the #3147 investigation, answering the fixed +4,080-owner full-kernel question in Matarener's #3656. Clear1nsight, with +substantial OpenAI assistance. Apache-2.0. -## Precise test +## Result -The known triple(0,6,85) gives one common-kernel vector. Group all112 port -routes by right cosets of its even subgroup H. Full-column-rank output classes -force their input coordinates to zero. If the only deficient class is the -known rank-two triple, remaining compatibility forces one constant amplitude -across H. This would prove that the known vector spans the entire common -kernel, even when all112 ports can vary. +For the exact subgroup H generated by the even route products on ports +(0,6,85), the common kernel of the old and routed later observations on ALL +112 ports is exactly one-dimensional. Its sole primitive integer generator +is the already known (1,-1,-1) triple repeated at every owner. What is new is +the full-kernel classification, the sharp information count for this block +and all its proper subblocks, and the primitive integer-fibre description. -The conditional reduction is in PROOF.md. The actual coset certificate must -pass before the application is claimed. The verifier deliberately rejects any -additional deficient class instead of assuming it away. +The local-to-global reduction replaces a 456,960-variable kernel problem with +109 independent outgoing port classes and one connected 4,080-vertex constant +sheaf. It certifies 424,319 additional linear observations as necessary and +sufficient ABSTRACTLY, given the old observations. Every proper subblock of H +still requires 104 observations per owner. Arbitrary equally sized owner sets +are outside this theorem. -## Verification boundary +The integer fibre is a one-parameter interval connected by one primitive move. +That move touches 12,240 coefficients and changes their sum by -4,080. An +additional fixed-count constraint destroys it. Thus algebraic statistics does +not turn this information identity into a free physical schedule. -Eight generic tests passed normally and with -O under local CPython3.13.5. -They compare an independently assembled full matrix on a noncommutative small -group, every proper support subset, and all binary nonnegative fibre points. -They are not a substitute for the actual selected geometry. +See PROOF.md for the full hypotheses and argument, and RESULT.json for the +exact certificate. No scalar information count is called a recursive tariff. -The container cannot fetch the selected archive. Source-dependent execution is -registered for the repository's existing Python3.12 workflow. No successful -source-dependent execution is claimed in this draft. +## Evidence and reproduction + +The unmodified mathematical kernels at head +403ef45de40e41baaf8b1f4cfddaf3ba1d57af1c passed the actual registered workflow on +Ubuntu 24.04.5 / CPython 3.12.15, including normal and optimised source-dependent +primary and independent replays, all eight generic tests, and unchanged input +checks. The run is +https://github.com/Clear1nsight/integer-mult-bounds/actions/runs/39165978787 . +The scientific head and its synthetic PR-merge checkout are distinguished in +the run logs. Later publication checks are recorded on the fork PR. + +The primary reuses the pinned PR3071 reverse-covector source extractor and +uses rational elimination and binary column products. The second imports no +primary or predecessor executable, parses the archive itself, propagates +coefficients forward, uses binary row products and modular minors, and directly +checks all routed witness residuals. Both reconstruct identical geometry with +SHA256 79515573d8231a59ece664a2ec421983989c9925e1ccab1ca4c71c7cfa3ea2be. + +From a repository checkout with the two pinned inputs present, run ```sh -python3.12 -B scripts/research_package.py --package research/centre-sheaf-fibre +python3.12 -I -B scripts/research_package.py --package research/centre-sheaf-fibre ``` -`verify.py --emit-geometry` exports derived rational columns and binary routes -after source authentication. `--geometry FILE` is explicitly arithmetic-only. -Default commands preserve inputs. No predecessor heavy census is run. +The registered hook runs the eight small-group tests normally and under -O, +then two fresh-source implementations and committed typed-receipt checks in +both modes. It uses only the standard library. Direct source-dependent replay +is also available through `receipt_check.py`. The explicit `--controls-only` +option tests JSON/receipt fixtures and does NOT claim source verification. + +The direct primary and independent `--geometry` paths accept an explicitly +labelled derived export; they do not pretend to re-extract the archive. The +registered committed-receipt hook requires both actual archive paths instead. + +## Scope and stopping decision + +This is an exact rational scalar theorem under the inherited selected calls-0/4 +observation contract, not a native payload or full chronological programme. +Physical frames, acquisition, dirty-state restoration, precision, ownership, +hosting, and the complete supplier invoice remain unproved here. No paid child +is deleted and the selected frontier is unchanged. No human or formal proof +kernel has independently accepted this theorem. The two implementations share +the same archived mathematical source and author. + +Decision NARROW / COMPLETE. The full kernel on this H is settled, so another +search for more directions inside the same block is not justified. Any new +physical investigation needs a changed contract and a complete cost gate. ## Open next questions -TASK.json records the exact dimension test and later physical-contract question. -Stop after a useful source-bound result. Information dimension is not a native -child rank, paid storage quantity, or permission to discard borrowed state. +1. Can a union of distinct H cosets introduce additional dependent outgoing + classes and a materially larger kernel? First prove a changed coset + incidence and compute its compatibility rank. Do not infer it from this + one-block result, or count a scalar coordinate as a saved child. +2. Does a named downstream consumer permit a weaker observation than the + whole later-query field? State every required output, allowed source read, + and restoration condition before constructing a quotient. +3. Can a useful integer move preserve the actual resource rows of such a + caller? First specify those rows and test w*v=0. The fixed-count row fails + for the present move, so no scheduling claim is made. -## Credit +## Provenance, overlap, and publication status -Matarener/PR3656 supplies the actual subgroup and witness. David Charbonneau/ -dcharb78/PR3147 supplies the dependent-column and route programme. Ross -Richardson/PR3071 supplies the observation model and authenticated extractor -reused unchanged. Sagar Thakrar/PR3291 supplies the corrected small-block floor; -Sudarsh Chaturvedi/PR3168 supplies separate route checks. Aaron Wang/navinor/ -PR2391, ywz65, and the retained selected geometry/compiler lineage keep credit. +Canonical scientific base 20ecf2891d80b5acf18d980b2164fb44ea7faa90, priority +revision 6. Both live input pins are ancestral. Frozen sources are untouched. +Relevant current PRs were read and targeted searches performed; complete +Discussion and arbitrary-diff coverage is not established. Upstream claim and +PR writes were rejected by the connected integration with HTTP 403. The public +fork contribution is https://github.com/Clear1nsight/integer-mult-bounds/pull/1 . +It is not an upstream submission. Neither upstream nor fork main was changed. -Sheaf and integer-fibre methods are classical, not invented here. Prepared by -Clear1nsight with substantial OpenAI assistance. No separate agent, independent -human, proof-kernel or full multiplication verification is claimed. Apache-2.0. -Existing sources and frontier are unchanged. The upstream coordination-comment -attempt received HTTP403 and is not a published reservation. +Matarener/#3656 retains subgroup/witness credit; dcharb78/#3147 retains the +research question; Ross Richardson/#3071 retains the observation model and +extractor; Sagar Thakrar/#3291 and Sudarsh Chaturvedi/#3168 retain their corrected +graph/census work. Credit ywz65, Aaron Wang/navinor, and the retained selected +native, geometry, and compiler lineage. #3151/#3194's circle obstructions are +not repeated as new. Hansen/Ghrist and Diaconis/Sturmfels retain classical +sheaf and Markov-basis credit. Full references and qualifications are in +PROOF.md. No separate agent, human, or formal-kernel review is claimed. diff --git a/research/centre-sheaf-fibre/RESULT.json b/research/centre-sheaf-fibre/RESULT.json new file mode 100644 index 0000000000..b7a0c92d96 --- /dev/null +++ b/research/centre-sheaf-fibre/RESULT.json @@ -0,0 +1,41 @@ +{ + "active_dimension": 17, + "additional_linear_observations_required": 424319, + "class_size_histogram": { + "1": 109, + "3": 1 + }, + "compatibility_edges": 8160, + "compatibility_vertices": 4080, + "constant_count_constraint_kills_kernel": true, + "deficient_coset_classes": [ + { + "ports": [ + 0, + 6, + 85 + ], + "rank": 2 + } + ], + "full_joint_kernel_dimension": 1, + "full_variables": 456960, + "geometry_sha256": "79515573d8231a59ece664a2ec421983989c9925e1ccab1ca4c71c7cfa3ea2be", + "independent_dropped_owner_nonzero_outputs": 3, + "independent_nonzero_later_residuals": 0, + "independent_old_rank_mod101": 8, + "old_kernel_dimension": 424320, + "old_rank": 32640, + "owners": 4080, + "ports": 112, + "primitive_move_negative_entries": 8160, + "primitive_move_positive_entries": 4080, + "primitive_move_support": 12240, + "right_coset_class_count": 110, + "right_coset_classes_sha256": "af7b54230d4fd047858c9c6879fdf0d39249d725a61823a84fff8d6a73e982d3", + "schema_version": 1, + "spanning_tree_edges": 4079, + "spanning_tree_sha256": "0e821c4c81b3ae01dcee422e4c70e1ece3dbae908ae7ee9b8f77f82ef643e400", + "status": "PASS_CENTRE_SHEAF_COMMITTED_RECEIPT", + "subgroup_sha256": "edded9e0dcd065d7dfb9a5ece868f1777f9030ae14e3ea0adea060bccba90cc0" +} diff --git a/research/centre-sheaf-fibre/TASK.json b/research/centre-sheaf-fibre/TASK.json index 81213aa8ee..442f3620d8 100644 --- a/research/centre-sheaf-fibre/TASK.json +++ b/research/centre-sheaf-fibre/TASK.json @@ -17,19 +17,20 @@ "overlap_terms": ["centre path", "copied totals", "private temporary", "shared centre", "batching"] }, "scope_status": "changed", - "actual_scope": "User-assigned sheaf and integer-fibre approach to PR3147, refined to the complete112-port common observation kernel on PR3656's4080-owner subgroup. Test exact coset elimination and global compatibility before claiming a dimension.", - "scope_change_reason": "The simple circle route already has PR3151 and PR3194 obstructions. PR3656 supplies a concrete common-kernel witness but leaves its full kernel dimension open. This closes a different information obligation rather than repeating a circle cancellation or the single-triple census.", - "bottleneck_link": "Determines whether the first concrete large block has useful hidden information capacity or only its known one-dimensional perturbation. Information coordinates are not recursive tariffs.", + "actual_scope": "User-assigned sheaf and integer-fibre continuation of PR3147, proving the full 112-port common kernel on PR3656's fixed 4080-owner subgroup, its proper-subblock observation dimension, and primitive integer fibres.", + "scope_change_reason": "PR3151 and PR3194 already constrain simple circle elision. PR3656 supplies the explicit subgroup and one witness but leaves the full kernel open. Coset elimination and sheaf compatibility close that different information obligation.", + "bottleneck_link": "The full block has exactly one invisible direction, not hidden additional sharing capacity. The theorem prevents counting a coefficient-fibre identity as a free physical or recursive operation.", "budget_minutes": null, - "stop_rule": "Stop after one complete source-bound local-to-global kernel certificate or a counterexample to the proposed reduction. No physical supplier expansion without a changed favourable full boundary and cost ledger.", - "outcome": "partial", - "evidence": "Eight generic finite-group, matrix and nonnegative-fibre control tests pass normally and with -O on local CPython3.13.5. Actual archive-dependent subgroup and coset reduction await execution; draft status until verified.", + "stop_rule": "Complete the fixed-block kernel theorem and source certificates. Do not expand into new blocks or physical construction without a changed contract and favourable fully charged cost gate.", + "outcome": "completed", + "evidence": "At scientific head 403ef45de40e41baaf8b1f4cfddaf3ba1d57af1c, fork workflow39165978787 completed both archive-dependent implementations normally and under -O, eight generic tests, and unchanged-input checks on Ubuntu24.04.5/CPython3.12.15. It certified110 coset classes (109 singletons and one rank-two triple), graph rank4079, full common kernel dimension1, and424319 additional observations. Publication adds RESULT.json and fresh typed receipt comparison; final exact-head replay is recorded on the PR.", "author": "Clear1nsight", - "ai_assistance": "Substantial OpenAI assistance in proof, implementation, tests and writing. No separate agent, independent human or proof-kernel review is claimed.", + "ai_assistance": "Substantial OpenAI assistance in proof, both implementations, tests and writing. Separate code paths share the author and archived source; no separate agent, independent human, or formal-kernel acceptance claimed.", "open_questions": [ - {"question": "Does exact outgoing-coset elimination reduce all112 ports on the named block to the known triple?", "why_it_matters": "It decides the full common-kernel dimension without an enormous dense matrix.", "first_step": "Run the authenticated source extractor and finite coset/rank certificate, then independently verify the derived geometry.", "blocked_by": "Archive-dependent execution not yet completed."}, - {"question": "Can a different owner block or output contract yield an affordable physical sharing mechanism?", "why_it_matters": "A scalar kernel does not remove a paid recursive call.", "first_step": "Specify the actual source and return interfaces, chronology and all cost allowances before expanding search.", "blocked_by": "No native acquisition, restoration, hosting or complete supplier bill is supplied."} + {"question": "Can a union of distinct H cosets give a materially larger kernel?", "why_it_matters": "The same single block has no further directions; an enlarged incidence is a genuinely changed premise.", "first_step": "Specify the union, partition its outgoing classes, and compute all compatibility ranks before any physical search.", "blocked_by": "A new incidence theorem and a favourable complete cost gate are absent."}, + {"question": "Does an actual consumer permit a weaker observation than the whole later-query field?", "why_it_matters": "This changes the information contract behind the sharp lower count.", "first_step": "Name all required outputs, source reads, and dirty-state restoration conditions.", "blocked_by": "No qualifying physical caller is supplied."}, + {"question": "Can a useful primitive move preserve the actual resource rows of a changed caller?", "why_it_matters": "The present move changes total count by -4080, so fibre connectivity is not a scheduling certificate.", "first_step": "Specify the resource rows w and test w*v=0 before constructing transitions.", "blocked_by": "No operation-count, ownership, or chronological resource model is supplied."} ], - "coordination": {"assigned_pr": 3147, "specific_predecessor_pr": 3656, "specific_predecessor_head": "69e745992b966c647e10696b980cb4c96d7ebeed", "entry_canonical_main": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", "overlap": "Targeted live PR searches for sheaf, centre, kernel and the named predecessors; current PR3656 had no comments. Not a complete Discussion or arbitrary-diff census.", "claim_attempt": "Upstream PR3656 claim comment rejected by integration with HTTP403. Not published.", "environment": "Container DNS unavailable; no local repository/selected archive. Fork branch is writable. Registered source-dependent CI, if available, will be distinguished from local generic tests."}, - "family_gate": {"decision": "narrow", "reason": "One bounded information theorem and primitive fibre result only; no numerical saving, no full supplier or selected-frontier change."} + "coordination": {"assigned_pr": 3147, "specific_predecessor_pr": 3656, "specific_predecessor_head": "69e745992b966c647e10696b980cb4c96d7ebeed", "canonical_main": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", "fork_pr": "https://github.com/Clear1nsight/integer-mult-bounds/pull/1", "overlap": "Relevant live PRs and targeted sheaf/centre/kernel/4080 searches were read. Not a complete Discussion or arbitrary-diff census. The submission checkpoint's4080-title search found only PR3656.", "upstream_write_status": "Claim comment and upstream PR creation rejected by integration with HTTP403; not published upstream.", "environment": "Local container DNS unavailable, so the binary archive was not replayed locally. Actual archive-dependent verification ran in fork-hosted registered CI. Local receipt controls used CPython3.13.5."}, + "family_gate": {"decision": "narrow", "status": "fixed-block result completed; no further reservation", "reason": "Exactly one information coordinate out of424320 is eliminated abstractly. No recursive child deletion, physical caller, favourable supplier bill, or frontier change is established."} } diff --git a/research/centre-sheaf-fibre/VERIFY.json b/research/centre-sheaf-fibre/VERIFY.json index 192d030d62..8ab634f66c 100644 --- a/research/centre-sheaf-fibre/VERIFY.json +++ b/research/centre-sheaf-fibre/VERIFY.json @@ -3,12 +3,52 @@ "status": "ready", "python": "3.12", "requirements": [], - "inputs": ["research/centre-block-repair-information/independent.py", "research/community-frontier1094-audit/selected-replay.tar.gz"], + "inputs": [ + "research/centre-block-repair-information/independent.py", + "research/community-frontier1094-audit/selected-replay.tar.gz" + ], "commands": [ - {"argv": ["{python}", "-I", "-B", "{package}/test_sheaf.py"], "timeout_seconds": 60, "checks": "Independent small matrix, proper-subblock and bounded nonnegative-fibre controls; not actual physical semantics."}, - {"argv": ["{python}", "-I", "-B", "{package}/verify.py", "--emit-geometry"], "timeout_seconds": 300, "checks": "Authenticate original selected archive and credited source extractor, test all112 ports and emit derived geometry."}, - {"argv": ["{python}", "-I", "-O", "-B", "{package}/verify.py"], "timeout_seconds": 300, "checks": "Repeat source-bound primary guards under optimization."}, - {"argv": ["{python}", "-I", "-B", "{package}/independent.py"], "timeout_seconds": 120, "checks": "Separate raw-archive parser, sparse forward coefficient propagation, row-matrix routes, left group closure, modular minors and direct routed residuals."}, - {"argv": ["{python}", "-I", "-O", "-B", "{package}/independent.py"], "timeout_seconds": 120, "checks": "Repeat the independent source and algebra audit with explicit checks under optimization."} + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/test_sheaf.py" + ], + "timeout_seconds": 60, + "checks": "Eight generic full-matrix, proper-subblock and integer-fibre controls; not native semantics." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "-O", + "{package}/test_sheaf.py" + ], + "timeout_seconds": 60, + "checks": "Eight generic full-matrix, proper-subblock and integer-fibre controls; not native semantics." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/receipt_check.py" + ], + "timeout_seconds": 300, + "checks": "Both independently parsed source certificates, typed committed-result equality and eight JSON/receipt rejection controls." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "-O", + "{package}/receipt_check.py" + ], + "timeout_seconds": 300, + "checks": "Both independently parsed source certificates, typed committed-result equality and eight JSON/receipt rejection controls." + } ] } diff --git a/research/centre-sheaf-fibre/receipt_check.py b/research/centre-sheaf-fibre/receipt_check.py new file mode 100644 index 0000000000..895bd3eb85 --- /dev/null +++ b/research/centre-sheaf-fibre/receipt_check.py @@ -0,0 +1,134 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Compare separately reconstructed source certificates to the committed result. + +Clear1nsight, substantial OpenAI assistance. No native or supplier admission. +""" +from __future__ import annotations +import argparse +from copy import deepcopy +from hashlib import sha256 +import json +from pathlib import Path +import subprocess +import sys + +HERE = Path(__file__).resolve().parent + + +def need(ok, reason): + if not ok: + raise ValueError(reason) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":"), allow_nan=False).encode() + + +def unique(pairs): + value = {} + for key, item in pairs: + need(key not in value, "duplicate JSON key") + value[key] = item + return value + + +def parse(text): + return json.loads(text, object_pairs_hook=unique, + parse_constant=lambda value: (_ for _ in ()).throw(ValueError("nonfinite JSON"))) + + +def strict_equal(left, right): + need(canonical(left) == canonical(right), "typed scientific receipt differs") + + +def execute(script, prefix): + command = [sys.executable, "-I", "-B"] + if sys.flags.optimize: + command.append("-O") + command.append(str(HERE / script)) + run = subprocess.run(command, check=True, capture_output=True, text=True, timeout=120) + rows = [line[len(prefix):] for line in run.stdout.splitlines() if line.startswith(prefix)] + need(len(rows) == 1, "one substantive result from " + script) + return parse(rows[0]) + + +def project(primary, other): + need(primary["source_mode"] == "authenticated archive and credited PR3071 extractor", "primary archive mode") + need(other["source_mode"] == "independently parsed pinned archive", "independent archive mode") + need(other["status"] == "PASS_INDEPENDENT_CENTRE_SHEAF", "independent pass marker") + need(primary["status"] == "PASS_CENTRE_SHEAF_FIBRE", "primary pass marker") + strict_equal(other["right_coset_classes"], [row["ports"] for row in primary["right_coset_classes"]]) + for key in ("owners", "geometry_sha256", "class_size_histogram"): + strict_equal(primary[key], other[key]) + need(primary["old_rank"] == other["old_rank_mod101"] * other["owners"], "old-rank agreement") + need(primary["full_joint_kernel_dimension"] == other["joint_kernel_dimension"], "kernel agreement") + need(primary["additional_linear_observations_required"] == other["additional_linear_observations"], "observation agreement") + need(primary["spanning_tree_edges"] == other["compatibility_rank"], "graph-rank agreement") + keys = ("owners", "ports", "active_dimension", "full_variables", "old_rank", "old_kernel_dimension", + "full_joint_kernel_dimension", "additional_linear_observations_required", "class_size_histogram", + "deficient_coset_classes", "compatibility_vertices", "compatibility_edges", "spanning_tree_edges", + "spanning_tree_sha256", "subgroup_sha256", "geometry_sha256", "primitive_move_positive_entries", + "primitive_move_negative_entries", "primitive_move_support", "constant_count_constraint_kills_kernel") + result = {key: primary[key] for key in keys} + result.update(schema_version=1, status="PASS_CENTRE_SHEAF_COMMITTED_RECEIPT", + right_coset_classes_sha256=sha256(canonical(primary["right_coset_classes"])).hexdigest(), + right_coset_class_count=len(primary["right_coset_classes"]), + independent_old_rank_mod101=other["old_rank_mod101"], + independent_nonzero_later_residuals=other["nonzero_later_residuals"], + independent_dropped_owner_nonzero_outputs=other["dropped_owner_nonzero_outputs"]) + return result + + +def controls(reference): + strict_equal(reference, deepcopy(reference)) + variants = [] + for field, value in (("full_joint_kernel_dimension", True), ("owners", 4079), + ("additional_linear_observations_required", 424318), + ("constant_count_constraint_kills_kernel", 1), + ("independent_dropped_owner_nonzero_outputs", 0)): + mutant = deepcopy(reference) + mutant[field] = value + variants.append(mutant) + mutant = deepcopy(reference) + mutant["class_size_histogram"]["1"] = 108 + variants.append(mutant) + for mutant in variants: + try: + strict_equal(reference, mutant) + except ValueError: + pass + else: + raise ValueError("receipt mutant was accepted") + for text in ('{"a":1,"a":1}', '{"a":NaN}'): + try: + parse(text) + except ValueError: + pass + else: + raise ValueError("malformed JSON accepted") + return len(variants) + 2 + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--controls-only", action="store_true", help="Typed fixture checks only; no source replay") + args = parser.parse_args() + path = HERE / "RESULT.json" + need(path.is_file() and not path.is_symlink(), "regular committed result") + reference = parse(path.read_text()) + count = controls(reference) + if args.controls_only: + print("PASS_GENERIC_TYPED_RECEIPT_CONTROLS", count, "source_replay=false") + return + primary = execute("verify.py", "RESULT_JSON=") + other = execute("independent.py", "INDEPENDENT_JSON=") + actual = project(primary, other) + strict_equal(actual, reference) + print("RESULT_JSON=" + canonical(actual).decode()) + print("PASS_CENTRE_SHEAF_COMMITTED_RECEIPT", "controls=" + str(count), + "optimised=" + str(bool(sys.flags.optimize)), "sha256=" + sha256(canonical(actual)).hexdigest()) + + +if __name__ == "__main__": + main()