Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/pr256-fourier-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: PR256 complex proof audit

on:
push:
paths:
- 'research/pr256-fourier-audit/**'
- '.github/workflows/pr256-fourier-audit.yml'
pull_request:
paths:
- 'research/pr256-fourier-audit/**'
- '.github/workflows/pr256-fourier-audit.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
finite-audit:
runs-on: ubuntu-24.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.13', '3.14']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: ${{ matrix.python-version }}
- name: Replay finite program, source bindings, and retained evidence
run: python3 -B research/pr256-fourier-audit/verify.py
- name: Reject corrupted programs, statements, and evidence
run: python3 -B research/pr256-fourier-audit/test_audit.py
- name: Require unchanged tracked artifacts
run: git diff --exit-code
29 changes: 29 additions & 0 deletions research/pr256-fourier-audit/MANIFEST.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"description": "Immutable audit inputs and historical evidence; new audit code is reviewed through the PR diff.",
"files": {
"evidence/five_stage_lean_receipt.json": "195df11c9eb43f56a671bd5f90c96f810bac8ea954cde85dc44c100e04190604",
"evidence/five_stage_openai_origin.json": "ee6e89f2a099324c21da1e7385d2b5c82b64cdbfd225f91e076cd1c8320738c9",
"evidence/five_stage_regeneration_receipt.json": "a47ada8a3095ce1ffc58c43dac9d7dd564069caee184c6f0af4dd830af94a8e4",
"evidence/logs/axioms.log.gz": "c9811ae280c91401bf56660ca3d56fcda28ceee727fb7ab633925278aff0c25d",
"evidence/logs/build.log.gz": "d25a3cf89b770b7a0c7f0ad32adbf2a960d195eb557a3254103e07f39d6326c4",
"evidence/logs/compare_fourier.log.gz": "b379cde884336eb5139bbbd3ab46883e66bc9058390a9223b2c318d61a4c2598",
"evidence/logs/compare_wht.log.gz": "0fc07ebd9dfbaeb4ff419cb4e31a068a69a1075bf3af730d183e9a2e659dfbc1",
"evidence/logs/regenerate_certificate.log.gz": "fe780019ca79162cfcd68e284d73db0d79456715e9c55298e58449cf1954c7e2",
"evidence/logs/regenerate_fourier.log.gz": "6ed176c454f047733b22fed8c76c1f9966b630edd8f9e4c0291b3f0b36ad0a1c",
"evidence/logs/regenerate_program.log.gz": "3f2e7bae2862b423d3bdcf2b00f889763bde77a7aa79a1da14eef83f474adb8e",
"evidence/logs/toolchain.log.gz": "f0d1c3b28558d3555ba5e0322441cbcbcdc20b163d531a1ac14b5e0ace4bcf57",
"evidence/pr256_source_files.json": "3a8341035c7ef0ede3d8d43812aa4bb2ffc78287c8c3424d74b4b98cb8bb7103",
"evidence/proof_source_files.json": "6010ff79f3128533fddc076e223225d58b59d22761746b6119f7ccfd51071ac9",
"expected.json": "295a3f5c0e6843db7fec76b25609d93e0a7aeb60fb79c394e1851ebb6a8789f1",
"inputs/FOURIER_NOTICE": "9419dd03a2f52cf8bdfc4d18216ce29f263ab583b27f01ced8e420985bcb7c81",
"inputs/LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4",
"inputs/SOURCE.json": "00f5689fba8d1edc1741376c14a5ad6cdf5e0718dd24af9881949a6bc7cd2cf1",
"inputs/fourier-proof-source.tar.gz": "871f47a16d2571dbcebc2ef61914e85d96b7b44f6d59579da246e13294d5658b",
"inputs/gcert-program-233/NOTICE": "c1c95d22cfb0f455aca64b4bee4cab900829641b8f041280e7aa88034491c87d",
"inputs/gcert-program-233/SOURCE.json": "9ce463476af549c04de4705b1bf0c8f7f18d473dc0817883066ad5e2136d90b5",
"inputs/gcert-program-233/certificate/expected.json": "c0e3d245bf7e458ff86288eb47672491c9efee28181b570f1a3f17c8d915f766",
"inputs/gcert-program-233/certificates/gcert1-p11-pr233-flow.json.gz": "09ceba1c0ea17282da155b937c8463669b913443c20f45fe2a7e6e024cb2d33a",
"inputs/gcert-program-233/gx/gx.py": "6f3dc8bb639933227a8dae181ec4a542e85c7276be9c9e330f49518e7b630b95"
},
"schema": 1
}
28 changes: 28 additions & 0 deletions research/pr256-fourier-audit/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
PR256 program / Fourier-proof reproduction audit
Copyright 2026 Ryan Shea. New audit code and documentation: Apache-2.0.
Prepared with substantial OpenAI Codex assistance.

