Skip to content

Commit dc49a2a

Browse files
hyperpolymathclaude
andcommitted
feat(buchholz): Lane 3 head-Ω first slice — leading-Ω-index head function for joint-bplus closure
First slice of option (A) per `RankPow.agda`'s preamble and `docs/echo-types/buchholz-rank-obstruction.adoc` §"What remains open": discharge the last open per-constructor case `<ᵇ-+1` joint-bplus by dominating `rank-pow t` with an additive-principal ω-power indexed by the leading Ω-marker of `t`. This slice lands the *head-Ω abstraction itself*, no rank-mono. The domination lemma and the headline discharge are explicitly deferred to follow-on slices so the abstraction stands on its own. New module `Ordinal.Buchholz.HeadOmega`: * `head-Ω : BT → OmegaIndex` — leftmost-deepest Ω marker. `bzero ↦ fin 0` (default; future rank-mono guards via non-bzero premise), `bOmega ν ↦ ν`, `bplus x _ ↦ head-Ω x` (leftmost), `bpsi ν _ ↦ ν`. * Four definitional sanity lemmas, one per `BT` constructor (each `refl`), so downstream rewrites don't need to unfold the function. * `head-Ω-bplus-left` — two-level compositional convenience for the WfCNF left-spine pattern that future slices will walk. Pinned in `Ordinal/Buchholz/Smoke.agda` under own `using` block with header comment per CLAUDE.md "Working rules"; wired into `proofs/agda/All.agda` between `RankLex` and `RankMonoUmbrella`. Build invariant held: HeadOmega + Buchholz/Smoke + top-level Smoke + top-level All all exit 0 under --safe --without-K, zero postulates, no funext. Follow-on slices (documented in HeadOmega.agda preamble): * Slice 2 — `ω-rank-pow-succ` + the domination lemma `rank-pow t <′ ω-rank-pow-succ (head-Ω t)` for non-bzero WfCNF terms. * Slice 3 — `rank-mono-<ᵇ-+1-via-head-Ω` headline discharge. * Slice 4 — full `rank-pow-mono-<ᵇ⁻` umbrella. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 04f3d9f commit dc49a2a

4 files changed

