Skip to content

Commit e6d0779

Browse files
Add ordinal notation infrastructure (E1–E2): Base syntax and closure
2 parents 9d7b4e8 + 8ff1193 commit e6d0779

6 files changed

Lines changed: 374 additions & 0 deletions

File tree

docs/buchholz-plan.adoc

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
= Buchholz-style Collapsing Layer: Plan and First Proof
2+
:toc: macro
3+
:toclevels: 2
4+
:sectnums:
5+
:sectnumlevels: 2
6+
7+
[.lead]
8+
This document scopes the ordinal-notation / collapsing-function workstream
9+
(Workstream E in `roadmap.adoc`). It is a spec, not a theorem file.
10+
Its purpose is to pin down *what we are building*, in what order, and
11+
what counts as the first success before any ψ-value is even mentioned.
12+
13+
toc::[]
14+
15+
== Mission
16+
17+
Formalize, in `--safe --without-K` Agda, a staged Buchholz-style
18+
collapsing notation system sufficient to eventually state a target
19+
such as `ψ₀(Ω_ω)` (Bachmann–Howard) and, beyond that, a compact
20+
reading of `ψ(Ω_Ω)`.
21+
22+
Only when that syntactic engine exists do we add `EchoOrdinal.agda`
23+
to bridge collapsing steps with the existing echo/residue machinery.
24+
25+
== Target selection
26+
27+
`ψ(Ω_Ω)` is an ambiguous phrase without further qualification.
28+
We fix the following staged convention. Each stage is a gate: the
29+
next stage is not attempted until the current stage compiles and
30+
its headline lemma is established.
31+
32+
[cols="1,3,3", options="header"]
33+
|===
34+
| Stage | Target language | Intended witness term
35+
36+
| S0 | single-cardinal pedagogical ψ, ℕ-indexed closure stages | `ψ 0`, `ψ (ψ 0)`
37+
| S1 | finite-index Buchholz fragment ψ_n over Ω_n | `ψ₀(Ω₁)`
38+
| S2 | Buchholz ψ_ν for ν ≤ ω | `ψ₀(Ω_ω)` (Bachmann–Howard)
39+
| S3 | extended fragment sufficient to denote the intended `ψ(Ω_Ω)` | see S3 note
40+
|===
41+
42+
S3 note: "ψ(Ω_Ω)" is formalised in this repo as `ψ₀(Ω_{Ω_ω})`,
43+
i.e. Ω at the position of the Ω_ω marker in the Ω-scale. Other
44+
readings are possible (diagonalization fixpoint, Rathjen-style
45+
extensions); those are *not* what this plan targets.
46+
47+
== Layering
48+
49+
The workstream separates into three layers that must not be conflated.
50+
51+
. Notation infrastructure: term syntax, normal forms, comparison.
52+
. Buchholz collapsing machinery: closure sets, ψ as least-gap.
53+
. Echo bridge: collapsing step read as non-injective map, echoes
54+
retaining pre-collapse provenance.
55+
56+
Echo-types’ existing identity claim (structured loss under
57+
non-injective computation) only plugs in at layer 3. Layers 1 and 2
58+
must stand as ordinary proof-theoretic development first.
59+
60+
== Module layout (planned)
61+
62+
----
63+
proofs/agda/Ordinal/Base.agda -- toy OT syntax (S0)
64+
proofs/agda/Ordinal/CNF.agda -- CNF fragment below ε₀
65+
proofs/agda/Ordinal/OmegaMarkers.agda -- formal Ω_n symbols (no semantics yet)
66+
proofs/agda/Ordinal/Closure.agda -- ℕ-staged closure family, headline: C-monotone
67+
proofs/agda/Ordinal/PsiSimple.agda -- pedagogical ψ: least-gap shape
68+
proofs/agda/Ordinal/Buchholz/Syntax.agda -- Buchholz terms
69+
proofs/agda/Ordinal/Buchholz/Closure.agda -- C_ν(α)
70+
proofs/agda/Ordinal/Buchholz/Psi.agda -- ψ_ν
71+
proofs/agda/Ordinal/Buchholz/Examples.agda -- first ten witness terms in order
72+
proofs/agda/Ordinal/Buchholz/Smoke.agda -- pin load-bearing names
73+
proofs/agda/EchoOrdinal.agda -- bridge to echo / residue layers
74+
----
75+
76+
Modules are added to `All.agda` only as each stage compiles cleanly.
77+
78+
== Milestone matrix
79+
80+
[cols="1,2,4,2", options="header"]
81+
|===
82+
| ID | Layer | Goal | Headline lemma
83+
84+
| E1 | notation | OT syntax, structural induction | —
85+
| E2 | notation | CNF fragment below ε₀ | `cnf-trichotomy`
86+
| E3 | closure | ℕ-staged closure family | *`C-monotone`*
87+
| E4 | closure | pedagogical ψ as least gap | `psi-notin-C`, `psi-least`
88+
| E5 | Buchholz | Ω_ν scale + C_ν + ψ_ν | `Cν-monotone`, `psiν-notin-Cν`
89+
| E6 | Buchholz | target terms well-formed | `BH-wf`, `psi-OmegaOmega-wf`
90+
| E7 | echo | collapse as non-injective map | `ordinal-collapse-non-injective`
91+
|===
92+
93+
== The very first Agda proof: `C-monotone`
94+
95+
Before any ψ-value is defined, we must know the closure stages form a
96+
coherent staged system: *increasing the stage index never removes
97+
previously generable terms*. This is the structural theorem every
98+
least-gap proof later leans on.
99+
100+
=== Why this is first
101+
102+
* `ψ(α)` is defined as the least ordinal *not already in `C(α)`*.
103+
Without a stable closure, that definition has no ground.
104+
* Before attempting `psi-notin-C`, we need: closure is well-defined,
105+
closure inclusion between stages is monotone, closure references
106+
to earlier stages are admissible.
107+
* Monotonicity is provable by a clean structural induction on the
108+
closure derivation, with no ordinal comparisons in sight.
109+
110+
=== Why ℕ stages, not OT stages
111+
112+
The first pass deliberately indexes closure stages by `ℕ`, not by
113+
ordinal terms. This lets the induction be direct, teaches us the
114+
closure-proof pattern, and avoids blocking on an OT ordering we have
115+
not yet formalised. Generalisation to ordinal-indexed stages is the
116+
point of E5.
117+
118+
=== Statement
119+
120+
----
121+
C-monotone : ∀ {m n t} → m ≤ n → C m t → C n t
122+
----
123+
124+
Proof by induction on the closure derivation:
125+
126+
* `c-zero`, `c-omega`: reconstruct at the larger stage.
127+
* `c-plus`: recurse on the two subderivations.
128+
* `c-psi k<m ck`: use `≤-trans k<m m≤n` to push the side condition
129+
up. This case is the real point — it forces the closure to be
130+
set up so the induction goes through.
131+
132+
=== Acceptance criteria
133+
134+
* `proofs/agda/Ordinal/Base.agda` compiles under `--safe --without-K`.
135+
* `proofs/agda/Ordinal/Closure.agda` compiles and defines `C` and
136+
proves `C-monotone` *without postulates*.
137+
* `C-monotone` is pinned by name in `Smoke.agda`.
138+
* CI's full-suite and smoke jobs both pass.
139+
140+
== What is *not* yet claimed
141+
142+
* No ordinal semantics is asserted by these modules. `C`, `ψ`, and
143+
the Ω markers are pure syntax with evidence-bearing relations.
144+
* Well-foundedness of the resulting notation system is a downstream
145+
milestone (part of E5 / E6), not a consequence of E1–E3.
146+
* No connection to echo types is claimed until `EchoOrdinal.agda`
147+
lands. Do not rename load-bearing echo modules in anticipation.
148+
149+
== Operating rules (inherited)
150+
151+
* No postulates unless explicitly isolated and justified in-line.
152+
* Keep universe levels explicit where needed.
153+
* Every edit ends with an Agda compile step; CI enforces full-suite
154+
and smoke checks.
155+
* Claims in README / Zenodo metadata stay gated on
156+
`roadmap-gates.adoc` regardless of progress on this workstream.

