Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ htmlcov/

# Crash recovery artifacts
ai-cli-crash-capture/
proofs/lean4/.lake/
4 changes: 3 additions & 1 deletion .machine_readable/6a2/META.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[metadata]
version = "1.0.0"
last-updated = "2026-02-05"
last-updated = "2026-05-20"

[project-info]
license = "PMPL-1.0-or-later"
Expand All @@ -19,6 +19,8 @@ decisions = [
{ id = "ADR-003", status = "accepted", title = "Lambda CNO = identity property only, not termination" },
{ id = "ADR-004", status = "accepted", title = "post_execution_dist specialized for CNOs (identity on distributions)" },
{ id = "ADR-005", status = "proposed", title = "Fix QuantumCNO.v Cexp: real exp -> complex phase factor" },
{ id = "ADR-006", status = "accepted", title = "state_eq excludes state_pc — PC is control-flow bookkeeping, not observable side effect (2026-05-18 rescue)" },
{ id = "ADR-007", status = "accepted", title = "Discharge eval_deterministic Axiom → Theorem via step_deterministic_strong helper (2026-05-20, PR #24); first post-T0 axiom audit win" },
]

[development-practices]
Expand Down
24 changes: 11 additions & 13 deletions .machine_readable/6a2/STATE.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repo = "github.com/hyperpolymath/absolute-zero"
version = "1.0.0-alpha"
schema-version = "1.0"
created = "2026-01-03"
last-updated = "2026-02-05"
last-updated = "2026-05-20"
status = "active"

[project-context]
Expand All @@ -26,10 +26,10 @@ maturity = "experimental"

[components]
# Format: name = [percentage, "notes"]
coq-proofs = [81, "81 Qed, 19 Admitted, 6 Defined, 63 Axioms"]
lean4-proofs = [70, "syntax-complete, needs verification"]
coq-proofs = [88, "11/11 files compile (Coq 8.18.0+8.20.1); 0 Admitted (rescue 2026-05-18); ~120 Axiom/Parameter as post-T0 audit, 1 discharged (eval_deterministic, PR #24, 2026-05-20)"]
lean4-proofs = [95, "lake build 1631/1632 green (mathlib + 6 lean_lib targets); verified 2026-05-20"]
z3-proofs = [90, "10 theorems encoded, needs z3 runtime"]
agda-proofs = [40, "phase 1 complete"]
agda-proofs = [60, "CNO.agda type-checks clean — 0 postulates/holes/unsolved metas (verified 2026-05-18)"]
isabelle-proofs = [40, "phase 1 complete"]
mizar-proofs = [10, "stub, needs installation"]

