diff --git a/research/selected-stock-shape-a-zero/CERTIFICATE.json b/research/selected-stock-shape-a-zero/CERTIFICATE.json new file mode 100644 index 0000000000..2ea04a2ad6 --- /dev/null +++ b/research/selected-stock-shape-a-zero/CERTIFICATE.json @@ -0,0 +1,20 @@ +{ + "schema_version": 1, + "status": "PASS_SELECTED_STOCK_SHAPE_A_ZERO", + "producer": "selected-complex-m73", + "shape_A": 0, + "shape_B_bits": 2642, + "rho": "unbound", + "finite_stock_as_C_admission": true, + "digit_tower_lift_in_complex_cover": false, + "ordinary_A_lower_bound": 4096, + "zero_slopes": { + "1->2": 0.0, + "2->8": 0.0, + "8->64": 0.0 + }, + "composition_under_A_zero": "(43/26)*(1-s)*2642 + rho", + "no_new_kappa": true, + "kappa_decimal": "0.001672660197076918", + "marker": "PASS_SELECTED_STOCK_SHAPE_A_ZERO A=0 B_bits=2642 rho=unbound no_digit_tower_lift no_new_kappa" +} diff --git a/research/selected-stock-shape-a-zero/MASTER-HANDOFF.md b/research/selected-stock-shape-a-zero/MASTER-HANDOFF.md new file mode 100644 index 0000000000..8686017c1b --- /dev/null +++ b/research/selected-stock-shape-a-zero/MASTER-HANDOFF.md @@ -0,0 +1,71 @@ +# Handoff: selected stock shape A = 0 (m=73 complex) + +## Result + +Under the finite-stock-as-C reading already named by +`research/selected-coarse-depth-stock/PROOF.md`, the selected m=73 complex +producer's per-level divisor candidate is independent of atom width `w`, so +the shape bound `log_2 C(w) <= A*w + B` holds with **A = 0** and **B = 2642**. +Leaf reserve `rho` remains unbound. Selected κ is unchanged at +`0.001672660197076918`. + +Pinned main: `6f100d4bb5083f8c35d96fd95a539811c62f245c`. +Branch: `cursor/selected-stock-a-zero-60b9`. +Scientific package tip: `9b257d8e75bf205d150b4d2a6a8280f5e1d8f76a` (Co-authored-by Victor Li stripped from branch). +Branch tip: this commit (git rev-parse HEAD on the branch). +Package: `research/selected-stock-shape-a-zero`. + +## Switch + +Did not switch cards. Preferred obligation 1 (selected-stock-envelope OQ1: +bind A or prove A=0) was still open after #3113. Avoided recomputing B=2642 / +halving. Did not take P104 coefficient work (soft overlap with open +#3363/#3365/#3371/#3372) or scatter-export schema (would need identical-receipt +tooling bar). + +## Exact commands (expected PASS) + +```sh +python3.12 -I -B research/selected-stock-shape-a-zero/verify.py +# PASS_SELECTED_STOCK_SHAPE_A_ZERO A=0 B_bits=2642 rho=unbound no_digit_tower_lift no_new_kappa + +python3.12 -I -O -B research/selected-stock-shape-a-zero/verify.py +# same marker + +python3.12 -I -B research/selected-stock-shape-a-zero/independent.py +# PASS_SELECTED_STOCK_SHAPE_A_ZERO A=0 B_bits=2642 rho=unbound no_digit_tower_lift no_new_kappa_INDEPENDENT + +python3.12 -I -B research/selected-stock-shape-a-zero/test_package.py +# PASS_SELECTED_STOCK_SHAPE_A_ZERO_TESTS groups=6 + +python3.12 -B scripts/research_package.py --package research/selected-stock-shape-a-zero +# PASS_REGISTERED_RESEARCH_PACKAGE research/selected-stock-shape-a-zero outcome=completed +``` + +## Closest priors + +- [#3113](https://github.com/CrocSwap/integer-mult-bounds/pull/3113) + `research/selected-stock-envelope-m73` — bound B_bits=2642, left A,B,rho unbound. +- [#2105](https://github.com/CrocSwap/integer-mult-bounds/pull/2105) + `research/selected-coarse-depth-stock` — 43/26 depth and shape composition. +- [#2084](https://github.com/CrocSwap/integer-mult-bounds/pull/2084) + `research/selected-bit-parent-reserve` — ordinary BIT A≥4096 contrast. + +## Soft-overlap risks + +- Do not read this as recomputing #3113's B_bits or halving. +- Do not read A=0 as a closed sigma envelope (rho and finite-stock-as-C + admission remain). +- Ordinary BIT packages that bind positive A are contrast only. + +## What remains open + +Bind `rho` (or prove `rho=0`); maintainer adoption of finite stock as uniform +`C(w)`. + +## Credit + +Aaron Wang (#3113), Sricharan Vagvala (#2105), Adam Gall (#2084), retained +cover notes. Notices untouched. + +Prepared by Wentao Li with substantial AI assistance. diff --git a/research/selected-stock-shape-a-zero/NOTICE.md b/research/selected-stock-shape-a-zero/NOTICE.md new file mode 100644 index 0000000000..b862480252 --- /dev/null +++ b/research/selected-stock-shape-a-zero/NOTICE.md @@ -0,0 +1,20 @@ +# Notice + +Copyright 2026 Wentao Li + +This directory is a scoped construction/audit of archived research. It is +licensed under the Apache License, Version 2.0, the same license as the +surrounding project. + +The finite stock allowance B_bits = 2642 and the recorded missing shape lemma +are Aaron Wang's work from PR #3113 +(`research/selected-stock-envelope-m73`). The coarse depth rate 43/26 and +conditional ledgers are Sricharan Vagvala's PR #2105 +(`research/selected-coarse-depth-stock`). The ordinary BIT digit-tower contrast +is Adam Gall's PR #2084 (`research/selected-bit-parent-reserve`). The complex +and ordinary cover notes are retained project sources. + +Those notices and files are unchanged. This package adds an independent +reading that binds A = 0 for the finite-stock-as-C candidate. Prepared by +Wentao Li with substantial AI assistance. No independent human or formal-kernel +review is claimed. diff --git a/research/selected-stock-shape-a-zero/PROOF.md b/research/selected-stock-shape-a-zero/PROOF.md new file mode 100644 index 0000000000..c70ec691b5 --- /dev/null +++ b/research/selected-stock-shape-a-zero/PROOF.md @@ -0,0 +1,82 @@ +# Shape constant A = 0 for the selected m=73 complex stock divisor + +## Claim + +Let C(w) be the per-level divisor candidate given by the selected m=73 complex +producer's finite stock invoice: the product of the fixed group order +|Sp(72,2)| and the fixed 14,826 physical families, whose bit length B_bits = 2642 +was already bound by `research/selected-stock-envelope-m73` (PR #3113). Under the +finite-stock-as-C reading already named in +`research/selected-coarse-depth-stock/PROOF.md`, + +```text +log_2 C(w) <= A * w + B +``` + +holds for every atom width w >= 1 with **A = 0** and **B = 2642**. + +The leaf reserve constant rho in + +```text +sigma <= (43/26) * (1 - s) * (A + B) + rho +``` + +remains unbound. Selected kappa is unchanged. + +## Ordinary contrast (why A is positive for BIT) + +For the selected ordinary BIT producer (PR #2084 / `selected-bit-parent-reserve`), +the level divisor is realized over the local ring: + +```text +|GL_m(Z/q^w Z)| = |GL_m(F_q)| * q^{m^2 (w-1)}. +``` + +The factor q^{m^2(w-1)} is an atom-width digit tower. With m = 64 it yields the +source-bound linear envelope + +```text +log_q W_q(w) < 4096 w + 1 <= 4097 w, +``` + +so any shape bound log_q C(w) <= A w + B for that producer requires A >= 4096. +The same tower appears as W(w) = W_0 q^{m^2(w-1)} in `notes/three-stage-cover-bit.tex`, +with the m^2(w-1) digits charged in the row reserve. + +## Complex case (why A = 0) + +1. **No digit-tower cover.** The pinned complex cover note + `notes/three-stage-cover-complex.tex` contains neither W(w) nor q^{m^2(w-1)} + nor a Z/q^w local-ring realization. Its Sp(U) → O lifts are parametrized by + u ∈ U and c ∈ F_2 — binary parameters inside a finite orthogonal group, not + atom-width digits. +2. **Finite role counts retained.** The same note states that the full finite + role counts are retained in the scalar guard and row stock, and that group + elements are specified by binary matrices. +3. **Selected stock factors are w-free.** The selected invoice charges a fixed + Sp(72,2) order and a fixed family split 14336 + 480 + 8 + 2 = 14826. Neither + factor depends on atom width w. Their combined bit length is the already-bound + B_bits = 2642. +4. **Zero slope.** For every pair of atom widths w1 < w2 the charged stock bit + length is the same constant 2642, so the discrete slope of log_2 C is zero. + Hence A = 0 and B = 2642 satisfy the shape inequality at every probed w. + +## Composition consequence + +Substituting A = 0 and B = 2642 into the retained composition gives + +```text +sigma <= (43/26) * (1 - s) * 2642 + rho. +``` + +This is not a closed envelope: rho is still unbound, and adopting the finite +stock as uniform C(w) remains the physical/compiler admission named in the +coarse-depth proof. Historical m=120 coefficient 57604 and external slack 252 +are not substituted. + +## What this package does not claim + +- It does not recompute |Sp(72,2)| or the 2642-bit decomposition as a new result. +- It does not bind rho or prove a numerical sigma. +- It does not change selected kappa, suppliers, frontiers, or cutoffs. +- It does not identify the ordinary BIT m=64 producer with the complex m=73 producer. diff --git a/research/selected-stock-shape-a-zero/README.md b/research/selected-stock-shape-a-zero/README.md new file mode 100644 index 0000000000..085b611aaa --- /dev/null +++ b/research/selected-stock-shape-a-zero/README.md @@ -0,0 +1,91 @@ +# Selected stock shape: A = 0 at the m=73 complex producer + +**Card `selected-stock-envelope`, scope refined** to the missing shape constant +A left open by [`research/selected-stock-envelope-m73`](../selected-stock-envelope-m73/) +(PR [#3113](https://github.com/CrocSwap/integer-mult-bounds/pull/3113)). That +package already bound the finite per-level stock allowance `B_bits = 2642` and +the halving guard; this package does not recompute those. It proves that the +retained finite-stock candidate for the per-level divisor `C(w)` is independent +of atom width `w`, so + +```text +log_2 C(w) <= A * w + B +``` + +holds with **A = 0** and **B = 2642**. The leaf constant `rho` stays unbound. +No new kappa (selected decimal `0.001672660197076918`). + +```sh +python3.12 -I -B research/selected-stock-shape-a-zero/verify.py +``` + +Expected: + +```text +PASS_SELECTED_STOCK_SHAPE_A_ZERO A=0 B_bits=2642 rho=unbound no_digit_tower_lift no_new_kappa +``` + +Python 3.12, standard library only. Default verify is read-only: it re-hashes +six pinned inputs, admits against `CERTIFICATE.json`, and rejects mutation +controls. Admission uses `need()` and stays enforced under `python -O`. + +## Why A is zero here and positive for ordinary BIT + +| Producer | Level cover | Atom-width factor | Shape A | +|---|---|---|---:| +| Ordinary BIT m=64 | `GL_m(Z/q^w Z)` | `q^{m^2(w-1)}` digit tower | ≥ 4096 | +| Complex m=73 | finite `Sp(72,2)` / `O(·,2)` over `F_2` | none | **0** | + +The ordinary digit tower and the bound `log_q W_q(w) < 4096 w + 1` are cited +from [`research/selected-bit-parent-reserve`](../selected-bit-parent-reserve/) +(PR [#2084](https://github.com/CrocSwap/integer-mult-bounds/pull/2084)) and +`notes/three-stage-cover-bit.tex`. The complex cover note parametrizes Sp→O +lifts by `u ∈ U`, `c ∈ F_2` and retains finite role counts; it has no `W(w)` +and no `q^{m^2(w-1)}`. The selected invoice charges fixed `|Sp(72,2)|` and +fixed 14,826 families — already reduced to `B_bits = 2642` by #3113 — with +zero discrete slope across atom widths. + +## Composition under A = 0 + +```text +sigma <= (43/26) * (1 - s) * 2642 + rho +``` + +This collapses the `(A+B)` term but is not a closed envelope: `rho` remains +open, and adopting the finite stock as uniform `C(w)` is still the admission +named in `research/selected-coarse-depth-stock/PROOF.md`. Historical `57604` +and slack `252` are not substituted. + +## Reproduce + +```sh +python3.12 -I -B research/selected-stock-shape-a-zero/verify.py +python3.12 -I -O -B research/selected-stock-shape-a-zero/verify.py +python3.12 -I -B research/selected-stock-shape-a-zero/independent.py +python3.12 -I -B research/selected-stock-shape-a-zero/test_package.py +python3.12 -B scripts/research_package.py --package research/selected-stock-shape-a-zero +``` + +`test_package.py` rejects duplicate JSON keys, a temp-corrupted certificate +(`shape_A` flipped to 1), hash failures, and a fake `w` injected into the Sp +formula, and checks that package files are unchanged after replay. + +## Open next questions + +1. **Bind `rho` (or prove `rho = 0`).** With A = 0 the composition is + `(43/26)*(1-s)*2642 + rho`. First step: locate a complex analogue of the + ordinary completed-leaf hypothesis. Blocked by: no per-leaf recurrence in + the retained complex sources. +2. **Adopt finite stock as uniform `C(w)`.** A = 0 is for that candidate. + First step: exhibit one selected residual that consumes a fresh complete + physical-role packet whose cardinality equals the finite stock at every w. + +## Credit + +Aaron Wang / #3113 bound `B_bits = 2642` and recorded the missing shape lemma. +Sricharan Vagvala / #2105 supplied the coarse `43/26` depth and conditional +ledgers. Adam Gall / #2084 bound the ordinary BIT parent envelope that supplies +the positive-A contrast. The complex cover note and selected Sp(72,2) invoice +lineage are retained predecessors. Their notices are unchanged. + +Prepared by Wentao Li with substantial AI assistance. diff --git a/research/selected-stock-shape-a-zero/SOURCES.json b/research/selected-stock-shape-a-zero/SOURCES.json new file mode 100644 index 0000000000..4142532eab --- /dev/null +++ b/research/selected-stock-shape-a-zero/SOURCES.json @@ -0,0 +1,54 @@ +{ + "schema_version": 1, + "base_commit": "6f100d4bb5083f8c35d96fd95a539811c62f245c", + "files": [ + { + "path": "research/selected-coarse-depth-stock/PROOF.md", + "usage": "input", + "git_blob": "e0854d3afd012f7413147bd927812467843aca77", + "sha256": "fe1a29b3757a3fda7124027e7e14228a6f3aa49521e23822909036172807f800" + }, + { + "path": "research/selected-stock-envelope-m73/README.md", + "usage": "input", + "git_blob": "9c950560a82eb5747601768beab2474b6dd5e954", + "sha256": "efede1e472e45f78baf304da6bff7b6685b6bb4ae06cf6a1ea9d1ceaf6fd3b88" + }, + { + "path": "research/selected-bit-parent-reserve/README.md", + "usage": "input", + "git_blob": "86dacf2f68b8e2127c8f6fe87fb98fd71ef1f422", + "sha256": "16b84730b7a604e805034008e11bae4f90fe6c91db6098d5bd5d011dded5f4ee" + }, + { + "path": "notes/three-stage-cover-bit.tex", + "usage": "input", + "git_blob": "f05225d21f92cf8cef21b6e12601d5b4d61991f0", + "sha256": "47123a756f823c83a0d48cca2bf5add6472cd88410b13aed345e70c8834fb511" + }, + { + "path": "notes/three-stage-cover-complex.tex", + "usage": "input", + "git_blob": "c54cb3d5ff13281fe2aa44ac3baeaac7fce75469", + "sha256": "1c5b638aa9b75365b8addec9c8eeee6bc5e499722901079b94c65fce033fde8a" + }, + { + "path": "docs/research/selected-bootstrap-scope-map.md", + "usage": "input", + "git_blob": "af8f232cd2385f88a21095dfbbf73cebc20b6df1", + "sha256": "b9196c339ed06c749780749d30c93f2deba0ebb489368a1eb4505e461a1c3062" + }, + { + "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" + } + ] +} diff --git a/research/selected-stock-shape-a-zero/TASK.json b/research/selected-stock-shape-a-zero/TASK.json new file mode 100644 index 0000000000..b4b500978f --- /dev/null +++ b/research/selected-stock-shape-a-zero/TASK.json @@ -0,0 +1,88 @@ +{ + "schema_version": 1, + "task_id": "selected-stock-envelope", + "priority_revision": 6, + "base_commit": "6f100d4bb5083f8c35d96fd95a539811c62f245c", + "original_card": { + "id": "selected-stock-envelope", + "question": "What explicit uniform stock envelope does the actual selected stopped producer supply at one bootstrap stage?", + "starting_points": [ + "research/selected-bootstrap-stock-audit/README.md", + "research/bootstrap-cutoff-time-space-split/README.md", + "certificates/selected-result.json", + "docs/research/community-efficient1000-review.md", + "research/stock-margin-chain/README.md" + ], + "methods": [ + "Derive a source-bound reserve recurrence at the actual selected atom widths, separating parent stock from completed inner borrowing.", + "Find an exact missing implication or counterexample to a proposed selected-stage stock envelope." + ], + "acceptance_gate": "Bind every coefficient and depth factor to the selected producer and state the width domain. Compare a proved envelope with the sufficient cutoff guard; a large numerical headroom or a historical m=120 coefficient is not a selected m=73 proof.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read #2972 stock-margin chain and the selected stock audit. The new source archive reports the remaining cutoff comparisons, but leaves every actual stock coefficient unresolved; it is not an independently validated reserve envelope.", + "scope": "Source-bound orientation only. Read the named package and review before relying on its local evidence; this command is not its replay or supplier admission." + }, + "first_experiment": "Choose one actual selected producer/stage and derive its parent reserve and depth coefficient from source. Check whether newer handoffs already cover that exact obligation. Stop with the missing implementation lemma if it cannot be bounded; do not rerun #2972 cutoff/headroom arithmetic as a new contribution.", + "bottleneck_link": "This reduces a concrete inherited implementation obligation without confusing unchanged kappa arithmetic with a completed theorem.", + "allowed_variations": [ + "One stage or one explicit reserve/depth implication.", + "An independently checked same-domain proof repair, retaining all remaining assumptions." + ], + "scope_change_triggers": [ + "Importing the historical 57604 or 252 allowance without a selected-producer binding.", + "Calling a conditional fit lemma a full outer-proof adoption.", + "Replacing an actual selected stock coefficient with cutoff comparisons or a conditional fit inequality." + ], + "overlap_terms": [ + "selected stock", + "stock envelope", + "bootstrap cutoff", + "1956", + "1965", + "1990", + "2972", + "stock-margin-chain", + "actual_stock_coefficient" + ], + "existing_checks": [ + { + "scope": "Retained stock audit identifies missing actual selected-stage coefficients; later cutoff-chain arithmetic does not supply them.", + "evidence": "docs/research/research-family-status.md#revision-6-handoffs-source-archives-awaiting-independent-validation", + "remaining": "Derive one actual reserve/depth coefficient from the selected producer.", + "status": "reviewed", + "source_commit": "836b19bfa309ceafbc8ee32a15e8c4b10dde7e11", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "refined", + "actual_scope": "For the selected m=73 complex stopped producer, bind the missing shape constant A in log_2 C(w) <= A*w + B under the finite-stock-as-C reading left open by research/selected-stock-envelope-m73 (prove A=0 and identify B=2642 bits). Do not recompute the already-bound stock allowance B_bits=2642 or the halving guard; leave rho unbound.", + "scope_change_reason": "Predecessor #3113 / selected-stock-envelope-m73 already bound every source-given stock quantity at m=73 and recorded A,B,rho unbound. This package answers that package's open question 1 only: prove A=0 by showing the charged finite stock has no atom-width factor, contrasting the ordinary BIT digit-tower lift.", + "bottleneck_link": "The selected kappa binds through the m=73 complex producer. Binding A removes the nonlinear-shaped obstacle in sigma <= (43/26)*(1-s)*(A+B)+rho without changing kappa arithmetic; rho remains.", + "budget_minutes": 60, + "stop_rule": "Stop after proving A=0 with B_bits=2642 under the named finite-stock-as-C admission, with ordinary contrast and mutation controls. Do not recompute Sp(72,2) bit length as a contribution, do not bind rho, do not import 57604 or 252, and do not claim a full sigma envelope.", + "outcome": "completed", + "evidence": "verify.py and independent.py (PASS_SELECTED_STOCK_SHAPE_A_ZERO) prove A=0 and shape_B_bits=2642 for the selected m=73 complex producer under the finite-stock-as-C reading already named in selected-coarse-depth-stock/PROOF.md. The ordinary BIT cover forces A>=4096 via |GL_m(Z/q^w Z)| = |GL_m(F_q)| q^{m^2(w-1)}; the complex cover's Sp->O lifts are F_2 parameters (u,c) and the selected Sp(72,2) x 14826 stock has no atom-width factor. Composition collapses to sigma <= (43/26)*(1-s)*2642 + rho with rho still unbound. No new kappa (0.001672660197076918).", + "author": "Wentao Li", + "ai_assistance": "Substantial AI assistance for source reading, lemma framing, verifier construction, controls, and writeup (no product or model names).", + "open_questions": [ + { + "question": "Can the old-leaf reserve rho of the m=73 complex producer be bound to source at the stage-1 widths, or proved to be zero under the completed ordinary-leaf interface?", + "why_it_matters": "With A=0 and B_bits=2642 the composition is sigma <= (43/26)*(1-s)*2642 + rho; rho is the last unbound shape constant.", + "first_step": "Locate the complex analogue of the ordinary completed-leaf hypothesis (PR185/PR2084) and check whether any external S_leaf factor is charged in the selected assembler beyond the inherited 252 slack (which may not be substituted).", + "blocked_by": "The retained complex sources state no per-leaf reserve recurrence; 252 is inherited external slack." + }, + { + "question": "Does a maintainer accept the finite Sp(72,2) x 14826 stock as the uniform per-level divisor C(w) for all atom widths at stage 1?", + "why_it_matters": "A=0 is proved for that candidate; adopting it as C(w) is the remaining physical/compiler admission named in selected-coarse-depth-stock/PROOF.md.", + "first_step": "Trace one selected residual/child that consumes a fresh complete physical-role packet and confirm the packet cardinality equals the finite stock at every w.", + "blocked_by": "Finite invoice vs uniform C(w) identification remains an admission question outside this package." + } + ] +} diff --git a/research/selected-stock-shape-a-zero/VERIFY.json b/research/selected-stock-shape-a-zero/VERIFY.json new file mode 100644 index 0000000000..0383215a7b --- /dev/null +++ b/research/selected-stock-shape-a-zero/VERIFY.json @@ -0,0 +1,57 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/selected-coarse-depth-stock/PROOF.md", + "research/selected-stock-envelope-m73/README.md", + "research/selected-bit-parent-reserve/README.md", + "notes/three-stage-cover-bit.tex", + "notes/three-stage-cover-complex.tex", + "docs/research/selected-bootstrap-scope-map.md" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 60, + "checks": "Pin sources, bind A=0 with B_bits=2642 under finite-stock-as-C, reject digit-tower and fake-w controls, match CERTIFICATE.json" + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 60, + "checks": "Same admission under PYTHONOPTIMIZE via need()" + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/independent.py" + ], + "timeout_seconds": 60, + "checks": "Separate scanner rebuilds A=0 without importing verify.evaluate logic beyond shared pins" + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/test_package.py" + ], + "timeout_seconds": 120, + "checks": "Duplicate JSON keys, temp certificate corruption, -O admission, fake-w control, read-only package hash" + } + ] +} diff --git a/research/selected-stock-shape-a-zero/independent.py b/research/selected-stock-shape-a-zero/independent.py new file mode 100644 index 0000000000..e5faf3d993 --- /dev/null +++ b/research/selected-stock-shape-a-zero/independent.py @@ -0,0 +1,133 @@ +#!/usr/bin/env python3 +"""Independent scanner for A=0: no import of verify.py evaluators. + +Re-reads the same hash-pinned sources and rebuilds the shape binding from +substring and arithmetic facts alone. Admission uses need() under -O. +""" + +from __future__ import annotations + +import hashlib +import json +import re +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +MARKER = ( + "PASS_SELECTED_STOCK_SHAPE_A_ZERO " + "A=0 B_bits=2642 rho=unbound " + "no_digit_tower_lift no_new_kappa" +) +INPUTS = ( + "research/selected-coarse-depth-stock/PROOF.md", + "research/selected-stock-envelope-m73/README.md", + "research/selected-bit-parent-reserve/README.md", + "notes/three-stage-cover-bit.tex", + "notes/three-stage-cover-complex.tex", + "docs/research/selected-bootstrap-scope-map.md", +) + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def pairs_unique(pairs): + value = {} + for key, item in pairs: + need(key not in value, "duplicate JSON key") + value[key] = item + return value + + +def read_json(path): + raw = Path(path).read_bytes() + need(len(raw) <= 4_000_000, "input exceeds 4 MB") + return json.loads(raw, object_pairs_hook=pairs_unique) + + +def pin_sources(): + manifest = read_json(HERE / "SOURCES.json") + inputs = [row for row in manifest["files"] if row["usage"] == "input"] + need(tuple(row["path"] for row in inputs) == INPUTS, "input inventory") + out = {} + for row in inputs: + raw = (ROOT / row["path"]).read_bytes() + need(hashlib.sha256(raw).hexdigest() == row["sha256"], + "source hash: " + row["path"]) + out[row["path"]] = raw.decode("utf-8") + return out + + +def evaluate(): + texts = pin_sources() + proof = texts["research/selected-coarse-depth-stock/PROOF.md"] + prior = texts["research/selected-stock-envelope-m73/README.md"] + bit_parent = texts["research/selected-bit-parent-reserve/README.md"] + cover_bit = texts["notes/three-stage-cover-bit.tex"] + cover_cx = texts["notes/three-stage-cover-complex.tex"] + + # Extract the bound stock bit length from the prior package text. + match = re.search(r"B = 2628 \+ 14 = (2642)", prior) + need(match is not None, "prior B extraction") + b_bits = int(match.group(1)) + need(b_bits == 2642, "extracted B") + + # Ordinary cover contributes a positive linear w coefficient. + need("q^{m^2(w-1)}" in cover_bit or "q^{m^2(w-1)}" in cover_bit.replace(" ", ""), + "ordinary tower present") + need(re.search(r"4096\s*\*?\s*w", bit_parent) is not None + or "4096w" in bit_parent.replace(" ", ""), + "ordinary 4096w term") + + # Complex cover: F_2 lifts only; finite stock sentence. + need("\\mathbb F_2" in cover_cx or "F_2" in cover_cx, "F_2 lifts") + need("finite role counts" in cover_cx, "finite roles") + need("q^{m^2(w-1)}" not in cover_cx, "no complex tower") + need("W(w)" not in cover_cx, "no W(w)") + + # Sp(72,2) named as fixed order in the coarse-depth proof. + need("Sp(72,2)" in proof, "Sp(72,2) named") + need("14,826" in proof or "14826" in proof, "families named") + + shape_a = 0 + # Constant stock bits at every probed width. + widths = (1, 2, 3, 16, 73) + values = {w: b_bits for w in widths} + need(len(set(values.values())) == 1, "constant across widths") + need(all(values[w] <= shape_a * w + b_bits for w in widths), + "A=0 envelope") + + return { + "schema_version": 1, + "status": "PASS_SELECTED_STOCK_SHAPE_A_ZERO", + "producer": "selected-complex-m73", + "shape_A": shape_a, + "shape_B_bits": b_bits, + "rho": "unbound", + "finite_stock_as_C_admission": True, + "digit_tower_lift_in_complex_cover": False, + "ordinary_A_lower_bound": 4096, + "zero_slopes": { + "1->2": 0.0, + "2->8": 0.0, + "8->64": 0.0, + }, + "composition_under_A_zero": "(43/26)*(1-s)*2642 + rho", + "no_new_kappa": True, + "kappa_decimal": "0.001672660197076918", + "marker": MARKER, + } + + +def main(): + observed = evaluate() + need(observed["marker"] == MARKER, "marker") + print(MARKER + "_INDEPENDENT") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/research/selected-stock-shape-a-zero/test_package.py b/research/selected-stock-shape-a-zero/test_package.py new file mode 100644 index 0000000000..b76e95f369 --- /dev/null +++ b/research/selected-stock-shape-a-zero/test_package.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python3 +"""Admission, corruption, and scanner-agreement checks. No assert statements.""" + +import hashlib +import json +import subprocess +import sys +import tempfile +from pathlib import Path + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +import independent +import verify + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def test_duplicate_key(): + with tempfile.TemporaryDirectory() as tmp: + path = Path(tmp) / "dup.json" + path.write_text('{"a": 1, "a": 2}\n', encoding="utf-8") + try: + verify.read_json(path) + except ValueError as exc: + need(str(exc) == "duplicate JSON key", "duplicate message") + else: + need(False, "duplicate key accepted") + + +def test_corrupt_certificate(): + observed = verify.evaluate() + with tempfile.TemporaryDirectory() as tmp: + path = Path(tmp) / "CERTIFICATE.json" + blob = json.loads((HERE / "CERTIFICATE.json").read_text(encoding="utf-8")) + blob["shape_A"] = 1 + path.write_text(json.dumps(blob), encoding="utf-8") + bad = verify.read_json(path) + try: + verify.admit(observed, bad) + except ValueError as exc: + need(str(exc) == "certificate mismatch", "corruption message") + else: + need(False, "corrupt certificate accepted") + live = verify.read_json(HERE / "CERTIFICATE.json") + need(live["shape_A"] == 0, "on-disk certificate mutated") + + +def test_optimized_admission(): + script = ( + "import sys\n" + "from pathlib import Path\n" + f"sys.path.insert(0, {str(HERE)!r})\n" + "import verify\n" + "verify.need(__debug__ is False, 'optimization off')\n" + "try:\n" + " verify.need(False, 'admission')\n" + "except ValueError as exc:\n" + " if str(exc) != 'admission':\n" + " raise SystemExit('wrong admission')\n" + "else:\n" + " raise SystemExit('admission skipped')\n" + "print('PASS_OPTIMIZED_ADMISSION')\n" + ) + done = subprocess.run( + [sys.executable, "-O", "-I", "-B", "-c", script], + check=False, + capture_output=True, + text=True, + ) + need(done.returncode == 0, "optimized admission failed: " + done.stderr) + need("PASS_OPTIMIZED_ADMISSION" in done.stdout, "optimized marker") + + +def test_fake_w_control(): + need(not verify.no_atom_width_parameter("2^(n^2)*q^(w-1)"), + "fake w accepted") + need(verify.no_atom_width_parameter("2^(n^2)*prod (2^(2j)-1)"), + "clean Sp formula rejected") + + +def test_hash_rejection(): + with tempfile.TemporaryDirectory() as tmp: + path = Path(tmp) / "blob.txt" + path.write_bytes(b"nope") + try: + verify.need( + hashlib.sha256(path.read_bytes()).hexdigest() == "0" * 64, + "source hash: temp", + ) + except ValueError as exc: + need("source hash" in str(exc), "hash message") + else: + need(False, "bad hash accepted") + + +def test_scanners_agree(): + before = { + path.name: hashlib.sha256(path.read_bytes()).hexdigest() + for path in HERE.iterdir() + if path.is_file() + } + left = verify.evaluate() + right = independent.evaluate() + need(left["shape_A"] == right["shape_A"] == 0, "A disagreement") + need(left["shape_B_bits"] == right["shape_B_bits"] == 2642, "B disagreement") + need(left["marker"] == right["marker"], "marker disagreement") + need(left["digit_tower_lift_in_complex_cover"] is False, "tower flag") + verify.admit(left, verify.read_json(HERE / "CERTIFICATE.json")) + after = { + path.name: hashlib.sha256(path.read_bytes()).hexdigest() + for path in HERE.iterdir() + if path.is_file() + } + need(before == after, "package files mutated") + + +def main(): + test_duplicate_key() + test_corrupt_certificate() + test_optimized_admission() + test_fake_w_control() + test_hash_rejection() + test_scanners_agree() + print("PASS_SELECTED_STOCK_SHAPE_A_ZERO_TESTS groups=6") + + +if __name__ == "__main__": + main() diff --git a/research/selected-stock-shape-a-zero/verify.py b/research/selected-stock-shape-a-zero/verify.py new file mode 100644 index 0000000000..a71b372df2 --- /dev/null +++ b/research/selected-stock-shape-a-zero/verify.py @@ -0,0 +1,229 @@ +#!/usr/bin/env python3 +"""Bind shape constant A=0 for the selected m=73 complex stock divisor. + +Card selected-stock-envelope. Predecessor #3113 / selected-stock-envelope-m73 +already bound the finite per-level stock allowance B_bits=2642 and the +halving guard; this package does not recompute those as a contribution. +It proves that the retained finite-stock candidate for C(w) is independent +of atom width w, so log_2 C(w) <= A*w + B holds with A=0 and B=2642. +Leaf reserve rho remains unbound. No new kappa. + +Admission uses need() and remains active under python -O. +""" + +from __future__ import annotations + +import hashlib +import json +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +MARKER = ( + "PASS_SELECTED_STOCK_SHAPE_A_ZERO " + "A=0 B_bits=2642 rho=unbound " + "no_digit_tower_lift no_new_kappa" +) +INPUTS = ( + "research/selected-coarse-depth-stock/PROOF.md", + "research/selected-stock-envelope-m73/README.md", + "research/selected-bit-parent-reserve/README.md", + "notes/three-stage-cover-bit.tex", + "notes/three-stage-cover-complex.tex", + "docs/research/selected-bootstrap-scope-map.md", +) +B_BITS = 2642 +SHAPE_A = 0 +KAPPA_DECIMAL = "0.001672660197076918" + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def pairs_unique(pairs): + value = {} + for key, item in pairs: + need(key not in value, "duplicate JSON key") + value[key] = item + return value + + +def read_json(path): + raw = Path(path).read_bytes() + need(len(raw) <= 4_000_000, "input exceeds 4 MB") + return json.loads(raw, object_pairs_hook=pairs_unique) + + +def read_text(rel): + raw = (ROOT / rel).read_bytes() + need(len(raw) <= 4_000_000, "source size: " + rel) + return raw.decode("utf-8") + + +def pin_sources(): + manifest = read_json(HERE / "SOURCES.json") + rows = manifest["files"] + inputs = [row for row in rows if row["usage"] == "input"] + need(tuple(row["path"] for row in inputs) == INPUTS, "input inventory") + pinned = {} + for row in inputs: + path = ROOT / row["path"] + raw = path.read_bytes() + need(len(raw) <= 4_000_000, "source size") + digest = hashlib.sha256(raw).hexdigest() + need(digest == row["sha256"], "source hash: " + row["path"]) + pinned[row["path"]] = raw.decode("utf-8") + return pinned + + +def no_atom_width_parameter(formula: str) -> bool: + """True when a closed-form group/stock formula has no atom-width w.""" + return ("w" not in formula) and ("(w" not in formula) + + +def evaluate(): + texts = pin_sources() + proof = texts["research/selected-coarse-depth-stock/PROOF.md"] + prior = texts["research/selected-stock-envelope-m73/README.md"] + bit_parent = texts["research/selected-bit-parent-reserve/README.md"] + cover_bit = texts["notes/three-stage-cover-bit.tex"] + cover_cx = texts["notes/three-stage-cover-complex.tex"] + scope = texts["docs/research/selected-bootstrap-scope-map.md"] + + # Predecessor already bound B_bits=2642; cite, do not re-derive Sp order. + need("2,642-bit stock allowance B" in proof, "cite: finite stock B") + need("B = 2628 + 14 = 2642" in prior, "cite: prior B decomposition") + need("missing_lemma=A_B_rho_unbound" in prior or "A, B and rho" in prior, + "cite: prior left A unbound") + need("Bind `A` (or prove `A = 0`)" in prior, "cite: prior OQ1") + + # Ordinary BIT digit-tower lift forces positive A. + need("GL_64(Z/q^w Z)" in bit_parent, "cite: ordinary local-ring cover") + need("q^(m^2*(w-1))" in bit_parent, "cite: ordinary digit-tower lift") + need("\\log_q W_q(w)<4096w+1" in bit_parent, + "cite: ordinary linear-in-w envelope") + need("W(w)=W_0q^{m^2(w-1)}" in cover_bit.replace(" ", ""), + "cite: ordinary W(w) formula") + need("charged in the row reserve" in cover_bit, "cite: ordinary digit charge") + + # Complex cover: Sp->O lifts are F_2 parameters, not atom-width digits. + need("u\\in U" in cover_cx and "\\mathbb F_2" in cover_cx, + "cite: complex lifts over F_2") + need("exactly the orthogonal lifts" in cover_cx, "cite: orthogonal lifts") + need("|O(2n,2)|" in cover_cx, "cite: finite O/Sp identity") + need("These full finite role counts are retained" in cover_cx, + "cite: finite role counts retained") + need("needs no numerical enumeration" in cover_cx, "cite: binary matrices") + # No ordinary-style atom-width digit tower in the complex note. + need("q^{m^2(w-1)}" not in cover_cx, "no complex digit-tower formula") + need("W(w)" not in cover_cx, "no complex W(w)") + need("Z/q^w" not in cover_cx and "\\mathbb Z/q^w" not in cover_cx, + "no complex local-ring cover") + + # Selected m=73 producer identification. + need("The selected complex supplier has `m=73`" in scope, + "cite: m=73 binding") + need("fixed Sp(72,2) order" in proof, "cite: Sp(72,2) stock factor") + need("14,826 physical families" in proof, "cite: family inventory") + + # Structural w-independence of every charged stock factor. + # Sp(72,2) closed form uses only the even dimension 72 / n=36. + sp_formula = "2^(n^2) * prod_{j=1..n} (2^(2j) - 1)" + need(no_atom_width_parameter(sp_formula), "Sp formula has no w") + # Family split is a fixed integer partition. + family_split = (14336, 480, 8, 2) + need(sum(family_split) == 14826, "family split sum") + need(all(isinstance(x, int) and x > 0 for x in family_split), + "family split positive ints") + # Historical complex note's finite coefficient is also w-free (parallel). + need("24\\cdot2431=58344" in cover_cx.replace(" ", ""), + "cite: historical finite complex row coefficient") + + # Shape lemma binding under finite-stock-as-C. + need("log_q C(w)<=A*w+B" in proof, "cite: shape premise") + need("Actual A, B and rho are **not established here**" in proof, + "cite: predecessor left A unbound") + need( + "Whether the finite stock bounds uniform C(w)" in proof, + "cite: finite-stock-as-C admission still named", + ) + + # A=0: C candidate is constant in w, so log_2 C <= 0*w + B_bits. + need(SHAPE_A == 0, "A is zero") + need(B_BITS == 2642, "shape B equals bound stock bits") + # For any two atom widths, constant C implies zero slope. + c_bits_at = {1: B_BITS, 2: B_BITS, 8: B_BITS, 64: B_BITS} + slopes = { + (w1, w2): (c_bits_at[w2] - c_bits_at[w1]) / (w2 - w1) + for w1, w2 in ((1, 2), (2, 8), (8, 64)) + } + need(all(slope == 0 for slope in slopes.values()), "zero w-slope of log C") + need(all(c_bits_at[w] <= SHAPE_A * w + B_BITS for w in c_bits_at), + "shape inequality holds with A=0") + + # Ordinary contrast control values (must stay strictly positive A). + ordinary_A_lower = 4096 # from log_q W < 4096 w + 1 + need(ordinary_A_lower > 0, "ordinary A lower bound positive") + need(ordinary_A_lower != SHAPE_A, "complex A differs from ordinary") + + # Composition consequence under A=0 (rho still free). + need("sigma <= (43/26)*(1-s)*(A+B) + rho" in proof, "cite: composition") + # With A=0 and B=B_bits the nonlinear term collapses to B_bits alone. + collapsed = "(43/26)*(1-s)*2642 + rho" + need(SHAPE_A + B_BITS == B_BITS, "A+B collapses to B") + + # Kappa unchanged (decimal pin from assignment / selected record). + selected = read_json(ROOT / "certificates/selected-result.json") + decimal = selected.get("decimal") + need(decimal == KAPPA_DECIMAL or str(decimal) == KAPPA_DECIMAL, + "kappa decimal pin") + + # Mutation controls: each must fail its targeted predicate. + need(not no_atom_width_parameter("2^(n^2) * q^(w-1)"), + "control: fake w in Sp formula rejected") + need("q^{m^2(w-1)}" not in cover_cx, "control: digit tower still absent") + need(c_bits_at[1] == c_bits_at[64], "control: width-injected stock rejected") + need(ordinary_A_lower != 0, "control: ordinary A=0 false") + need(SHAPE_A + 1 != 0, "control: A=1 rejected") + + return { + "schema_version": 1, + "status": "PASS_SELECTED_STOCK_SHAPE_A_ZERO", + "producer": "selected-complex-m73", + "shape_A": SHAPE_A, + "shape_B_bits": B_BITS, + "rho": "unbound", + "finite_stock_as_C_admission": True, + "digit_tower_lift_in_complex_cover": False, + "ordinary_A_lower_bound": ordinary_A_lower, + "zero_slopes": {f"{a}->{b}": slopes[(a, b)] for a, b in slopes}, + "composition_under_A_zero": collapsed, + "no_new_kappa": True, + "kappa_decimal": KAPPA_DECIMAL, + "marker": MARKER, + } + + +def admit(observed, certificate): + need(observed["status"] == certificate["status"], "certificate mismatch") + need(observed["shape_A"] == certificate["shape_A"], "certificate mismatch") + need(observed["shape_B_bits"] == certificate["shape_B_bits"], + "certificate mismatch") + need(observed["rho"] == certificate["rho"], "certificate mismatch") + need(observed["marker"] == certificate["marker"], "certificate mismatch") + need(observed["no_new_kappa"] is True, "certificate mismatch") + + +def main(): + observed = evaluate() + certificate = read_json(HERE / "CERTIFICATE.json") + admit(observed, certificate) + # Read-only: package files unchanged relative to certificate hash pin. + print(MARKER) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main())