Lines changed: 215 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,76 @@ the W1/W2 walkthroughs (their no-section headlines are the existing
281281
to-residue` re-exported with honest-bound + matched-negative
282282
discipline); the R-2026-05-18 narrowings.
283283

284+
### Session arc 2026-05-27 late evening — Lane 3 head-Ω first slice
285+
286+
*Where we started today (commit `04f3d9f`, post-W3):* the consolidation
287+
branch carried the complete Lane 5 triplet (W1/W2/W3) plus the 11/13
288+
Buchholz constructor closure via `rank-pow` + `rank-adm` + `rank-lex`.
289+
The one remaining open per-constructor case `<ᵇ-+1` joint-bplus
290+
sits behind a documented structural blocker
291+
(`docs/echo-types/buchholz-rank-obstruction.adoc` §"What remains
292+
open"): `rank-pow (bplus z₁ z₂)` is not additive principal in
293+
general.
294+
295+
*Where we ended today:* option (A) from `RankPow.agda`'s preamble
296+
opens via the head-Ω abstraction. One slice:
297+
298+
1. *`Ordinal.Buchholz.HeadOmega.agda`* — the leading-Ω-index head
299+
function `head-Ω : BT → OmegaIndex`:
300+
* `bzero``fin 0` (default; future rank-mono guards via
301+
non-bzero premise);
302+
* `bOmega ν``ν`;
303+
* `bplus x _``head-Ω x` (leftmost);
304+
* `bpsi ν _``ν`.
305+
Four definitional sanity lemmas (one per `BT` constructor, each
306+
`refl`) plus one two-level compositional convenience
307+
(`head-Ω-bplus-left`) for the WfCNF left-spine pattern.
308+
Pinned in `Ordinal/Buchholz/Smoke.agda` under own `using` block
309+
with header comment; wired into `proofs/agda/All.agda` between
310+
`RankLex` and `RankMonoUmbrella`.
311+
312+
*Smallest useful first slice.* No rank-mono in this slice; the
313+
domination lemma `rank-pow t <′ ω-rank-pow-succ (head-Ω t)` and
314+
the headline `<ᵇ-+1` joint-bplus discharge are explicitly
315+
deferred to follow-on slices per `HeadOmega.agda`'s preamble.
316+
The abstraction stands on its own merits before any rank
317+
consumer pulls on it.
318+
319+
Build invariant held: `Ordinal/Buchholz/Smoke.agda`,
320+
`proofs/agda/Smoke.agda`, and `proofs/agda/All.agda` all exit 0
321+
under `--safe --without-K`, zero postulates, no funext. All
322+
headlines pinned in the Buchholz-layer Smoke under their own
323+
`using` block per CLAUDE.md "Working rules".
324+
325+
*Plan for the next Claude.* Continue option (A):
326+
327+
1. *Slice 2 — ω-rank-pow-succ + the domination lemma.* Add
328+
`ω-rank-pow-succ : OmegaIndex → Ord` to `RankPow.agda` (one
329+
option: `ω-rank-pow-succ (fin n) = ω^(suc (suc n))`,
330+
`ω-rank-pow-succ ω = olim (λ n → ω^(suc (suc n)))`), then prove
331+
`rank-pow-dominated-by-head-Ω : (t : BT) → NonBzero t → WfCNF t →
332+
rank-pow t <′ ω-rank-pow-succ (head-Ω t)` by structural recursion
333+
on the WfCNF carrier, applying `rank-pow-bplus-into-ω-rank-pow`
334+
at each `bplus` step. This is the load-bearing slice.
335+
2. *Slice 3 — the headline `rank-mono-<ᵇ-+1-via-head-Ω`.* Builds
336+
on Slice 2 + `rank-mono-<ᵇ-+1-via-target` from `RankPow.agda`.
337+
At consumer time: head-Ω inversion on the target's left summand
338+
gives the additive-principal witness; source `bplus`'s rank is
339+
dominated by `ω-rank-pow-succ (head-Ω source)`, which by
340+
`head-Ω-bplus` equals `ω-rank-pow-succ (head-Ω x₁)`, strictly
341+
below the target's rank via the `<ᵇ` premise.
342+
3. *Slice 4 — full `rank-pow-mono-<ᵇ⁻` umbrella.* Composition of
343+
the head-Ω discharge with the existing 11-constructor closures.
344+
The final Buchholz rank-monotonicity theorem under the WfCNF
345+
restriction.
346+
347+
DO NOT reopen: `head-Ω` returns `fin 0` on `bzero` as a deliberate
348+
default — future rank-mono lemmas guard the `bzero` case via the
349+
non-bzero premise, so the default is never consumed in a proof
350+
context. Changing the default to `Maybe OmegaIndex` would force
351+
every downstream caller through an unwrap; the documented
352+
non-bzero guard is the cleaner discipline.
353+
284354
### Session arc 2026-05-20 daytime (theory closure waves 1 + 2 + 3)
285355

286356
*Where we started today (commit `888dee0`, post-#73):* the establishment

proofs/agda/All.agda

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ open import Ordinal.Buchholz.RankPartial
109109
open import Ordinal.Buchholz.RankPow
110110
open import Ordinal.Buchholz.RankAdm
111111
open import Ordinal.Buchholz.RankLex
112+
open import Ordinal.Buchholz.HeadOmega
112113
open import Ordinal.Buchholz.RankMonoUmbrella
113114
open import Ordinal.Buchholz.RecursiveSurfaceOrder
114115
open import Ordinal.Buchholz.RecursiveSurfaceBudget
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{-# OPTIONS --safe --without-K #-}
2+
3+
-- Leading-Ω-index head function for Buchholz terms. First slice of the
4+
-- planned closure of the last open per-constructor case `<ᵇ-+1`
5+
-- joint-bplus in the Buchholz rank-monotonicity matrix
6+
-- (`docs/echo-types/buchholz-rank-obstruction.adoc` §"What remains
7+
-- open").
8+
--
9+
-- ## The closure plan (option A from RankPow.agda's preamble)
10+
--
11+
-- The `<ᵇ-+1` joint-bplus case fails to discharge under `rank-pow`
12+
-- alone because `rank-pow (bplus z₁ z₂)` is not additive principal in
13+
-- general — `rank-pow y₁` (the left summand of the *target*) need not
14+
-- close ⊕-sums of subterm ranks. The recommended unblock per the
15+
-- obstruction doc is to dominate `rank-pow t` by an additive-principal
16+
-- ω-power indexed by the leading Ω-marker of `t`, and then discharge
17+
-- `<ᵇ-+1` via head-Ω inversion + additive-principal at head-Ω's
18+
-- successor.
19+
--
20+
-- This module lands the *head-Ω function itself* and its definitional
21+
-- sanity lemmas. The downstream rank-mono / domination work is
22+
-- deferred to follow-on slices, so that the head-Ω abstraction stands
23+
-- on its own merits before any rank consumer pulls on it.
24+
--
25+
-- ## What lands in this slice
26+
--
27+
-- * `head-Ω : BT → OmegaIndex` — the leading-Ω-index head function.
28+
-- Returns the leftmost-deepest Ω marker carried by the term, with
29+
-- `fin 0` as the default for `bzero` (which has none — the future
30+
-- rank-mono lemma will guard this case explicitly via a non-bzero
31+
-- premise).
32+
-- * `head-Ω-bzero`, `head-Ω-bOmega`, `head-Ω-bplus`, `head-Ω-bpsi` —
33+
-- definitional sanity lemmas, one per `BT` constructor. These
34+
-- lemmas are `refl` (the equations are the definition); they exist
35+
-- so downstream code can rewrite by them without unfolding
36+
-- `head-Ω` directly.
37+
--
38+
-- ## What is deferred to follow-on slices
39+
--
40+
-- * `head-Ω-mono` family (head-Ω respecting WfCNF / WfAdm structural
41+
-- bounds). Needs the rank-domination lemma to be stated first.
42+
-- * `rank-pow-dominated-by-head-Ω : (t : BT) → NonBzero t → WfCNF t →
43+
-- rank-pow t <′ ω-rank-pow-succ (head-Ω t)` (the load-bearing
44+
-- domination lemma). Needs an `ω-rank-pow-succ : OmegaIndex →
45+
-- Ord` (one option: `ω-rank-pow-succ (fin n) = ω^(suc (suc n))`,
46+
-- `ω-rank-pow-succ ω = olim (λ n → ω^(suc (suc n)))`) plus a
47+
-- structural recursion on `WfCNF t` using
48+
-- `rank-pow-bplus-into-ω-rank-pow` at each `bplus` step.
49+
-- * `rank-mono-<ᵇ-+1-via-head-Ω` (the headline discharge). Builds
50+
-- on the domination lemma + `rank-mono-<ᵇ-+1-via-target` from
51+
-- `RankPow.agda`.
52+
53+
module Ordinal.Buchholz.HeadOmega where
54+
55+
open import Relation.Binary.PropositionalEquality using (_≡_; refl)
56+
57+
open import Ordinal.OmegaMarkers using (OmegaIndex; fin; ω)
58+
open import Ordinal.Buchholz.Syntax using
59+
( BT
60+
; bzero
61+
; bOmega
62+
; bplus
63+
; bpsi
64+
)
65+
66+
----------------------------------------------------------------------
67+
-- `head-Ω : BT → OmegaIndex` — leading-Ω-index head function
68+
----------------------------------------------------------------------
69+
70+
-- The leftmost-deepest Ω marker carried by the term.
71+
--
72+
-- * `bzero` ↦ `fin 0` (default; bzero has no Ω marker — the
73+
-- future rank-mono lemma will require a
74+
-- non-bzero premise so this default is never
75+
-- consumed in proofs).
76+
-- * `bOmega ν` ↦ `ν` (the Ω marker IS ν).
77+
-- * `bplus x y` ↦ `head-Ω x` (leftmost — the WfCNF tail bound
78+
-- `y ≤ᵇ x` means y's leading Ω is dominated by
79+
-- x's, so the leftmost is also the deepest).
80+
-- * `bpsi ν α` ↦ `ν` (the ψ-binder's Ω-index dominates the
81+
-- argument α, mirroring the provisional
82+
-- `rank-pow (bpsi ν α) = ω-rank-pow ν` shape in
83+
-- `RankPow.agda`).
84+
--
85+
-- Termination is structural (size-decreasing on the first argument
86+
-- of `bplus`), no decreasing measure needed.
87+
88+
head-Ω : BT OmegaIndex
89+
head-Ω bzero = fin 0
90+
head-Ω (bOmega ν) = ν
91+
head-Ω (bplus x _) = head-Ω x
92+
head-Ω (bpsi ν _) = ν
93+
94+
----------------------------------------------------------------------
95+
-- Definitional sanity, one lemma per `BT` constructor
96+
----------------------------------------------------------------------
97+
98+
-- These are all `refl` — they record the defining equations so that
99+
-- downstream slices can rewrite by them at consumer sites without
100+
-- unfolding `head-Ω` (or, equivalently, naming the equations
101+
-- explicitly when the unfolding is inconvenient in tactic position).
102+
103+
head-Ω-bzero : head-Ω bzero ≡ fin 0
104+
head-Ω-bzero = refl
105+
106+
head-Ω-bOmega : ν head-Ω (bOmega ν) ≡ ν
107+
head-Ω-bOmega _ = refl
108+
109+
head-Ω-bplus : x y head-Ω (bplus x y) ≡ head-Ω x
110+
head-Ω-bplus _ _ = refl
111+
112+
head-Ω-bpsi : ν α head-Ω (bpsi ν α) ≡ ν
113+
head-Ω-bpsi _ _ = refl
114+
115+
----------------------------------------------------------------------
116+
-- Compositional convenience
117+
----------------------------------------------------------------------
118+
119+
-- `head-Ω` of a left-leaning `bplus` chain bottoms out at the
120+
-- leftmost atom's leading Ω. Direct consequence of `head-Ω-bplus`
121+
-- applied twice; provided as a named lemma because the two-level
122+
-- pattern recurs in any rank-mono discharge that walks the WfCNF
123+
-- left spine of a `bplus`.
124+
125+
head-Ω-bplus-left : x y z head-Ω (bplus (bplus x y) z) ≡ head-Ω x
126+
head-Ω-bplus-left _ _ _ = refl

proofs/agda/Ordinal/Buchholz/Smoke.agda

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,3 +381,21 @@ open import Ordinal.Buchholz.RankLex using
381381
; rank-lex-bplus
382382
; rank-mono-<ᵇ-ψΩ≤-lex
383383
)
384+
385+
-- Lane 3 head-Ω first slice 2026-05-27 evening (own block per
386+
-- CLAUDE.md Working rules): the leading-Ω-index head function
387+
-- `head-Ω : BT → OmegaIndex` plus four definitional sanity lemmas,
388+
-- one per `BT` constructor. No rank-mono in this slice — the
389+
-- domination lemma `rank-pow t <′ ω-rank-pow-succ (head-Ω t)` and
390+
-- the headline `<ᵇ-+1` joint-bplus discharge are explicitly deferred
391+
-- to follow-on slices. First piece of option (A) per
392+
-- `RankPow.agda`'s preamble and `docs/echo-types/buchholz-rank-
393+
-- obstruction.adoc` §"What remains open".
394+
open import Ordinal.Buchholz.HeadOmega using
395+
( head-Ω
396+
; head-Ω-bzero
397+
; head-Ω-bOmega
398+
; head-Ω-bplus
399+
; head-Ω-bpsi
400+
; head-Ω-bplus-left
401+
)

0 commit comments

Comments
 (0)