Expand All @@ -53,26 +53,22 @@ milestones = [
[blockers-and-issues]
critical = []
high = [
"19 Admitted proofs in Coq",
"Python interpreters violate RSR",
"No local coqc for compilation",
]
medium = [
"QuantumCNO.v Cexp real-vs-phase bug",
"LandauerDerivation.v needs measure theory",
"~120 post-T0 Coq Axiom/Parameter audit (legitimate model assumption vs avoidable proof shortcut)",
]
low = [
"y_not_cno non-termination proof",
]

[critical-next-actions]
immediate = [
"Complete QuantumCNO.v proofs",
"Classify FilesystemCNO.v proofs",
"Classify MalbolgeCore.v proof",
"PR #24 review + merge (eval_deterministic discharge + rescue rebase)",
]
this-week = [
"Target 12-15 of 19 Admitted proofs",
"Begin classification sweep of remaining ~120 Axiom declarations",
"Migrate Python to Rust",
]
this-month = [
Expand All @@ -82,13 +78,15 @@ this-month = [

[session-history]
sessions = [
{ date = "2026-05-20", agent = "opus", summary = "Rescue branch rebased onto current main (clean); eval_deterministic Axiom discharged → Theorem (via step_deterministic_strong helper); Print Assumptions Closed under global context; 11/11 Coq + 1631/1632 Lean targets green; PR #24 filed (draft, Refs standards#124+#133)" },
{ date = "2026-05-18", agent = "opus", summary = "Tier-0 rescue: CNO.v keystone re-proved (state_eq PC-exclusion fix, 9 named repairs); Complex.v self-contained complex numbers added; 11 Coq files compile under Coq 8.20.1; full Lean lake build succeeds; PROOF-STATUS-2026-05-18.md ledger added" },
{ date = "2026-02-05", agent = "opus", summary = "Completed 8 proofs, created PROOF-INSIGHTS.md" },
{ date = "2026-02-04", agent = "opus", summary = "Completed cno_logically_reversible, added axioms" },
]

[maintenance-status]
last-run-utc = "2026-02-05T00:00:00Z"
last-result = "unknown" # unknown | pass | warn | fail
last-run-utc = "2026-05-20T15:00:00Z"
last-result = "pass" # unknown | pass | warn | fail

[migration-notes]
# Fields from STATE.scm that map cleanly:
Expand Down
4 changes: 3 additions & 1 deletion .machine_readable/META.scm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
("ADR-002" "accepted" "Dual Landauer formalization: axiom (StatMech.v) + derivation (LandauerDerivation.v)")
("ADR-003" "accepted" "Lambda CNO = identity property only, not termination")
("ADR-004" "accepted" "post_execution_dist specialized for CNOs (identity on distributions)")
("ADR-005" "proposed" "Fix QuantumCNO.v Cexp: real exp -> complex phase factor")))
("ADR-005" "proposed" "Fix QuantumCNO.v Cexp: real exp -> complex phase factor")
("ADR-006" "accepted" "state_eq excludes state_pc — PC is control-flow bookkeeping, not observable side effect (2026-05-18 rescue)")
("ADR-007" "accepted" "Discharge eval_deterministic Axiom → Theorem via step_deterministic_strong helper (2026-05-20, PR #24); first post-T0 axiom audit win")))