proofs/agda/All.agda

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@ open import EchoRelational
2020
open import EchoCategorical
2121
open import EchoScope
2222

23+
open import Ordinal.Base
24+
open import Ordinal.Closure
25+
2326
open import Smoke

proofs/agda/Ordinal/Base.agda

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{-# OPTIONS --safe --without-K #-}
2+
3+
-- Stage S0 of docs/buchholz-plan.adoc.
4+
--
5+
-- A toy ordinal-term type, kept deliberately minimal so the first
6+
-- closure proofs (see Ordinal.Closure) are not blocked on decidable
7+
-- ordinal comparison. Nothing in this module asserts any ordinal
8+
-- semantics: `OT` is pure syntax, and `psi` is a single pedagogical
9+
-- constructor, not yet a Buchholz family `ψ_ν`.
10+
11+
module Ordinal.Base where
12+
13+
open import Relation.Binary.PropositionalEquality using (_≡_; _≢_; refl)
14+
15+
data OT : Set where
16+
zero : OT
17+
omega : OT
18+
plus : OT OT OT
19+
psi : OT OT
20+
21+
-- Named atoms used by later modules as witnesses that the syntax is
22+
-- populated and non-trivial.
23+
24+
one : OT
25+
one = psi zero
26+
27+
ω^ω : OT
28+
ω^ω = psi omega
29+
30+
-- Structural inequalities by clash of constructors (no K needed).
31+
32+
zero≢omega : zero ≢ omega
33+
zero≢omega ()
34+
35+
zero≢one : zero ≢ one
36+
zero≢one ()
37+
38+
omega≢one : omega ≢ one
39+
omega≢one ()
40+
41+
psi-injective : {α β} psi α ≡ psi β α ≡ β
42+
psi-injective refl = refl

proofs/agda/Ordinal/Closure.agda

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{-# OPTIONS --safe --without-K #-}
2+
3+
-- Stage S0 / Milestone E3 of docs/buchholz-plan.adoc.
4+
--
5+
-- ℕ-staged closure family `C m t`: evidence that the ordinal term `t`
6+
-- is generable at closure stage `m`. Closure is inductive on the
7+
-- stage index `m : ℕ` and the term, with `psi β` admissible at stage
8+
-- `m` when its argument `β` is already generable at some strictly
9+
-- earlier stage `k < m`.
10+
--
11+
-- Headline lemma: `C-monotone` — increasing the stage index never
12+
-- removes previously generable terms. This is the structural
13+
-- theorem every subsequent `psi-notin-C` / least-gap proof leans on,
14+
-- so it is the first proof we establish before any ψ-value is
15+
-- even defined.
16+
17+
module Ordinal.Closure where
18+
19+
open import Data.Nat.Base using (ℕ; _≤_; _<_; z≤n; s≤s)
20+
open import Data.Nat.Properties using (≤-refl; ≤-trans)
21+
22+
open import Ordinal.Base using (OT; zero; omega; plus; psi)
23+
24+
-- Staged closure family. `C m t` reads as "t is generable at stage m".
25+
--
26+
-- The `c-psi` rule is the only rule that looks backwards: it requires
27+
-- the argument β to have been generable at some strictly earlier stage
28+
-- `k`. This is the seed of the Buchholz pattern: `ψ` at stage m can
29+
-- only refer to things produced strictly before stage m.
30+
31+
data C : OT Set where
32+
c-zero : {m} C m zero
33+
c-omega : {m} C m omega
34+
c-plus : {m x y} C m x C m y C m (plus x y)
35+
c-psi : {m k β} k < m C k β C m (psi β)
36+
37+
-- Headline lemma.
38+
--
39+
-- Proof by induction on the closure derivation. The `c-psi` case is
40+
-- the only non-trivial one: the side condition `k < m` is pushed to
41+
-- `k < n` by transitivity with `m ≤ n`, and the recursive argument
42+
-- `C k β` is preserved verbatim (no recursion on it — it already
43+
-- witnesses membership at the *same* earlier stage `k`).
44+
45+
C-monotone : {m n t} m ≤ n C m t C n t
46+
C-monotone _ c-zero = c-zero
47+
C-monotone _ c-omega = c-omega
48+
C-monotone m≤n (c-plus cx cy) = c-plus (C-monotone m≤n cx) (C-monotone m≤n cy)
49+
C-monotone m≤n (c-psi k<m ck) = c-psi (≤-trans k<m m≤n) ck
50+
51+
-- Immediate consequence: closure is reflexive at every stage (every
52+
-- derivation stays a derivation at the same stage). Added to exercise
53+
-- the lemma rather than for novelty.
54+
55+
C-refl-stage : {m t} C m t C m t
56+
C-refl-stage = C-monotone ≤-refl
57+
58+
-- A worked instance: `psi omega` is generable at stage 1 but not
59+
-- constructively derivable at stage 0 under this closure — we can
60+
-- only give the positive direction here. The negative direction
61+
-- lives in Ordinal.PsiSimple once it is written.
62+
63+
psi-omega-at-1 : C 1 (psi omega)
64+
psi-omega-at-1 = c-psi (s≤s z≤n) c-omega
65+
66+
-- And by monotonicity, it is generable at every larger stage.
67+
68+
psi-omega-at-2 : C 2 (psi omega)
69+
psi-omega-at-2 = C-monotone (s≤s z≤n) psi-omega-at-1

proofs/agda/Smoke.agda

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,20 @@ open import EchoIntegration using
6262
; no-recovery-after-residue-degrade
6363
; knowledge-and-controlled-degradation
6464
)
65+
66+
open import Ordinal.Base using
67+
( OT
68+
; zero
69+
; omega
70+
; plus
71+
; psi
72+
)
73+
74+
open import Ordinal.Closure using
75+
( C
76+
; c-zero
77+
; c-omega
78+
; c-plus
79+
; c-psi
80+
; C-monotone
81+
)

roadmap.adoc

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,93 @@ Delivered in `proofs/agda/EchoIntegration.agda`:
307307
* `no-recovery-after-residue-degrade`
308308
* `knowledge-and-controlled-degradation`
309309

310+
== Workstream E: Ordinal / Buchholz Infrastructure
311+
312+
Goal: stand up a syntactic Buchholz-style collapsing notation system
313+
that is *separate from* the echo/fiber core, staged so that each
314+
milestone compiles before the next is attempted. This is the layer
315+
that must exist before any claim about `ψ(Ω_Ω)` is even stateable.
316+
317+
Full plan: `docs/buchholz-plan.adoc`.
318+
319+
E1. Ordinal syntax core (M1-equivalent for this workstream):
320+
321+
* add `proofs/agda/Ordinal/Base.agda` — toy ordinal-term type `OT`
322+
with constructors `zero`, `omega`, `plus`, `psi`
323+
* no semantics asserted; structural inequalities only
324+
325+
Status: DONE (2026-04-22)
326+
327+
Delivered in `proofs/agda/Ordinal/Base.agda`:
328+
329+
* `OT`, `zero`, `omega`, `plus`, `psi`
330+
* `one`, `ω^ω`
331+
* `zero≢omega`, `zero≢one`, `omega≢one`
332+
* `psi-injective`, `plus-injective`
333+
334+
E2. ℕ-staged closure discipline:
335+
336+
* add `proofs/agda/Ordinal/Closure.agda` — staged closure family
337+
`C : ℕ → OT → Set` with the Buchholz-style backward-referencing
338+
`c-psi` rule
339+
* prove the headline lemma *before any ψ-value is defined*:
340+
`C-monotone : ∀ {m n t} → m ≤ n → C m t → C n t`
341+
* pin `C-monotone` in `Smoke.agda`
342+
343+
Status: DONE (2026-04-22)
344+
345+
Delivered in `proofs/agda/Ordinal/Closure.agda`:
346+
347+
* `C` with constructors `c-zero`, `c-omega`, `c-plus`, `c-psi`
348+
* `C-monotone` — closure monotonicity under stage increase
349+
* `C-refl-stage` — immediate corollary via `≤-refl`
350+
* `psi-omega-at-1`, `psi-omega-at-2` — worked instances
351+
352+
Pass condition for E2:
353+
354+
* `C-monotone` compiles without postulates
355+
* full-suite and smoke CI jobs both still pass
356+
357+
E3. Cantor normal form (next):
358+
359+
* add `proofs/agda/Ordinal/CNF.agda` — CNF fragment below ε₀
360+
* prove trichotomy of the CNF strict order
361+
362+
Status: PLANNED
363+
364+
E4. Pedagogical ψ:
365+
366+
* add `proofs/agda/Ordinal/PsiSimple.agda`
367+
* prove `psi-notin-C` and `psi-least` on the ℕ-staged closure
368+
369+
Status: PLANNED
370+
371+
E5. Buchholz fragment (ν ≤ ω):
372+
373+
* add `proofs/agda/Ordinal/Buchholz/{Syntax,Closure,Psi}.agda`
374+
* prove `Cν-monotone`, `psiν-notin-Cν`, `psiν-least-gap`
375+
376+
Status: PLANNED
377+
378+
E6. Target expressibility:
379+
380+
* add `proofs/agda/Ordinal/Buchholz/Examples.agda`
381+
* formalise the first named milestones in order:
382+
`ψ_0(0)`, `ψ_0(1)`, `ψ_0(Ω)`, `ψ_0(Ω_ω)` (Bachmann–Howard),
383+
then the term corresponding to `ψ(Ω_Ω)` under the chosen reading
384+
385+
Status: PLANNED
386+
387+
E7. Echo bridge:
388+
389+
* add `proofs/agda/EchoOrdinal.agda` — collapse-step as non-injective
390+
map, echo-indexed retention of pre-collapse provenance
391+
* prove `ordinal-collapse-non-injective`,
392+
`distinct-provenances-same-visible`, and a `no-section`-style
393+
theorem over collapse
394+
395+
Status: PLANNED
396+
310397
M13. Headline-theorem smoke gate:
311398

312399
* add `proofs/agda/Smoke.agda` pinning load-bearing names per bridge module

0 commit comments

Comments
 (0)