This work adapts the checks and retains the original reproduction evidence from
shea256/fourier-transform-below-nlogn at a101b363b38e6bf7d309042c94ba5fa18a424fad.
It contributes source/program/proof consistency checks and a separate reproduction,
not a new exponent, network, formal framework, or proof of integer multiplication.

OpenAI supplies the original exact arithmetic model and Fourier reduction. Doug
Colkitt supplies early parameter/network work and the community repository; Rohan
Arun and Swapnil Jain supply earlier community improvements and the research lineage.
Jacob Sussman supplies the five-stage geometry, frame formalization, certificate
format/checker, and formal Fourier framework. Chafik Boukhalfa supplies the PR200/233
pairing, PR256 explicit program, and the stronger instantiation of that framework.
The circuit retains icekylinx's source-assisted construction, eumemic's v4 modules,
Avi Eisenberg's reconstruction/pairing, an664's sharing work, and the earlier
contributors named in the preserved source notices. The incoming package credits
SovereignSteak and hcg890 for five-stage composition and ledger work.

inputs/gcert-program-233/NOTICE and inputs/FOURIER_NOTICE are retained byte for byte;
inputs/LICENSE accompanies them. The complete proof archive retains its licenses,
notices and source-specific OpenAI attribution. Do not reinterpret this audit as
authorship of the imported constructions or proofs.

Metadata clarification: PR209 was contributed by Jacob Sussman and PR237 by Rohan
Arun. The PR256 notice groups those numbers with Rohan Arun; the original notice
is preserved unchanged. This note supplies the checked attribution alongside it.
123 changes: 123 additions & 0 deletions research/pr256-fourier-audit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# PR256 complex program: reproduction and proof consistency audit

This adds a separate reproduction of Chafik Boukhalfa's PR256 and its instantiation
of Jacob Sussman's Lean framework. **No new multiplication kappa, network, or
Fourier exponent is claimed.** The contribution is a reproducible audit linking
the two source packages, exact arithmetic checks, and retained build evidence.

## Pinned sources

