diff --git a/research/opcode1-y-exit-chart-image/PROOF.md b/research/opcode1-y-exit-chart-image/PROOF.md new file mode 100644 index 0000000000..a1f5f0b821 --- /dev/null +++ b/research/opcode1-y-exit-chart-image/PROOF.md @@ -0,0 +1,144 @@ +# Opcode 1's dimension-8 images of the Y exits + +This is an exhaustive finite census on one recorded alphabet. The selected +value stays `363005817/100000000000`. A chart-image hit is not a warp event +in the word, not a paid-moment change, and not a new κ. + +The word is the pinned round-three centre word +`research/sol1337-contact-frontier/inputs/round3-native.json.gz`, SHA-256 +`7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05`, the same +bytes `retained_verify.SOURCE_HASH` names. Cao Yifan / intqwq, PR #4610, is +the source of the word. The span operation is `model.span` from the +contact-graph model. The question is the first open question of PR #7219: +which dimension-8 charts opcode 1 carries a Y-exit chart onto. PR #7219 +proves that the image has dimension 8, and stops before naming the chart. + +## Hypotheses + +The ambient space is `GF(2)^9`. Opcode 1 is the first record of +`canonical["warps"]`. Its columns are + +```text +(1, 2, 4, 8, 64, 19, 104, 197, 325). +``` + +The map is `G(x) = xor of column i over each bit i set in x`. The native +chart-image law admits an ordered pair of charts `(A, B)` for this opcode +only when `span(G(basis of A)) = span(basis of B)`. + +The Y-exit charts are `final[112]` through `final[223]`. On this word those +112 values are the frames `142` through `253`, in that role order, and each +basis is independent of length 8. Frame 1 is the unique dimension-9 chart, +and each Y-exit span sits strictly inside it. + +A recorded chart can equal a dimension-8 image only if its own basis has +length 8. There are 4429 recorded frames, and 162 of them have basis length +8. Those 162 spans are pairwise distinct, so each image subspace equals at +most one of them. + +## Dimension + +`G` is additive and sends the 512 vectors of `GF(2)^9` to 512 distinct +images, so `G` is a linear automorphism. The image of an independent set of +size 8 is independent of size 8: a linear dependence among the images would +pull back, under `G^{-1}`, to a dependence among the inputs. Every Y-exit +image therefore has dimension 8, and none of them is frame 1. + +## The census + +The domain is the 112 Y-exit charts. For each one the checker builds +`span(G(basis))` with `model.span` and compares that set with the 162 +dimension-8 spans. The comparison is exhaustive: every source and every +dimension-8 chart is visited, and no other recorded chart has a +dimension-8 span. The classes below are a partition of the 112 roles. + +Four images equal the source chart itself. + +```text +certificate fixed role=129 source=159 +certificate fixed role=189 source=219 +certificate fixed role=208 source=238 +certificate fixed role=209 source=239 +``` + +Twenty-four images equal a different Y-exit chart. The destination role is +`destination frame - 30`, because Y-exit frame `142 + t` belongs to role +`112 + t`. + +```text +certificate y-to-y role=116 source=146 dest=147 +certificate y-to-y role=117 source=147 dest=146 +certificate y-to-y role=119 source=149 dest=228 +certificate y-to-y role=137 source=167 dest=224 +certificate y-to-y role=144 source=174 dest=173 +certificate y-to-y role=164 source=194 dest=192 +certificate y-to-y role=165 source=195 dest=191 +certificate y-to-y role=166 source=196 dest=195 +certificate y-to-y role=167 source=197 dest=194 +certificate y-to-y role=171 source=201 dest=207 +certificate y-to-y role=172 source=202 dest=206 +certificate y-to-y role=185 source=215 dest=210 +certificate y-to-y role=186 source=216 dest=211 +certificate y-to-y role=187 source=217 dest=214 +certificate y-to-y role=188 source=218 dest=217 +certificate y-to-y role=192 source=222 dest=167 +certificate y-to-y role=198 source=228 dest=151 +certificate y-to-y role=206 source=236 dest=235 +certificate y-to-y role=207 source=237 dest=236 +certificate y-to-y role=210 source=240 dest=242 +certificate y-to-y role=220 source=250 dest=248 +certificate y-to-y role=221 source=251 dest=247 +certificate y-to-y role=222 source=252 dest=251 +certificate y-to-y role=223 source=253 dest=250 +``` + +Eleven images equal a recorded dimension-8 chart that is not a Y exit. +None of those eleven frames occurs in `start` or `final`. + +```text +certificate non-y role=124 source=154 dest=3445 +certificate non-y role=125 source=155 dest=3438 +certificate non-y role=128 source=158 dest=624 +certificate non-y role=147 source=177 dest=3453 +certificate non-y role=156 source=186 dest=281 +certificate non-y role=168 source=198 dest=3450 +certificate non-y role=202 source=232 dest=4425 +certificate non-y role=203 source=233 dest=4427 +certificate non-y role=213 source=243 dest=4377 +certificate non-y role=214 source=244 dest=4381 +certificate non-y role=219 source=249 dest=3449 +``` + +The other 73 images are dimension-8 subspaces that equal none of the 162 +recorded dimension-8 spans. Role 112, frame 142, is in this class: its image +equals none of the 112 Y-exit spans and none of the 162 recorded +dimension-8 spans. + +```text +certificate unrecorded count=73 +``` + +Two of the Y-to-Y rows are mutual. Opcode 1 carries frame 146 onto frame 147 +and frame 147 onto frame 146. It likewise exchanges frames 235 and 236. +The other Y-to-Y rows are not mutual. Frame 149 goes to frame 228, and frame +228 goes to frame 151. + +## What the census does not say + +The chart-image law admits the 4 + 24 + 11 ordered pairs above for opcode 1. +Admitting a pair does not insert a warp into the recorded program, does not +delete a transport, and does not change a paid histogram. The 73 misses say +only that opcode 1 does not carry that Y exit onto a recorded dimension-8 +chart. They do not say that some other retained opcode misses it, and they +do not say that the inverse opcode `-1` misses it. + +The selected frontier stays `363005817/100000000000`. + +## Open next questions + +1. Does any of the 24 Y-to-Y chart images occur as a warp event that leaves + the paid transport count unchanged? The first step is the mutual pair of + frames 146 and 147. Nothing in this census edits the word. +2. Which of these 112 charts does the inverse opcode `-1` carry onto a + recorded dimension-8 chart? The inverse is a different signed map. This + census does not evaluate it. diff --git a/research/opcode1-y-exit-chart-image/README.md b/research/opcode1-y-exit-chart-image/README.md new file mode 100644 index 0000000000..52a0a1fab1 --- /dev/null +++ b/research/opcode1-y-exit-chart-image/README.md @@ -0,0 +1,87 @@ +# Opcode 1's dimension-8 images of the Y exits + +**Exhaustive finite census on one recorded opcode. The selected κ stays +`363005817/100000000000`.** + +On the pinned round-three centre word, opcode 1 is the linear automorphism +with columns `(1, 2, 4, 8, 64, 19, 104, 197, 325)`. The 112 Y-exit charts are +frames 142 through 253. Each image under opcode 1 has dimension 8. Comparing +those images with all 162 recorded dimension-8 charts gives a partition: + +- 4 images equal the source chart. +- 24 images equal a different Y-exit chart. +- 11 images equal a recorded dimension-8 chart that is not a Y exit and is + not a role start or final chart. +- 73 images, including role 112's frame 142, equal no recorded dimension-8 + chart. + +The pairs are the certificate lines in [PROOF.md](PROOF.md). The checker +recomputes the spans and accepts the certificate only when the two agree. +A chart-image hit is not an emitted warp and not a paid-moment change. + +## Scope and evidence + +Catalogue card `complex-rank-shape-decoder`, priority revision 8, base +commit `e54523517d0f03e58352e647c403a5af3e525a57`. Scope status: +**changed**. The card asks whether a decoder or coframe change improves the +full signed moment. This package does not build that decoder and does not +price an itinerary. It answers the first open question of PR #7219, which +PR #7219 leaves unrun after proving that opcode 1 preserves dimension. +The reason is in [TASK.json](TASK.json). + +Evidence class: an exhaustive finite census. The domain is the 112 Y-exit +charts and the 162 recorded dimension-8 charts. Both sets are finite, both +are visited, and a recorded chart of any other dimension has a span of a +different size, so it cannot equal an 8-dimensional image. This is not a +heuristic search and not a proof about any other warp alphabet. + +Source pins are in [SOURCES.json](SOURCES.json). The catalogue and selected +record are provenance at the base commit. Full Git history is needed to +resolve them. The word, the contact-graph model, and the retained emitter +are live inputs. + +## Reproduce + +Python 3.12, standard library, from the repository root: + +```sh +python3 -B research/opcode1-y-exit-chart-image/verify.py +python3 -O -B research/opcode1-y-exit-chart-image/verify.py +python3 -I -W error -B research/opcode1-y-exit-chart-image/verify.py +python3 -B scripts/research_package.py --package research/opcode1-y-exit-chart-image --check-only +python3 -B scripts/research_package.py --package research/opcode1-y-exit-chart-image +``` + +The marker is `PASS_OPCODE1_Y_EXIT_CHART_IMAGE` with `y_exits=112`, +`recorded_dim8_charts=162`, `fixed=4`, `y_to_y=24`, `non_y=11`, +`unrecorded=73`, and `role112_chart=142`. + +The positive fixture is the mutual pair of frames 146 and 147. Controls +reject a zeroed column of opcode 1, a 111-exit sample as a stand-in for the +census, the claim that role 112 lands on frame 143, and the claim that +frame 146 is fixed. Not run: `model.build` on the full contact graph, the +inverse opcode `-1`, a physical caller, Lean, Docker, and +`make frontier7000-verify`. `scripts/research_selected_baseline.py` is a +binding check only. + +## Open next questions + +1. Does any of the 24 Y-to-Y chart images occur as a warp event that leaves + the paid transport count unchanged? A hit of the chart-image law is not + yet a walk. The first step is the mutual pair of frames 146 and 147. + Nothing in this census edits the word, so the paid moment is untouched. +2. Which of these 112 charts does the inverse opcode `-1` carry onto a + recorded dimension-8 chart? The inverse is a different signed map, and + this census does not evaluate it. + +## Credit + +The word is Cao Yifan / intqwq, PR #4610. The span and the chart-image law +are the contact-graph model, which credits PR #4672, PR #4654, PR #4610, and +the PR #4470 lineage. The Y-exit indexing follows +`research/y-exit-rank-lift-obstruction`, which credits discussion #1166 +comment 19133861, Chris R / Clear1nsight. The question is the first open +question of PR #7219, whose dimension lemma is the predecessor and is not +reopened here. Prepared by unpaidmoon with substantial Cursor Grok +assistance. Apache-2.0. No independent human review or proof-kernel check +is claimed. diff --git a/research/opcode1-y-exit-chart-image/SOURCES.json b/research/opcode1-y-exit-chart-image/SOURCES.json new file mode 100644 index 0000000000..2a6df87248 --- /dev/null +++ b/research/opcode1-y-exit-chart-image/SOURCES.json @@ -0,0 +1,36 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "research/sol1337-contact-frontier/inputs/round3-native.json.gz", + "usage": "input", + "git_blob": "46d929df83817b85a5387bcdb9745e0627d6366e", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05" + }, + { + "path": "research/sol1337-contact-frontier/vendor/model.py", + "usage": "input", + "git_blob": "a69138e4014424235345f3301fbe6b097caa1b8c", + "sha256": "7cc29edccb3679b2a5c9defeeb0a2ec6bcef9b01b97c2390bebc48f366395f1f" + }, + { + "path": "research/sol1337-contact-frontier/vendor/retained_verify.py", + "usage": "input", + "git_blob": "357cbff9874ce920c5b5ad839fd47d3f9c728bcb", + "sha256": "f5a67954f19dddc688460b91e5c1729d7820755c53313159ed136e4447021214" + } + ] +} diff --git a/research/opcode1-y-exit-chart-image/TASK.json b/research/opcode1-y-exit-chart-image/TASK.json new file mode 100644 index 0000000000..84394a6fca --- /dev/null +++ b/research/opcode1-y-exit-chart-image/TASK.json @@ -0,0 +1,81 @@ +{ + "schema_version": 1, + "task_id": "complex-rank-shape-decoder", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "complex-rank-shape-decoder", + "question": "Can a legal decoder or coframe change improve the full signed moment, including changed helper targets?", + "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", + "docs/research/recursive-invoice-preflight.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "A source-bound arbitrary-input identity and legal producer/consumer boundary with the complete paid and productive target invoice, including restoration, ownership, native alignment and extra charges. Price under the actual current model; historical ceiling.py assumptions must be established before use. A favorable optimistic relaxation keeps a route open but is not a completed supplier. A scoped local result remains useful; expansion requires the family-level budget gate.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Price one complete changed itinerary with both paid and productive histograms. Check #5693/#5698 for overlap and their exact hypotheses before another coframe search. Use the signed invoice preflight where its boundary contract agrees; an inconclusive concave comparison is not a power crossing. Stop if an optimistic complete budget fails at the chosen target or native delivery remains unspecified.", + "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": [ + "coframe", + "signed moment", + "5693", + "5698" + ], + "existing_checks": [ + { + "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": "On the pinned round-three centre word, classify the image of each of the 112 dimension-8 Y-exit charts under opcode 1 against the 162 recorded dimension-8 charts. The census is a partition into 4 fixed charts, 24 other Y-exit charts, 11 non-exit dimension-8 charts, and 73 unrecorded subspaces. No warp is inserted and no new kappa is claimed.", + "scope_change_reason": "The card asks for one priced itinerary and says to stop when its optimistic budget fails. PR #7219 already shows that opcode 1 preserves dimension, and its first open question is which dimension-8 chart the image equals. That identity is the missing hypothesis before any same-dimension Y-exit relocation could be priced. This package answers that question and does not search the #5698 binary coframe class or emit a word.", + "bottleneck_link": "A same-dimension relocation of a Y exit by opcode 1 would be unpaid only if the chart-image law admits the destination. The census names the 24 Y-exit destinations and the 73 misses. It does not produce a signed bill, so the selected exponent stays 363005817/100000000000.", + "budget_minutes": 60, + "stop_rule": "Stop after the 112-by-162 span comparison and its failure controls. Do not insert a warp, price a transport, or evaluate opcode -1.", + "outcome": "completed", + "evidence": "python3 -B research/opcode1-y-exit-chart-image/verify.py prints PASS_OPCODE1_Y_EXIT_CHART_IMAGE with fixed=4 y_to_y=24 non_y=11 unrecorded=73. PROOF.md holds the certificate lines that the checker recomputes.", + "author": "unpaidmoon", + "ai_assistance": "Cursor Grok wrote the census, the certificate, and the checker. The word, the span, and the Y-exit indexing are predecessor source.", + "open_questions": [ + { + "question": "Does any of the 24 Y-to-Y chart images occur as a warp event that leaves the paid transport count unchanged?", + "why_it_matters": "A chart-image hit would be a candidate unpaid relocation of a Y exit. Without an event in the word, the hit does not change the paid moment.", + "first_step": "Ask whether the retained warp constructor accepts frame 147 as the destination of role 116 under opcode 1, and recompute the transport histogram if it does.", + "blocked_by": "This census does not edit the word. The mutual pair of frames 146 and 147 is only a span equality." + }, + { + "question": "Which of these 112 charts does the inverse opcode -1 carry onto a recorded dimension-8 chart?", + "why_it_matters": "The retained alphabet includes the inverse. A hit for -1 would be a second family of same-dimension relocations.", + "first_step": "Replace opcode 1's columns by model.inv of those columns and repeat the 112-by-162 comparison.", + "blocked_by": "This package stops at opcode 1. The inverse is a different signed map." + } + ] +} diff --git a/research/opcode1-y-exit-chart-image/VERIFY.json b/research/opcode1-y-exit-chart-image/VERIFY.json new file mode 100644 index 0000000000..d7834aba8c --- /dev/null +++ b/research/opcode1-y-exit-chart-image/VERIFY.json @@ -0,0 +1,22 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/sol1337-contact-frontier/inputs/round3-native.json.gz", + "research/sol1337-contact-frontier/vendor/model.py", + "research/sol1337-contact-frontier/vendor/retained_verify.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Recompute opcode 1's image of all 112 Y-exit charts, match them to the 162 dimension-8 charts, and accept PROOF.md only when the partition agrees. Controls reject a zeroed column, a 111-exit sample, a false role-112 peer, and a fixed reading of frame 146." + } + ] +} diff --git a/research/opcode1-y-exit-chart-image/verify.py b/research/opcode1-y-exit-chart-image/verify.py new file mode 100644 index 0000000000..b933dfe3d3 --- /dev/null +++ b/research/opcode1-y-exit-chart-image/verify.py @@ -0,0 +1,241 @@ +#!/usr/bin/env python3 +"""Opcode 1's chart images of the 112 dimension-8 Y exits. + +The round-three word and the contact-graph span are predecessor inputs. +This checker recomputes every image. It does not trust the certificate +lines in PROOF.md until they match that recomputation. Failures raise +ValueError, including under python -O. +""" + +from hashlib import sha256 +from pathlib import Path +import gzip +import importlib.util +import json + +ROOT = Path(__file__).resolve().parents[2] +HERE = Path(__file__).resolve().parent +WORD = ROOT / "research/sol1337-contact-frontier/inputs/round3-native.json.gz" +MODEL = ROOT / "research/sol1337-contact-frontier/vendor/model.py" +ENGINE = ROOT / "research/sol1337-contact-frontier/vendor/retained_verify.py" +SELECTED = ROOT / "certificates/selected-result.json" +SELECTED_KAPPA = "363005817/100000000000" +OPCODE_1_COLUMNS = (1, 2, 4, 8, 64, 19, 104, 197, 325) +AMBIENT = 9 +SPACE = 1 << AMBIENT + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def load_module(path, name): + spec = importlib.util.spec_from_file_location(name, path) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +def authenticate(engine): + pins = json.loads((HERE / "SOURCES.json").read_text(encoding="utf-8")) + by_path = {row["path"]: row for row in pins["files"]} + for path in (WORD, MODEL, ENGINE, SELECTED): + rel = path.relative_to(ROOT).as_posix() + raw = path.read_bytes() + need(sha256(raw).hexdigest() == by_path[rel]["sha256"], "changed input " + rel) + raw = WORD.read_bytes() + need(sha256(raw).hexdigest() == engine.SOURCE_HASH, "word hash disagrees with the retained emitter") + selected = json.loads(SELECTED.read_text(encoding="utf-8")) + need(selected["kappa"] == SELECTED_KAPPA, "selected frontier value moved") + return json.loads(gzip.decompress(raw)) + + +def bijective(model, cols): + need(len(cols) == AMBIENT, "opcode 1 has nine columns") + need(all(type(column) is int and 0 <= column < SPACE for column in cols), + "opcode 1 columns lie in GF(2)^9") + need(model.mv(cols, 0) == 0, "a linear map sends 0 to 0") + for vector in range(SPACE): + for bit in range(AMBIENT): + axis = 1 << bit + need(model.mv(cols, vector ^ axis) == model.mv(cols, vector) ^ model.mv(cols, axis), + "opcode 1 is additive") + images = {model.mv(cols, vector) for vector in range(SPACE)} + return len(images) == SPACE + + +def proof_certificate(): + """The claimed partition, stated as certificate lines in PROOF.md.""" + fixed, y_to_y, non_y = [], [], [] + unrecorded = None + for line in (HERE / "PROOF.md").read_text(encoding="utf-8").splitlines(): + parts = line.split() + if not parts or parts[0] != "certificate": + continue + kind = parts[1] + fields = dict(item.split("=", 1) for item in parts[2:]) + if kind == "fixed": + fixed.append((int(fields["role"]), int(fields["source"]))) + elif kind == "y-to-y": + y_to_y.append((int(fields["role"]), int(fields["source"]), int(fields["dest"]))) + elif kind == "non-y": + non_y.append((int(fields["role"]), int(fields["source"]), int(fields["dest"]))) + elif kind == "unrecorded": + need(unrecorded is None, "one unrecorded count") + unrecorded = int(fields["count"]) + else: + raise ValueError("unknown certificate line") + need(unrecorded is not None, "PROOF.md states the unrecorded count") + need(len(fixed) == 4 and len(y_to_y) == 24 and len(non_y) == 11, "certificate class sizes") + need(unrecorded == 73, "certificate unrecorded count") + need(len(fixed) + len(y_to_y) + len(non_y) + unrecorded == 112, "certificate covers 112 exits") + return fixed, y_to_y, non_y, unrecorded + + +def classify(model, frames, dim8_index, cols, chart): + image = model.span(model.mv(cols, vector) for vector in frames[chart]) + need(len(image) == 256, "an automorphism preserves Y-exit dimension") + targets = dim8_index.get(frozenset(image), []) + need(len(targets) <= 1, "dimension-8 chart spans are unique") + return image, (targets[0] if targets else None) + + +def survey(model, payload): + canonical = payload["canonical"] + frames = canonical["frames"] + final = canonical["final"] + start = canonical["start"] + need(canonical["h"] == AMBIENT and canonical["v"] == 112, "ambient dimension and block length") + need(len(frames) == 4429, "recorded chart count") + need(len(final) == len(start) == 632, "632 role charts") + record = canonical["warps"][0] + cols = tuple(record["G_columns"]) + need(record["op"] == 1 and cols == OPCODE_1_COLUMNS, "opcode 1 keeps its recorded columns") + need(bijective(model, cols), "opcode 1 is a linear automorphism") + + spans = [] + for basis in frames: + for vector in basis: + need(type(vector) is int and 0 <= vector < SPACE, "every chart vector lies in GF(2)^9") + space = model.span(basis) + need(len(space) == 1 << len(basis), "chart dimension is the independent basis length") + spans.append(space) + full = [index for index, basis in enumerate(frames) if len(basis) == AMBIENT] + need(full == [1] and spans[1] == set(range(SPACE)), "frame 1 is the whole space") + + y_ids = [final[role] for role in range(112, 224)] + need(y_ids == list(range(142, 254)), "Y exits are frames 142 through 253 in role order") + need(len(set(y_ids)) == 112, "112 distinct Y-exit charts") + y_set = set(y_ids) + for chart in y_ids: + need(len(frames[chart]) == 8 and spans[chart] < spans[1], "every Y exit is a strict dimension-8 subspace") + + dim8_index = {} + for index, basis in enumerate(frames): + if len(basis) != 8: + continue + key = frozenset(spans[index]) + need(key not in dim8_index, "two dimension-8 charts share a span") + dim8_index[key] = [index] + need(len(dim8_index) == 162, "162 recorded dimension-8 charts") + + fixed, y_to_y, non_y, unrecorded = [], [], [], [] + for role, chart in enumerate(y_ids, start=112): + image, dest = classify(model, frames, dim8_index, cols, chart) + need(image != spans[1], "opcode 1 does not carry a Y exit onto frame 1") + if dest is None: + unrecorded.append(role) + continue + need(len(frames[dest]) == 8 and spans[dest] == image, "a hit is span equality with one dimension-8 chart") + if dest == chart: + fixed.append((role, chart)) + elif dest in y_set: + y_to_y.append((role, chart, dest)) + else: + need(dest not in y_set, "non-Y destination") + need(dest not in start and dest not in final, "non-Y image is not a role start or final chart") + non_y.append((role, chart, dest)) + need(len(fixed) + len(y_to_y) + len(non_y) + len(unrecorded) == 112, "every Y exit is classified once") + return { + "cols": cols, + "frames": frames, + "spans": spans, + "y_ids": y_ids, + "fixed": fixed, + "y_to_y": y_to_y, + "non_y": non_y, + "unrecorded": unrecorded, + } + + +def expect_fail(fn, message): + try: + fn() + except ValueError: + return + raise ValueError(message) + + +def controls(model, facts): + frames = facts["frames"] + spans = facts["spans"] + cols = facts["cols"] + damaged = list(cols) + damaged[0] = 0 + need(not bijective(model, tuple(damaged)), "zeroing one column of opcode 1 destroys bijectivity") + + role112 = facts["y_ids"][0] + need(role112 == 142, "role 112 uses frame 142") + image = model.span(model.mv(cols, vector) for vector in frames[142]) + for chart in facts["y_ids"]: + need(image != spans[chart], "opcode 1 does not carry role 112 onto a Y-exit chart") + need(len(image) == 256 and image != spans[1], "role 112 still has an 8-dimensional image") + + def short_domain(): + need(len(facts["y_ids"][:-1]) == 112, "111 exits are not the census") + + expect_fail(short_domain, "dropping one Y exit is not this census") + + def false_peer(): + need(image == spans[143], "role 112 image is frame 143") + + expect_fail(false_peer, "role 112 does not land on the next Y-exit chart") + + moved = [row for row in facts["y_to_y"] if row[1] == 146] + need(moved == [(116, 146, 147)], "role 116 is the recorded move from frame 146 to frame 147") + + def fixed_reading(): + need(spans[146] == model.span(model.mv(cols, vector) for vector in frames[146]), + "frame 146 is fixed") + + expect_fail(fixed_reading, "equal dimension does not make frame 146 a fixed chart") + + +def main(): + engine = load_module(ENGINE, "retained_centre_verify") + model = load_module(MODEL, "contact_graph_model") + payload = authenticate(engine) + facts = survey(model, payload) + claimed_fixed, claimed_y, claimed_non_y, claimed_unrecorded = proof_certificate() + need(facts["fixed"] == claimed_fixed, "fixed charts disagree with PROOF.md") + need(facts["y_to_y"] == claimed_y, "Y-to-Y images disagree with PROOF.md") + need(facts["non_y"] == claimed_non_y, "non-Y images disagree with PROOF.md") + named = {row[0] for row in facts["fixed"] + facts["y_to_y"] + facts["non_y"]} + need(named.isdisjoint(facts["unrecorded"]), "a role is not in two classes") + need(named | set(facts["unrecorded"]) == set(range(112, 224)), "the classes partition the 112 roles") + need(len(facts["unrecorded"]) == claimed_unrecorded, "unrecorded count disagrees with PROOF.md") + controls(model, facts) + print( + "PASS_OPCODE1_Y_EXIT_CHART_IMAGE " + "y_exits=112 recorded_dim8_charts=162 " + "fixed=4 y_to_y=24 non_y=11 unrecorded=73 " + "role112_chart=142 role112_recorded_dim8_image=none " + "frame1_admitted=0 " + "selected_kappa=363005817/100000000000 no_new_kappa=true " + "evidence_class=exhaustive_finite_census" + ) + + +if __name__ == "__main__": + main()