Skip to content

Commit ed5602b

Browse files
proofs(agda): reach literal zero axioms (discharge funext + Conflicts postulates) (#274)
Discharges the **only two `postulate`s** in echidna's own proof corpus, so the tree is now **literally axiom-free**. ## Changes - **`SoundnessPreservation.agda`** — `Conflicts` was a module-level `postulate` used only in `compose-sound`'s hypothesis (which the proof discards). Made it an **explicit parameter of `compose-sound`** — strictly more general (works for any conflict predicate), no axiom declared, no burden on the other lemmas. - **`Basic.agda` (`CurryUncurryLaws`)** — dropped the **`funext`** postulate. The curry/uncurry inverse laws are now stated **pointwise** and proved by `refl` (the axiom-free plain-Agda formulation). The full `curry (uncurry f) ≡ f` form would need funext — a standard axiom, or Cubical Agda + the cubical library; pointwise needs neither, so no new CI dep. ## Why this form (not Cubical) Cubical Agda would preserve the fully-extensional statement but requires adding the cubical library to the Agda CI (an addition we're avoiding) and couldn't be verified in the authoring sandbox. The pointwise statement is the honest axiom-free truth and is `refl`-trivial. ## Verification - `grep` confirms **zero `postulate` declarations** across `proofs/`, `meta-checker/`, `verification/proofs/`, `src/abi/`, `src/idris/`; no dangling `funext`/`Conflicts` refs. - Compilation is checked by the **gated dogfood Agda CI on this PR** (`just proofs-agda` type-checks both files), since I can't run Agda locally. Net: every echidna-owned proof (Agda + Idris2 ABI + Coq/Lean/Isabelle/Mizar dogfood) is now axiom-free — no postulate / sorry / admit / believe_me anywhere. Draft until the Agda job goes green. https://claude.ai/code/session_01UAqDQaMwpUqWHUSZekGZWv --- _Generated by [Claude Code](https://claude.ai/code/session_01UAqDQaMwpUqWHUSZekGZWv)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 402d303 commit ed5602b

2 files changed

Lines changed: 25 additions & 39 deletions

File tree

proofs/agda/Basic.agda

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -151,25 +151,18 @@ curry f x y = f (x , y)
151151
uncurry : {A B C : Set} (A B C) (A × B C)
152152
uncurry f (x , y) = f x y
153153

154-
-- Proof that curry and uncurry are inverses
154+
-- Proof that curry and uncurry are inverses.
155+
--
156+
-- Stated *pointwise* (the functions agree on every input), which is
157+
-- provable in plain Agda by `refl` with ZERO axioms. The fully-extensional
158+
-- form `curry (uncurry f) ≡ f` would require function extensionality
159+
-- (funext) — a standard axiom, but an axiom nonetheless; the pointwise
160+
-- statements below are the axiom-free truth and need no postulate.
155161
module CurryUncurryLaws where
156-
-- INTENTIONAL AXIOM: Function extensionality (funext)
157-
-- Justification: funext is consistent with Agda's type theory and is
158-
-- provable in Cubical Agda (--cubical). In plain Agda it must be
159-
-- postulated. It is a standard mathematical axiom accepted by all
160-
-- major proof assistants (Coq's Functional Extensionality, Lean's
161-
-- funext, HoTT axiom). It does NOT compromise soundness.
162-
-- See: HoTT Book, Section 2.9; nLab "function extensionality"
163-
-- AXIOM: funext (see justification above; recognised by check-trusted-base.sh)
164-
postulate
165-
funext : {A B : Set} {f g : A B}
166-
((x : A) f x ≡ g x)
167-
f ≡ g
168-
169-
curry-uncurry : {A B C : Set} (f : A B C)
170-
curry (uncurry f) ≡ f
171-
curry-uncurry f = funext λ x funext λ y refl
172-
173-
uncurry-curry : {A B C : Set} (f : A × B C)
174-
uncurry (curry f) ≡ f
175-
uncurry-curry f = funext λ { (x , y) refl }
162+
curry-uncurry : {A B C : Set} (f : A B C) (x : A) (y : B)
163+
curry (uncurry f) x y ≡ f x y
164+
curry-uncurry f x y = refl
165+
166+
uncurry-curry : {A B C : Set} (f : A × B C) (p : A × B)
167+
uncurry (curry f) p ≡ f p
168+
uncurry-curry f (x , y) = refl

proofs/agda/SoundnessPreservation.agda

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,15 @@ record Proof : Set where
4141
-- 2. Conflict predicate
4242
------------------------------------------------------------------------
4343

44-
-- Conflicts is an abstract binary predicate over two axiom lists.
45-
-- We leave it as a postulate-free parameter: the caller supplies a
46-
-- concrete proof of ¬ Conflicts when they know the sets are disjoint.
44+
-- "Conflicts" is an abstract binary predicate over two axiom lists. It is
45+
-- threaded as an *explicit parameter* of the composition theorem (§5)
46+
-- rather than a module-level postulate, so this file declares ZERO axioms.
4747
--
48-
-- In practice ECHIDNA computes this via the danger-level tracker
49-
-- (verification/axioms.rs): two axiom sets conflict when one contains
50-
-- an axiom that the other marks Reject.
51-
-- TRUSTED: Conflicts is an abstract parameter (see above), not an unsound
52-
-- escape — the caller discharges it with a concrete proof.
53-
postulate
54-
Conflicts : List Axiom List Axiom Set
55-
-- ^ INTENTIONAL PARAMETER — "Conflicts" is domain knowledge about
56-
-- which axiom combinations are unsound. Leaving it abstract keeps
57-
-- the composition theorem maximally reusable: any concrete conflict
58-
-- definition satisfying ¬ Conflicts a1 a2 gives the same guarantee.
59-
-- This is NOT a soundness hole: the theorem proves a conditional,
60-
-- not an unconditional claim.
48+
-- In practice ECHIDNA instantiates it via the danger-level tracker
49+
-- (src/rust/verification/axioms.rs): two axiom sets conflict when one
50+
-- contains an axiom the other marks Reject. The theorem proves a
51+
-- conditional ("if the sets do not conflict …"), so any concrete conflict
52+
-- definition gives the same guarantee.
6153

6254
------------------------------------------------------------------------
6355
-- 3. Proof composition
@@ -83,12 +75,13 @@ compose p1 p2 = MkProof
8375
-- conflict, then compose p1 p2 is sound.
8476
------------------------------------------------------------------------
8577

86-
compose-sound : (p1 p2 : Proof)
78+
compose-sound : (Conflicts : List Axiom List Axiom Set)
79+
(p1 p2 : Proof)
8780
Proof.sound p1 ≡ true
8881
Proof.sound p2 ≡ true
8982
¬ Conflicts (Proof.axioms p1) (Proof.axioms p2)
9083
Proof.sound (compose p1 p2) ≡ true
91-
compose-sound p1 p2 s1 s2 _ = ∧-true s1 s2
84+
compose-sound _ p1 p2 s1 s2 _ = ∧-true s1 s2
9285

9386
------------------------------------------------------------------------
9487
-- 6. Structural corollary: composing with an empty-axiom proof

0 commit comments

Comments
 (0)