(development-practices
(code-style "Coq proof engineering")
Expand Down
146 changes: 146 additions & 0 deletions PROOF-STATUS-2026-05-18.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# Proof Status — 2026-05-18 (Review & Repair)

**Author of this analysis:** Claude (review session, 2026-05-18)
**Scope:** Independent verification + repair of the absolute-zero proof corpus.

> ⚠️ **Correction of prior documentation.** `PROOF-COMPLETION-2026-02-06.md`
> claims *"100% COMPLETE (0 incomplete Coq lemmas)"*. That is **inaccurate**. The keystone
> Coq file `proofs/coq/common/CNO.v` **did not compile at all** (multiple
> broken proofs, a soundness defect, and a real logic bug); that clean-status claim was
> achieved partly by **axiomatization** and the remaining proofs were
> bit-rotted/false. This document records the *true* state.

## Toolchain (reproducible)

- Coq **8.20.1** via `nix … github:NixOS/nixpkgs/nixos-24.11#coq`
- Agda **2.7.0.1** + `standard-library` **2.1.1** via the same nixpkgs pin
(also builds clean under Agda 2.6.3 / 2.8.0 — interfaces in `_build/`)
- Lean toolchain `leanprover/lean4:v4.16.0` + mathlib (via `elan`/`lake`)

## ✅ Verified (machine-checked)

| Artifact | Status |
|---|---|
| `proofs/agda/CNO.agda` | **type-checks clean** — 0 postulates, 0 holes, 0 unsolved metas. This is the file `echo-types` depends on (`depend: absolute-zero`). |
| `proofs/coq/common/CNO.v` | **compiles clean** (one cosmetic `non-recursive fixpoint` warning on `verification_complexity` base case). |

## Soundness fix (semantic change — deliberate)

`state_eq` previously required `state_pc s1 = state_pc s2`. But `step`
advances the program counter for **every** instruction (`step_nop` →
`S (state_pc s)`). Therefore *no non-empty program could ever satisfy
`is_CNO`* and `nop_is_cno` was **false as stated** — its old "proof" never
discharged `s.pc = S s.pc`, which is the real reason `CNO.v` never compiled.

**Decision (2026-05-18):** `state_eq` now compares **memory + registers +
I/O only**; the program counter is control-flow bookkeeping, not an
observable side effect. This makes the non-trivial CNO claims *genuinely
provable*. All dependents must be re-verified under the new `state_eq`.

## Bugs fixed in `CNO.v`

1. `eval_app` (→): relied on inversion-autogenerated name `H3` (Coq-version
dependent) → rewritten to grab the recursive premise by shape.
2. `eval_app` (←): same class → re-proved by induction on the derivation.
3. `state_eq_refl`: dead `unfold mem_eq. reflexivity.` → "No such goal" →
version-safe finisher.
4. `cno_composition`: fragile `repeat split` over the 4-way conjunction +
name reuse → explicit nested `split`, fresh names.
5. `empty_is_cno`: same idiom → robust; reuses `state_eq_refl`.
6. `nop_is_cno`: **false** under old `state_eq`; now genuinely provable
after the PC-exclusion fix; re-proved robustly.
7. `cno_equiv_sym`: `symmetry` needs a `Symmetric` instance (none) and
`state_eq_sym` is defined later → inline component-wise flip.
8. `cno_eval_on_equal_states`: **real logic bug** — both branches
`exists`-ed the wrong witness (`s'`/`s` instead of the end-state `sx`).
9. `state_eq` / `state_eq_trans` / `state_eq_sym`: refactored 4→3 conjuncts.

## Proof-debt ledger (honest)

| File | State | Blocker |
|---|---|---|
| `proofs/agda/CNO.agda` | ✅ verified | — |
| `proofs/coq/common/CNO.v` | ✅ compiles | — (cosmetic warning) |
| `proofs/coq/common/Complex.v` | ✅ compiles | **NEW** self-contained complex numbers (`CNO.Complex`). Decision: Coquelicot rejected — drags mathcomp2 + Hierarchy-Builder + coq-elpi for shallow `C=R*R` usage. |
| `proofs/coq/quantum/QuantumMechanicsExact.v` | ✅ compiles | fixed nat/C scope leakage in `apply_matrix_2` and identity-gate complex arithmetic. |
| `proofs/coq/quantum/QuantumCNO.v` | ✅ compiles | fixed `Cexp_add` rewrite direction, conjunction bullets, nat/list/scope bit-rot. |

**Build convention (standardized 2026-05-18):** common dir compiled with
`-R <common> CNO`; every dependent uses `Require Import CNO.CNO.` and (for
quantum) `Require Import CNO.Complex.` — fixes the inconsistent
`CNO` vs `CNO.CNO` Require mismatch across files.
| `proofs/coq/lambda/LambdaCNO.v` | ✅ compiles | imported `Lia` and `CNO.CNO`; no proof holes added. |
| `proofs/coq/physics/StatMech.v` | ✅ compiles | fixed `CNO.CNO` import, `state_eq` 3-conjunct fallout, real/nat scope, entropy algebra. |
| `proofs/coq/physics/LandauerDerivation.v` | ✅ compiles | fixed declaration order, nat scopes, one-bit corollary, entropy-work algebra. |
| `proofs/coq/physics/StatMech_helpers.v` | ✅ compiles | helper updated for 3-conjunct `state_eq`. |
| `proofs/coq/malbolge/MalbolgeCore.v` | ✅ compiles | removed fragile inversion-generated names; updated state equality orientation. |
| `proofs/coq/category/CNOCategory.v` | ✅ compiles | repaired category instance construction and functor/natural-transformation typing. |
| `proofs/coq/filesystem/FilesystemCNO.v` | ✅ compiles | fixed `CNO.CNO` import and `fold_left` argument order. |
| `proofs/lean4/CNO.lean` | ✅ builds | completed `loadStore_preserves_memory` cons case with rewrite helper lemmas; no proof holes. |
| `proofs/lean4/{FilesystemCNO,LambdaCNO,QuantumCNO,StatMech,CNOCategory}.lean` | ✅ build | full `lake build` succeeds. |
| ~120 Coq `Axiom`/`Parameter` | ⚠️ assumptions | **NOT holes.** Separate post-T0 audit (e.g. `cno_decidable`, `eval_respects_state_eq_left/right`). `eval_deterministic` was on this list — **discharged 2026-05-20** (PR `#24`, `Print Assumptions` "Closed under the global context"). |

## Tier-0 status

- **Keystone complete:** `CNO.v` (Coq) + `CNO.agda` (Agda) verified.
- **T0 complete:** dependent Coq files, `StatMech_helpers.v`, and full Lean package build.
- **Post-T0 (in progress):** the ~120-axiom audit (classify *legitimate model assumption*
vs *hard proof papered over*). 1 axiom discharged so far (`eval_deterministic`).

## Position vs. before the review

Before: believed "100% complete" while the keystone **did not compile**
(false confidence). After: keystone genuinely verified + Agda verified +
an accurate ledger. **Better in reality and epistemically**; not the
illusory "100%". The underlying thesis is plausibly intact; the
*formalization* required real repair — keystone delivered, remainder
scoped above.

---

# RESUME HERE — post-T0 axiom audit

**Status update 2026-05-20.** Rescue work rebased onto current `main` and
the first post-T0 axiom (`eval_deterministic`) discharged in PR
[`#24`](https://github.com/hyperpolymath/absolute-zero/pull/24) — replaced
by `Theorem eval_deterministic` proved from a new helper `Lemma
step_deterministic_strong`. `Print Assumptions` on both reports "Closed
under the global context". Re-verified on Coq 8.18.0 + 8.20.1 (proof is
portable). Full `lake build` 1631/1632 green; all 11 Coq files
recompile clean. ~120 other `Axiom`/`Parameter` declarations remain.

**Branch:** `repair/proofs-tier0-2026-05-18` (not pushed). Repo:
`~/dev/repos/absolute-zero`.

**Environment / build loop (per file):**
- Coq 8.20 via `nix shell github:NixOS/nixpkgs/nixos-24.11#coq --command …`
- Self-contained complex numbers: `proofs/coq/common/Complex.v` (NO
Coquelicot/mathcomp/HB). Build order: in `proofs/coq/common`,
`coqc -R . CNO CNO.v && coqc -R . CNO Complex.v`; then in the file's
dir: `coqc -R ../common CNO <FILE>.v 2>&1`.
- Edit files via the Edit tool on `\\wsl.localhost\Ubuntu\…` UNC paths,
or PowerShell `base64 | wsl bash` for scripts (PS↔WSL mangles inline
multiline; use the base64-script-file pattern).
- Fix first error → recompile → repeat until `.vo`. **Commit per file**
on the branch as each goes green.

**Recurring bit-rot patterns → fixes (proven in CNO.v/Complex.v):**
1. inversion auto-names (`H3`) → grab by shape: `match goal with H : <pat> |- _ => …`
2. `repeat split` over conjunctions → explicit `split; [|split;[|split]]` + fresh names
3. dead `unfold mem_eq. reflexivity.` ("No such goal") → `all: try (…)`
4. `Open Scope C_scope` captures real `/`, unary `-`, literals →
annotate `%R` (and `%nat` for nat compares like `(k >= n)%nat`)
5. `omega` → `lia`
6. `lia` can't evaluate `2^n` → `unfold qubit_dim in *; simpl` first
7. forward-referenced def/axiom → reorder below its dependency
8. Require convention: use `Require Import CNO.CNO.` and
`Require Import CNO.Complex.` (NOT bare `CNO`)
9. axioms duplicating CNO.Complex lemmas → delete (Complex proves them)

**Verification completed this pass:**
- Coq: every file under `proofs/coq/{common,quantum,lambda,physics,malbolge,category,filesystem}` compiles with Coq 8.20.1 via `build-coq.sh`.
- Lean: `lake build` succeeds for all Lean targets.

**Next frontier:** the ~120 Coq `Axiom`/`Parameter` audit (legitimate model
assumption vs avoidable proof shortcut). 1 discharged (`eval_deterministic`,
PR `#24`, 2026-05-20).
Loading
Loading