proof(architecture): RankMonoUnion umbrella over source-rule extensions#168
Merged
Conversation
Realises the architectural recommendation from PR #167's closing note: the future bplus-chain rank-mono umbrella shipped as a UNION OF SOURCE-RULE EXTENSIONS rather than a single enriched rank function. Zero new proof obligations; purely structural composition via Sum + `[_,_]` mediator. `--safe --without-K`, no postulates, no funext. ## The architectural design realised PR #167's closing observation: > The future bplus-chain rank-mono umbrella may want to be designed > as a UNION OF SOURCE-RULE EXTENSIONS (Path-3 style for cleanly- > decomposable cases) rather than a single enriched rank function > (rank-lex-jb style for cross-head cases). This PR mechanises that recommendation as `Ordinal.Buchholz. RankMonoUnion`. ## What the union umbrella ships `_<ᵇᵘ_ : BT → BT → Set` — the disjoint sum of `_<ᵇ¹_` (Slice 3 extension, `RankMonoUmbrellaSlice3`) and `_<ᵇ⁺²_` (Path-3 extension, `RankMonoSameLeft`). Either extension's witness is accepted. `rank-pow-mono-<ᵇᵘ : ∀ {x y} → x <ᵇᵘ y → rank-pow x <′ rank-pow y` — the COPRODUCT MEDIATOR of `rank-pow-mono-<ᵇ¹` and `rank-pow-mono-<ᵇ⁺²` via `[_,_]`. ONE LINE. No new proof obligation: the union's discharge is purely structural. Convenience embeddings: `<ᵇᵘ-from-<ᵇ¹`, `<ᵇᵘ-from-<ᵇ⁺²`, `<ᵇᵘ-from-<ᵇ⁰` (transitive via `<ᵇ¹`), `<ᵇᵘ-from-<ᵇ⁰-via-<ᵇ⁺²` (symmetric via `<ᵇ⁺²`). ## Why this architectural shape (three observations) 1. Different sub-cases of `<ᵇ-+1`-style joint-bplus close at DIFFERENT rank-relation levels. Strict-head case (`<ᵇ¹-+1-+`) closes via head-Ω inversion + `ω-rank-pow-succ`. Same-left case (`<ᵇ⁺²-same-left`) closes via `rank-pow-bplus-right-mono` on the tail. Cross-head rank-equal case (`bpsi ν α` vs `bOmega ν`) closes at the LEX-RANK level via `rank-lex-jb`. Each sub-case prefers a DIFFERENT rank-mono machinery. 2. A single enriched rank function (rank-lex-jb) handles multiple sub-cases via a uniform second-component discriminator, but the consumer-side first-eq derivation is structurally simpler when the source rule itself carries the enrichment (Path-3 verdict, PR #167). 3. UNION OF EXTENSIONS SCALES: every new sub-case added to the bplus-chain rank-mono programme can ship as a new extension `_<ᵇⁿ_` with its own `rank-pow-mono-<ᵇⁿ`, then be unioned in mechanically via Sum + `[_,_]`. No interference between extensions; closure is local to each extension's structural recursion. ## Extension recipe (in module preamble for future contributors) To add a new source-rule extension `_<ᵇⁿ_` with `rank-pow-mono-<ᵇⁿ`: 1. Define relation + rank-pow-mono in its own module (use `RankMonoSameLeft` as the canonical template). 2. Re-export through `Ordinal/Buchholz/Smoke.agda` with its own `using` block. 3. Update this module to extend `_<ᵇᵘ_` with the new disjunct and extend `rank-pow-mono-<ᵇᵘ` with the new case via `[_,_]`. Both edits mechanical; no new proof obligations. Per-extension proof work + structural composition is the architectural payoff, vs proof obligations multiplying as the rank function gains discriminators. ## What this module does NOT do - Does NOT wrap with WfCNF endpoints (à la `RankMonoUmbrellaSlice4._<ᵇ⁻ⁿ_`). Consumers needing WfCNF compose with the predicates separately or extend with a WfCNF-bundled variant. - Does NOT include `rank-lex-jb` discharge — the cross-head rank-equal case discharges at LEX-RANK level, not rank-pow level, so it lives in a different rank-relation. The union here is over `rank-pow <′` discharges only. - Does NOT prove well-foundedness of the union — orthogonal to rank-mono; would need a single Brouwer-rank embedding. `rank-pow` provides the seed. ## Local verification - `agda -i proofs/agda proofs/agda/Ordinal/Buchholz/RankMonoUnion.agda` — clean. - `agda -i proofs/agda proofs/agda/Ordinal/Buchholz/Smoke.agda` — clean, exit 0. - `agda -i proofs/agda proofs/agda/Smoke.agda` — clean, exit 0. - `agda -i proofs/agda proofs/agda/All.agda` — clean, exit 0. - `bash tools/check-guardrails.sh proofs/agda` — **162 modules** pass. - `sh scripts/kernel-guard.sh` — PASS. Six new names pinned in `Ordinal/Buchholz/Smoke.agda` under a new `RankMonoUnion` `using` block. Module wired into `proofs/agda/All.agda` between `RankMonoSameLeft` and `RecursiveSurfaceOrder`. ## Slice 3+4 Route A arc summary (4 PRs total) After this PR the Slice 3+4 Route A session arc is closed: * PR #165 — (b) `<lex-first` primitive + bpsi sub-case discharge. * PR #166 — (c) trichotomy data type + first-eq derivation. * PR #167 — Path-3 prototype (same-left source-rule extension). * THIS PR — RankMonoUnion (architectural realisation). The full bplus-chain rank-mono umbrella over all 13 `_<ᵇ_` constructors is still gated on (i) tail-rank-equality discharge for the bpsi-source-at-equal-head case AND (ii) the cross-head rank-equal case via rank-lex-jb's structural research; neither is closed by THIS PR. The architecture, however, is now in place for those closures to plug in mechanically as they land. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 58 issues detected
View findings[
{
"reason": "No test directory or test files found",
"type": "no_tests",
"file": "/home/runner/work/echo-types/echo-types",
"action": "flag",
"rule_module": "honest_completion",
"severity": "high",
"deduction": 20
},
{
"reason": "Issue in codeql.yml",
"type": "missing_workflow",
"file": "codeql.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in secret-scanner.yml",
"type": "missing_workflow",
"file": "secret-scanner.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Action rpolymath/standards/.github/workflows/governance-reusable.yml@main\n needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in agda.yml",
"type": "unknown",
"file": "agda.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in agda.yml",
"type": "unknown",
"file": "agda.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in governance.yml",
"type": "unknown",
"file": "governance.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in hypatia-scan.yml",
"type": "unknown",
"file": "hypatia-scan.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in mirror.yml",
"type": "unknown",
"file": "mirror.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in scorecard.yml",
"type": "unknown",
"file": "scorecard.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
4 tasks
4 tasks
hyperpolymath
added a commit
that referenced
this pull request
May 30, 2026
## Summary **Closes Gate 2 of the Slice 3+4 Route A session arc.** Derives \`WellFounded _<ᵇᵘ_\` mechanically from \`rank-pow-mono-<ᵇᵘ\` (#168) and the existing \`wf-<′\` via the standard Subrelation + InverseImage transport pattern documented in \`Ordinal.Buchholz.RankBrouwer\`'s preamble. **Zero new proof obligations**; purely structural. \`--safe --without-K\`, no postulates, no funext. ## The rank-embedding recipe ```agda wf-rank-pow-pullback : WellFounded (λ x y → rank-pow x <′ rank-pow y) wf-rank-pow-pullback = On.wellFounded rank-pow wf-<′ wf-<ᵇᵘ : WellFounded _<ᵇᵘ_ wf-<ᵇᵘ = Subrelation.wellFounded rank-pow-mono-<ᵇᵘ wf-rank-pow-pullback ``` Two steps: 1. \`On.wellFounded\` (= \`InverseImage.wellFounded\`) lifts well-foundedness of \`_<′_\` on \`Ord\` to the pullback \`_<′_ on rank-pow\` on \`BT\`. 2. \`Subrelation.wellFounded\` transports well-foundedness from the pullback to \`_<ᵇᵘ_\`, consuming \`rank-pow-mono-<ᵇᵘ\` as the witness that \`_<ᵇᵘ_\` is a sub-relation of the pullback. The pattern is documented at \`RankBrouwer.agda:55-56\`. ## Slice 3+4 Route A gate status after this PR | Gate | Status | |---|---| | 1 — tail-rank-equality discharge (cross-head rank-equal case) | open (structural blocker) | | **2 — well-foundedness of \`_<ᵇᵘ_\`** | **CLOSED HERE** | | 3 — Path-4 + further source-rule extensions | open (future-work, mechanical) | ## What this does NOT do - Does NOT prove well-foundedness of the WfCNF-narrowed \`_<ᵇᵘⁿ_\` (#169) separately — follows by the same Subrelation transport from \`wf-<ᵇᵘ\` via the canonical \`<ᵇᵘⁿ → <ᵇᵘ\` projection. Left for a thin follow-on if specifically needed. - Does NOT add a Brouwer-rank embedding stronger than \`rank-pow\` — \`rank-pow\` is K-free + lands in \`Ord\` + already discharges the WF transport. ## Local verification - All four Agda lanes typecheck clean, exit 0. - \`bash tools/check-guardrails.sh proofs/agda\` — 163 modules pass. - \`sh scripts/kernel-guard.sh\` — PASS. Two new names pinned in \`Ordinal/Buchholz/Smoke.agda\`: \`wf-rank-pow-pullback\`, \`wf-<ᵇᵘ\`. ## Slice 3+4 Route A session arc (6 PRs) | PR | Layer | |---|---| | #165 | rank-lex-jb (b) primitive | | #166 | rank-lex-jb (c) trichotomy + first-eq | | #167 | Path-3 same-left source-rule extension | | #168 | RankMonoUnion architecture | | #169 | WfCNF wrap of the union | | **THIS PR** | **WF of the union (Gate 2 closure)** | ## Test plan - [x] Module typechecks under \`--safe --without-K\` with zero postulates. - [x] Full suite + Smoke remain green with the new module wired in. - [ ] CI: \`check\` + \`cold-check\` + governance lanes green. - [ ] Auto-merge on green. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
May 30, 2026
Mirrors `RankMonoUmbrellaSlice4._<ᵇ⁻ⁿ_`'s WfCNF-bundling pattern over `RankMonoUnion._<ᵇᵘ_` (PR #168). Provides the canonical-form invariant downstream Buchholz consumers need alongside the rank- relation. Zero new proof obligations; the rank-mono closure forwards through the bundled `_<ᵇᵘ_` derivation. `--safe --without-K`, no postulates, no funext. `record _<ᵇᵘⁿ_ (x y : BT) : Set` bundling: * `wf-x : WfCNF x` — source-side canonical-form witness * `wf-y : WfCNF y` — target-side canonical-form witness * `<ᵇᵘ-d : x <ᵇᵘ y` — the union derivation from `RankMonoUnion` Three constructor-level embeddings: `<ᵇᵘⁿ-from-<ᵇ⁰` (10 inherited cases), `<ᵇᵘⁿ-from-<ᵇ¹` (Slice 3 strict-head joint- bplus), `<ᵇᵘⁿ-from-<ᵇ⁺²` (Path-3 same-left joint-bplus). `rank-pow-mono-<ᵇᵘⁿ : ∀ {x y} → x <ᵇᵘⁿ y → rank-pow x <′ rank-pow y` forwards directly to `rank-pow-mono-<ᵇᵘ` via the bundled derivation. ONE LINE — same shape as Slice 4's `rank-pow-mono-<ᵇ⁻ⁿ`. The "union of extensions" pattern from #168 extends through the WfCNF wrap automatically. Future contributors adding a new source-rule extension `_<ᵇⁿ_`: 1. Edit `RankMonoUnion` to extend `_<ᵇᵘ_` with the new disjunct + `rank-pow-mono-<ᵇᵘ` with the new case. 2. THIS MODULE updates AUTOMATICALLY — no edit needed. Per-extension proof work + structural composition; no proof obligations multiply across the WfCNF boundary either. - All four Agda lanes typecheck clean, exit 0. - `bash tools/check-guardrails.sh proofs/agda` — **163 modules** pass. - `sh scripts/kernel-guard.sh` — PASS. Six new names pinned in `Ordinal/Buchholz/Smoke.agda`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
May 30, 2026
## Summary **Stacked on #168.** Mirrors \`RankMonoUmbrellaSlice4._<ᵇ⁻ⁿ_\`'s WfCNF-bundling pattern over \`RankMonoUnion._<ᵇᵘ_\` from #168. Provides the canonical-form invariant downstream Buchholz consumers need alongside the rank-relation. Zero new proof obligations; \`--safe --without-K\`, no postulates, no funext. ## What ships | Name | Type | Role | |---|---|---| | \`_<ᵇᵘⁿ_\` | record (WfCNF + WfCNF + \`_<ᵇᵘ_\`) | WfCNF-narrowed union relation | | \`mk<ᵇᵘⁿ\` | record constructor | Bundling combinator | | \`<ᵇᵘⁿ-from-<ᵇ⁰\` / \`<ᵇᵘⁿ-from-<ᵇ¹\` / \`<ᵇᵘⁿ-from-<ᵇ⁺²\` | embeddings | Constructor-level uplifts under WfCNF endpoints | | \`rank-pow-mono-<ᵇᵘⁿ\` | rank-mono theorem | One-liner forwarding through bundled \`<ᵇᵘ-d\` | ## Architectural payoff preserved The "union of extensions" pattern from #168 extends through the WfCNF wrap automatically. Future contributors adding a new source-rule extension \`_<ᵇⁿ_\`: 1. Edit \`RankMonoUnion\` to extend \`_<ᵇᵘ_\` with the new disjunct + \`rank-pow-mono-<ᵇᵘ\` with the new case. 2. **This module updates AUTOMATICALLY** — no edit needed. Per-extension proof work + structural composition. No proof obligations multiply across the WfCNF boundary either. ## Slice 3+4 Route A session arc (5 PRs) | PR | Layer | |---|---| | #165 | rank-lex-jb (b) primitive | | #166 | rank-lex-jb (c) trichotomy + first-eq | | #167 | Path-3 prototype (same-left source-rule extension) | | #168 | RankMonoUnion (architecture) | | **THIS PR** | **WfCNF wrap of the union** | ## Local verification - All four Agda lanes typecheck clean, exit 0. - \`bash tools/check-guardrails.sh proofs/agda\` — **163 modules** pass. - \`sh scripts/kernel-guard.sh\` — PASS. Six new names pinned in \`Ordinal/Buchholz/Smoke.agda\`. ## Test plan - [x] Module typechecks under \`--safe --without-K\` with zero postulates. - [x] Full suite + Smoke remain green with the new module wired in. - [ ] CI: \`check\` + \`cold-check\` + governance lanes green. - [ ] Auto-merge on green AFTER #168 merges (stacked). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Realises the architectural recommendation from PR #167's closing note: the future bplus-chain rank-mono umbrella shipped as a UNION OF SOURCE-RULE EXTENSIONS rather than a single enriched rank function. Zero new proof obligations; purely structural composition via Sum + `[,]` mediator. `--safe --without-K`, no postulates, no funext.
What the union umbrella ships
The architectural design
PR #167's closing observation:
This PR mechanises that recommendation. Each contributing extension keeps its own proof obligation local; the union dispatches via case analysis on which extension witnesses the relation. The mediator is `[ rank-pow-mono-<ᵇ¹ , rank-pow-mono-<ᵇ⁺² ]` — a single `[,]` over the existing per-extension umbrellas.
Why this architectural shape (three observations)
Different sub-cases prefer different rank-mono machinery. Strict-head joint-bplus closes via head-Ω + `ω-rank-pow-succ`; same-left closes via `rank-pow-bplus-right-mono`; cross-head rank-equal closes at LEX-RANK via rank-lex-jb. No single rank function dominates.
Source-rule enrichment is structurally simpler than rank-function enrichment (Path-3 verdict, PR proof(Path-3 prototype): same-left joint-bplus rank-mono extension #167). The consumer-side first-eq derivation that rank-lex-jb requires (PR proof(Slice 3+4 Route A): (c) trichotomy + consumer-side first-eq derivation #166 (c) trichotomy + first-eq) gets bypassed entirely when the source rule carries the discriminator.
Union of extensions scales. Every new sub-case ships as its own extension module with its own rank-mono theorem, then unions in mechanically. No interference between extensions; closure is local.
Extension recipe (for future contributors)
Documented in the module preamble. To add a new source-rule extension:
Both edits mechanical; no new proof obligations.
Honest scope (preserved in module preamble)
Slice 3+4 Route A arc summary (4 PRs total)
After this PR the session arc is closed:
The full bplus-chain rank-mono umbrella over all 13 `<ᵇ` constructors is still gated on (i) tail-rank-equality discharge for the bpsi-source-at-equal-head case AND (ii) the cross-head rank-equal case via rank-lex-jb's structural research; neither is closed by this PR. The architecture is now in place for those closures to plug in mechanically.
Local verification
Six new names pinned in `Ordinal/Buchholz/Smoke.agda`.
Test plan
🤖 Generated with Claude Code