Skip to content

Commit c233752

Browse files
feat(coq): prove the reversibility↔CNO bridge MAA cites (A2, zero axioms) (#109)
## What & why The theorem `hyperpolymath/maa-framework` (aletheia) cites — the general reversibility↔CNO characterisation — did not exist at the general level (only a filesystem-specific instance). This lands it in `proofs/coq/common/CNO.v`, machine-checked under `coqc 8.18.0`, with **every new result `Closed under the global context` (zero project axioms)**. ## New results (all axiom-free) - `reverses` / `reversible_iff_exists_reverses` — the repo's one-sided `reversible` is exactly "∃ a left inverse". - `reverses_seq_computes_identity` — **core lemma**: a left inverse sequenced after `p` computes the state-identity on every composite transition (via `eval_app` + the existing `eval_deterministic`). - `cno_equiv_seq_empty_of_reverses` — repackaged as `cno_equiv (p ;; p_inv) []` (CNO-equivalence to the canonical no-op). - `reversible_bridge_forward` — the faithful **forward** direction of the aletheia contract: a **two-sided** inverse makes *both* composites `cno_equiv _ []`. - `reversible_bridge_backward_upto` — the **backward** direction, necessarily up to `=st=`, with an explicit `p_inv`-termination hypothesis. - `eval_nil_eq` — small helper (`eval [] s s' → s' = s`). ## Honesty finding (this is the valuable part) The literal `reversible p ↔ ∃ p_inv, is_CNO (p;;p_inv) ∧ is_CNO (p_inv;;p)` is **not** provable under these definitions and is deliberately **not** asserted: 1. `is_CNO` also demands purity and totality-everywhere — a `reversible` program need not have either — so "≡ CNO" is faithfully rendered by `cno_equiv _ []` (the identity-on-state component). 2. `state_eq` (`=st=`) excludes the program counter while `eval` propagates it (the `eval_respects_state_eq_*` axioms were removed as **unsound** on 2026-05-20), forcing the backward direction to be up-to-`=st=`. 3. The repo's `reversible` is one-sided; the aletheia contract is two-sided. **Takeaway for aletheia:** state the contract two-sided and `=st=`-relative. Documented in the in-file section header and `PROOF-STATUS.adoc`. ## Verification - From-scratch `coq_makefile -f _CoqProject && make` builds **14/14 theories, zero errors**. - `Print Assumptions` on all five new results → **"Closed under the global context"**. - Lean mirror deferred (needs Mathlib @ v4.16.0). ## Context Task **A2** of the estate assessment — the one still-open Phase A proof item after PR #100 landed OND-1..5 and discharged the filesystem/quantum-existence axioms. Docs updated: `PROOF-STATUS.adoc` (new bridge subsection), `ROADMAP.adoc` (Milestone 1 checkbox). Draft pending human review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015qwVESTcbfanY2iJPQNoSz --- _Generated by [Claude Code](https://claude.ai/code/session_015qwVESTcbfanY2iJPQNoSz)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3b592a5 commit c233752

3 files changed

Lines changed: 167 additions & 6 deletions

File tree

PROOF-STATUS.adoc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,37 @@ assumed. `Print Assumptions` on every headline theorem shows only Coq stdlib axi
8686
(`ClassicalDedekindReals.*`, `functional_extensionality*`) plus, where relevant, the
8787
explicitly-tagged postulate above — never a hidden project axiom.
8888

89+
=== Reversibility <-> CNO bridge (2026-07-16, the theorem MAA cites)
90+
91+
`proofs/coq/common/CNO.v` now carries the bridge between `reversible` and the
92+
"composes to a no-op" characterisation the MAA framework (aletheia) cites. All five
93+
new results are **`Closed under the global context` (zero axioms)**:
94+
95+
* `reversible_iff_exists_reverses` — the repo's `reversible` is exactly "exists a
96+
one-sided left inverse" (`exists p_inv, reverses p p_inv`).
97+
* `reverses_seq_computes_identity` — the core lemma: a left inverse sequenced after
98+
`p` computes the state-identity on every composite transition (via `eval_app` +
99+
`eval_deterministic`).
100+
* `cno_equiv_seq_empty_of_reverses` — repackaged as `cno_equiv (p ;; p_inv) []`
101+
(CNO-equivalence to the canonical no-op).
102+
* `reversible_bridge_forward` — the faithful *forward* direction of the aletheia
103+
contract: a **two-sided** inverse makes *both* composites CNO-equivalent to the
104+
no-op.
105+
* `reversible_bridge_backward_upto` — the *backward* direction, **necessarily up to
106+
`=st=`**, with an explicit `p_inv`-termination hypothesis.
107+
108+
*Honesty note.* The literal biconditional
109+
`reversible p <-> exists p_inv, is_CNO (p;;p_inv) /\ is_CNO (p_inv;;p)` is **not**
110+
provable under these definitions, and is deliberately *not* asserted: (1) `is_CNO`
111+
also demands purity and totality, which a `reversible` program need not have — so
112+
"=== CNO" is rendered by `cno_equiv _ []` (the identity-on-state component); (2)
113+
`state_eq` excludes the program counter while `eval` propagates it (the
114+
`eval_respects_state_eq_*` axioms were removed as unsound on 2026-05-20), forcing the
115+
backward direction to be up-to-`=st=`; (3) the repo's `reversible` is one-sided
116+
whereas the contract is two-sided. The in-file section header documents all three.
117+
This is a genuine statement-shape finding: it tells the aletheia contract to be
118+
stated two-sided and `=st=`-relative, not a proof dodged. *Lean mirror deferred.*
119+
89120
== OND — VERIFIED (this environment), the disclosure pillar
90121

91122
`proofs/coq/ond/OND.v` discharges roadmap obligations *OND-1..OND-5* with **zero

ROADMAP.adoc

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,19 @@ No fixed dates — a solo project proceeds as time allows. Ordered by value.
131131

132132
Absolute Zero is the CNO foundation that `hyperpolymath/maa-framework`
133133
coordinates as a pinned submodule. The theorem MAA actually cites is the
134-
*general reversibility biconditional*, which does not yet exist at the general
135-
level (only a filesystem-specific, axiom-backed instance).
136-
137-
* [ ] Prove `reversible p ↔ ∃ p_inv, is_CNO (p ;; p_inv) ∧ is_CNO (p_inv ;; p)`
138-
in `proofs/coq/common/CNO.v` (linking `reversible` to `cno_composition`),
139-
with a Lean mirror.
134+
*general reversibility biconditional*.
135+
136+
* [x] *Reversibility <-> CNO bridge — landed in Coq (2026-07-16, zero axioms).*
137+
`proofs/coq/common/CNO.v` proves the forward direction of the aletheia contract
138+
(`reversible_bridge_forward`: a two-sided inverse makes both composites
139+
`cno_equiv _ []`) and the backward direction up to `=st=`
140+
(`reversible_bridge_backward_upto`), via the core lemma
141+
`reverses_seq_computes_identity`. All `Closed under the global context`.
142+
*Finding:* the literal `reversible p ↔ ∃ p_inv, is_CNO (p;;p_inv) ∧ is_CNO (p_inv;;p)`
143+
is **not** provable here — `is_CNO` over-demands purity/totality, `state_eq`
144+
excludes the PC (forcing up-to-`=st=`), and `reversible` is one-sided; so the
145+
contract should be stated two-sided and `=st=`-relative (see `PROOF-STATUS.adoc`).
146+
*Remaining:* Lean mirror.
140147
* [ ] Discharge the filesystem existence axioms in `FilesystemCNO.v` so
141148
`valence_reversible_pair_is_cno` becomes axiom-free.
142149
* [ ] Discharge the "provable debt" axioms triaged in `proof-debt-triage.md`

proofs/coq/common/CNO.v

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,3 +675,126 @@ Proof.
675675
exists s1; exact Heval1.
676676
Qed.
677677

678+
(** ** The Reversibility <-> CNO Bridge (task A2)
679+
680+
This section connects the repo's [reversible] predicate to the
681+
"composes to a no-op" characterisation the MAA framework (aletheia)
682+
cites:
683+
684+
IsReversible(op) <-> exists op_inv, (op ;; op_inv) === CNO
685+
/\ (op_inv ;; op) === CNO
686+
687+
Three honest modelling facts shape what is actually provable (the
688+
naive biconditional against the repo's [reversible]/[is_CNO] is NOT
689+
true here, and we do not assert it):
690+
691+
1. [is_CNO] is strictly stronger than "computes the identity": it also
692+
demands purity and termination from *every* state. A [reversible]
693+
program need be neither (it may perform undone I/O, and may diverge
694+
on states outside p's range). So "=== CNO" is rendered faithfully by
695+
[cno_equiv _ []] — CNO-equivalence to the canonical no-op (the empty
696+
program), i.e. the identity-on-state component — not full [is_CNO].
697+
698+
2. [state_eq] (=st=) deliberately EXCLUDES the program counter, while
699+
[eval] propagates the PC deterministically. The axioms that would
700+
let one replace a state by an =st=-equal one under [eval] were
701+
removed as UNSOUND on 2026-05-20 (see the note above
702+
[cno_eval_on_equal_states]). Hence the *backward* direction is only
703+
recoverable up to =st= ([reversible_bridge_backward_upto]), never
704+
syntactically.
705+
706+
3. The repo's [reversible] is a *one-sided* left inverse
707+
([reversible_iff_exists_reverses]); the aletheia contract is
708+
*two-sided*. The forward bridge is therefore stated for the honest
709+
two-sided notion [reverses p p_inv /\ reverses p_inv p].
710+
711+
Everything below is axiom-free (Print Assumptions: "Closed under the
712+
global context"), resting only on [eval_deterministic] and [eval_app]. *)
713+
714+
(** [reverses p p_inv]: p_inv undoes p on every reachable transition. *)
715+
Definition reverses (p p_inv : Program) : Prop :=
716+
forall s s', eval p s s' -> eval p_inv s' s.
717+
718+
(** The repo's one-sided [reversible] is exactly "there exists a left
719+
inverse" — making explicit that the two-sided bridge below needs a
720+
strictly stronger hypothesis. *)
721+
Lemma reversible_iff_exists_reverses :
722+
forall p, reversible p <-> exists p_inv, reverses p p_inv.
723+
Proof.
724+
intros p. split; intros [p_inv H]; exists p_inv; exact H.
725+
Qed.
726+
727+
(** Core lemma: a left inverse sequenced after p computes the
728+
state-identity on every transition of the composite. Uses only
729+
[eval_app] and [eval_deterministic]. *)
730+
Lemma reverses_seq_computes_identity :
731+
forall p p_inv,
732+
reverses p p_inv ->
733+
forall s s', eval (seq_comp p p_inv) s s' -> s =st= s'.
734+
Proof.
735+
intros p p_inv Hrev s s' Heval.
736+
unfold seq_comp in Heval.
737+
apply eval_app in Heval.
738+
destruct Heval as [sm [Ep Epinv]].
739+
(* p_inv from sm reaches both s' (given) and s (by reversibility);
740+
determinism forces s' =st= s. *)
741+
pose proof (Hrev s sm Ep) as Hback.
742+
pose proof (eval_deterministic _ _ _ _ Epinv Hback) as Heq.
743+
apply state_eq_sym; exact Heq.
744+
Qed.
745+
746+
(** Evaluating the empty program is the identity on states (syntactic). *)
747+
Lemma eval_nil_eq : forall s s', eval [] s s' -> s' = s.
748+
Proof.
749+
intros s s' H. inversion H. reflexivity.
750+
Qed.
751+
752+
(** Repackaged as CNO-equivalence to the empty program: p ;; p_inv is a
753+
no-op (in the identity-on-state sense) whenever p_inv reverses p. *)
754+
Lemma cno_equiv_seq_empty_of_reverses :
755+
forall p p_inv,
756+
reverses p p_inv ->
757+
cno_equiv (seq_comp p p_inv) [].
758+
Proof.
759+
intros p p_inv Hrev s s1 s2 H1 H2.
760+
(* eval [] s s2 forces s2 = s (without a fragile subst on s). *)
761+
pose proof (eval_nil_eq _ _ H2) as Hs2.
762+
rewrite Hs2.
763+
apply state_eq_sym.
764+
apply (reverses_seq_computes_identity p p_inv Hrev s s1 H1).
765+
Qed.
766+
767+
(** Forward bridge (the faithful direction of the aletheia contract):
768+
a two-sided inverse makes BOTH composites CNO-equivalent to the
769+
no-op. Axiom-free. *)
770+
Theorem reversible_bridge_forward :
771+
forall p,
772+
(exists p_inv, reverses p p_inv /\ reverses p_inv p) ->
773+
exists p_inv,
774+
cno_equiv (seq_comp p p_inv) [] /\ cno_equiv (seq_comp p_inv p) [].
775+
Proof.
776+
intros p [p_inv [Hpp Hpi]].
777+
exists p_inv. split.
778+
- apply cno_equiv_seq_empty_of_reverses; exact Hpp.
779+
- apply cno_equiv_seq_empty_of_reverses; exact Hpi.
780+
Qed.
781+
782+
(** Backward bridge, up to =st= (necessarily — see fact 2 above): if
783+
p ;; p_inv is a no-op and p_inv terminates on p's output, then p_inv
784+
recovers the input up to state-equivalence. A syntactic converse is
785+
unavailable because =st= excludes the PC. *)
786+
Theorem reversible_bridge_backward_upto :
787+
forall p p_inv,
788+
cno_equiv (seq_comp p p_inv) [] ->
789+
forall s s',
790+
eval p s s' ->
791+
(exists u, eval p_inv s' u) ->
792+
exists u, eval p_inv s' u /\ u =st= s.
793+
Proof.
794+
intros p p_inv Hce s s' Ep [u Epinv].
795+
exists u. split; [ exact Epinv | ].
796+
assert (Ecomp : eval (seq_comp p p_inv) s u).
797+
{ unfold seq_comp. apply eval_app. exists s'. split; assumption. }
798+
apply (Hce s u s Ecomp). apply eval_empty.
799+
Qed.
800+

0 commit comments

Comments
 (0)