| Source | Revision | Role |
| --- | --- | --- |
| [CrocSwap PR256](https://github.com/CrocSwap/integer-mult-bounds/pull/256) | `db3f75cdc5f03f3131d48fb220f6bf1958404ff3` | Explicit complex program and source regeneration |
| [Fourier proof PR2](https://github.com/jacobalansussman/wht-power-saving-lean/pull/2) | `fd19e46b728faa414cbfbf91b01a6a0b7903375d` | Sussman's framework with Boukhalfa's PR233 instantiation |
| [OpenAI formal sources](https://github.com/openai/math/tree/fd4aeeb2ee4fc729c18d98444fed42fd0529eeeb/lean) | `fd4aeeb2ee4fc729c18d98444fed42fd0529eeeb` | Original model, Fourier reduction, and challenge |
| [Downstream reproduction](https://github.com/shea256/fourier-transform-below-nlogn/tree/a101b363b38e6bf7d309042c94ba5fa18a424fad) | `a101b363b38e6bf7d309042c94ba5fa18a424fad` | Ryan Shea's checks, source audit, and build receipts |

The proof extends Sussman revision `f010392c923279e3dd59ef3aa5fedad23affc5fd`.
Lean is 4.34.1; Mathlib is `d13f23b723b8a846827a245b89c10fc7d3f11612`.
The complete 456-file proof source archive is included, without compiled objects.
Only the PR256 inputs needed for the finite audit are copied here; its complete
producer is available at the pinned revision above. Original notices are retained.

## Offline finite audit

From the repository root, using Python 3.11 or later and no third-party packages:

```sh
python3 -B research/pr256-fourier-audit/verify.py
python3 -B research/pr256-fourier-audit/test_audit.py
```

The first command:

1. Checks source pins and runs Sussman's unmodified `gx.check1` on the explicit
PR233 program: 12,052 registers, 18,248 frames, 52,300 gates, and 69,683
invocation blocks. Exact scalar replay covers all source columns; restoration
of arbitrary dirty scratch is supplied by the Lean invocation theorem.
2. Reconstructs the five-stage histogram and checks `m=110`, `W=14692`, rank
1613040, deficit 3080, 358975 children and maximum child width 46.
3. Independently bounds the normalized moment using exact rational logarithm and
exponential enclosures at `a=7547361/10^10`. It checks the Lean engine's
finite-fill correction at `s=40`, the positive Fourier gap
`a - delta = 1/10^10`, and failure at `7547365/10^10` for this histogram.
4. Requires the PR256 and Lean programs to agree in every mathematical field
(only the descriptive `derived_from` string differs), then checks the Lean
histogram and exponent literals. It compares the Fourier challenge with the
original after accounting for comments, seven renamed declarations and the
stronger exponent.
5. Checks all 89 imported OpenAI Lean modules, the original challenge and the
toolchain against the 91-file origin ledger. These were fetched separately
from the immutable OpenAI revision during the recorded source audit.
6. Binds the historical reproduction receipts to their compressed logs and all
456 archived source hashes. Checking a recorded receipt does not rerun Lean.

Optional full-checkout comparisons require no network:

```sh
python3 -B research/pr256-fourier-audit/verify.py \
--program-source /path/to/pr256-checkout \
--proof-source /path/to/pinned-fourier-checkout \
--openai-source /path/to/pinned-openai-checkout
```

They compare the 20 program-package files, 456 proof-source files and 91 original
OpenAI files with the pinned ledgers, irrespective of the checkout's branch name. The default audit
does not rerun the producer or a full Clifford/DFT computation.

## Reproducing the Lean build

Install `leanprover/lean4:v4.34.1`, then run:

```sh
python3 -B research/pr256-fourier-audit/reproduce_lean.py \
--work-dir /tmp/pr256-lean-rebuild --lake lake --threads 2 \
--receipt /tmp/pr256-lean-rebuild-receipt.json
```

This extracts the complete pinned source (or checks existing source bytes),
downloads the pinned Mathlib cache, regenerates the 41 certificate and 14
Fourier-chain files, builds the proof, audits axioms, and runs upstream
`tools/Compare.lean` for WHT, DFT and convolution. The two large scalar reductions
are staged sequentially to reduce peak memory. Allow several GB of storage and
substantial memory; the recorded reproduction used a 32 GiB macOS arm64 machine.

The original fresh project build passed in 2625.5 seconds, with Mathlib's compiled
cache. The WHT and Fourier comparisons passed in 33.7 and 42.6 seconds. The three
audited final theorems used only `propext`, `Classical.choice`, and `Quot.sound`.
The original combined build temporarily paused one large scalar reduction until
the other completed; it then resumed successfully, without changing source.
The script now stages those targets sequentially. The receipt retains the actual
original commands and is not relabeled as a new run.

The full PR256 producer regeneration also passed (188.6 seconds), using Python
3.11, NumPy 2.3.5 and SciPy 1.17.0. To rerun that separately:

```sh
git clone https://github.com/chafreaky/integer-mult-bounds /tmp/pr256-source
git -C /tmp/pr256-source checkout --detach db3f75cdc5f03f3131d48fb220f6bf1958404ff3
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 \
uv run --python 3.11 --with numpy==2.3.5 --with scipy==1.17.0 \
python -B /tmp/pr256-source/research/gcert-program-233/verify.py
```

## What this establishes for multiplication

| Evidence | Established scope | Multiplication obligations remaining |
| --- | --- | --- |
| Exact program and histogram checks | The pinned finite complex program and its five-stage accounting agree with the formal input | No bit-side construction or outer multiplication assembly is checked here |
| Lean project and statement comparisons | The upstream WHT and all-length exact DFT/convolution theorems in OpenAI's family-130 RAM model | Finite precision/recovery, bit costs, fixed-tape implementation and the inherited multiplication-specific all-size interfaces are not proved |
| OpenAI source comparison | Imported model/reduction files match the identified OpenAI revision | Human assessment of formal statements and assumptions remains separate |
| Receipt and log hashes | The recorded successful runs are bound to these sources | Hashes alone do not independently attest that an execution occurred |

The Fourier theorem has `delta=7547360/10^10`. It is an exact-complex-arithmetic
result with supplied roots and unrestricted coefficients, not a multiplication
theorem or practical FFT benchmark. The historical reproduction ran neither the
official Linux comparator nor a second kernel and is not independent human
mathematical review. Boukhalfa later reported official-comparator success in
[`837dc313`](https://github.com/chafreaky/wht-power-saving-lean/commit/837dc3130adc79f7b7ab4ddd56c15576bbd766b0);
that documentation-only update is distinct from this pinned local reproduction.

See [NOTICE](NOTICE) for attribution and [VALIDATION.md](VALIDATION.md) for the
checks of this contribution. The root selected result and all existing witnesses
remain unchanged.
42 changes: 42 additions & 0 deletions research/pr256-fourier-audit/VALIDATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Validation of this audit contribution

Prepared against CrocSwap main `3b6b66891c0ac888521cf591fe306c6286601d4f`.
This is a separate AI-assisted reproduction, not independent human mathematical
review. The bound and proof remain the credited upstream authors' results.

## Audit package

- Offline finite verifier: passed on Python 3.11, 3.13 and 3.14.
- Eleven audit controls (two positive and nine negative): passed; altered stock/child counts, an unrecorded
exponent, a weakened quantifier, an extra axiom, a missing build, a wrong source
revision and a changed build log are rejected. Optimized Python is refused.
- Full-checkout comparison: all 20 pinned PR256 package files and all 456 proof
source files matched the separate checked-out revisions.
- OpenAI origin: all 91 ledger files were downloaded again from the immutable
OpenAI revision and matched, including all 89 imported OAI modules.
- Ported Lean reproduction wrapper: passed against the existing pinned build,
with `--cache-ready`. Both source generators reproduced their output; staged
scalar targets, combined build, axiom check, WHT comparison and Fourier
comparison all exited 0. This wrapper test reused the project build and is not
a second fresh build. The retained historical receipt records the earlier
successful fresh project compilation.
- Source syntax and whitespace checks passed.

## Existing repository checks

`make entrance-bank-verify` passed: selected-record validation, the complete
offline complex/bit construction, all 47 outer constraints, seven margins,
21 assembly controls, and the bank scheduling supplement.

The full `make verify` regression run was invoked. At submission, its community,
producer, partial-gauge, three-stage-cover and paired-cube groups have passed;
the remaining groups are still pending. This is not a claim that the full suite
has passed. No existing source, certificate, selected-result pointer or root
documentation is changed by the contribution.

## CI scope

The added workflow repeats the offline finite audit and audit controls on
Ubuntu with Python 3.11, 3.13 and 3.14. It does not claim to run Lean or a second
kernel; full proof reproduction is the separate documented command. Configuring
the workflow does not itself constitute a successful CI run.
135 changes: 135 additions & 0 deletions research/pr256-fourier-audit/evidence/five_stage_lean_receipt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"axioms": {
"OAI.PowerSaving.RAM.hillsY_program": [
"Classical.choice",
"Quot.sound",
"propext"
],
"OAI.PowerSaving.convolution_mainY": [
"Classical.choice",
"Quot.sound",
"propext"
],
"OAI.PowerSaving.transform_mainY": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"commands": [
{
"command": [
"/tmp/fourier-lean-toolchain/lean-4.34.1-darwin_aarch64/bin/lake",
"--version"
],
"exit_code": 0,
"label": "toolchain",
"log_sha256": "36526a338068c343bedff5daa38fec328b4f722df1e8f0b5d026d4f0f908f3a3",
"seconds": 0.246
},
{
"command": [
"/opt/homebrew/opt/python@3.14/bin/python3.14",
"-B",
"tools/gx/regen_check.py",
"tools/certificate/gcert1-p11-pr233-flow.json.gz",
"P233",
"B2Gp233"
],
"exit_code": 0,
"label": "regenerate_certificate",
"log_sha256": "76952939fe619d8f344c0f88579f25929a183bd57b5e58fe974fec990f644d77",
"seconds": 28.829
},
{
"command": [
"/opt/homebrew/opt/python@3.14/bin/python3.14",
"-B",
"tools/fourier/regen_check233.py"
],
"exit_code": 0,
"label": "regenerate_fourier",
"log_sha256": "eee7ec63261d1ab58a527ada9ee3d47adfabb06385b49925fb831fbb74c0cb4e",
"seconds": 0.107
},
{
"command": [
"/tmp/fourier-lean-toolchain/lean-4.34.1-darwin_aarch64/bin/lake",
"build",
"Work.GCert.Data.ChallengeB2Gp233x",
"Work.GCert.Data.SolutionB2Gp233x",
"Work.Fourier233.UniformFourierChallenge",
"Work.Fourier233.Main",
"Work.Fourier233.Axioms"
],
"exit_code": 0,
"label": "build",
"log_sha256": "3e3f4b0f0f9a8c95ede2da69d08615bbc5ff763c5a06cc460b9f3f292153d783",
"seconds": 2625.459
},
{
"command": [
"/tmp/fourier-lean-toolchain/lean-4.34.1-darwin_aarch64/bin/lake",
"env",
"lean",
"Work/Fourier233/Axioms.lean"
],
"exit_code": 0,
"label": "axioms",
"log_sha256": "fd6ef1a75394038e0035b143c1135f4a4d0a6129982ac741bc8c80ebd3c145bd",
"seconds": 6.3
},
{
"command": [
"/tmp/fourier-lean-toolchain/lean-4.34.1-darwin_aarch64/bin/lake",
"env",
"lean",
"--run",
"tools/Compare.lean",
"Work.GCert.Data.ChallengeB2Gp233x",
"Work.GCert.Data.SolutionB2Gp233x",
"OAI.PowerSaving.WHT.wht_main_block_B2Gp233x"
],
"exit_code": 0,
"label": "compare_wht",
"log_sha256": "a1300346aee4d7a36791f6d5772969e772aa86d7d36ba9777dc521ec94ecc4f8",
"seconds": 33.7
},
{
"command": [
"/tmp/fourier-lean-toolchain/lean-4.34.1-darwin_aarch64/bin/lake",
"env",
"lean",
"--run",
"tools/Compare.lean",
"Work.Fourier233.UniformFourierChallenge",
"Work.Fourier233.Main",
"OAI.PowerSaving.transform_mainY",
"OAI.PowerSaving.convolution_mainY"
],
"exit_code": 0,
"label": "compare_fourier",
"log_sha256": "48ff3e708c9c38926a39ffd94f761d33245a6abe9aa5749e7233e8f14657fa97",
"seconds": 42.588
}
],
"finished_utc": "2026-10-10T03:12:13.637233+00:00",
"fresh_project_build": true,
"independent_human_review": false,
"independent_kernel_run": false,
"machine": "arm64",
"mathlib_commit": "d13f23b723b8a846827a245b89c10fc7d3f11612",
"mathlib_from_cache": true,
"numerical_dft_executed": false,
"official_comparator_run": false,
"platform": "macOS-26.6.2-arm64-arm-64bit-Mach-O",
"schema": 1,
"source_archive_sha256": "871f47a16d2571dbcebc2ef61914e85d96b7b44f6d59579da246e13294d5658b",
"source_commit": "fd19e46b728faa414cbfbf91b01a6a0b7903375d",
"source_files_checked": 456,
"started_utc": "2026-10-10T02:26:36.346772+00:00",
"statement_comparison": "upstream tools/Compare.lean; WHT, all-length DFT and convolution passed",
"success": true,
"threads": 2,
"toolchain": "Lake version 5.0.0-src+5045d00 (Lean version 4.34.1)"
}
Loading