Skip to content

Phase 1.3: ⊕-mono-<-right not provable for naive _⊕_ at limit α #34

Closed

Description

@hyperpolymath

Summary

The Echidna design search (docs/echidna-design-search-2026-04-28.adoc) lists ⊕-mono-<-right : ∀ α {β γ} → β <′ γ → α ⊕ β <′ α ⊕ γ as a Phase 1.3 deliverable, claiming it is "structural on α." Hand-tracing through the recursive _≤′_ definition (Ordinal.Brouwer.Phase13) shows the limit-α case is not provable for the naive left-recursive _⊕_ defined in Ordinal.Brouwer.Arithmetic.

Counterexample

Take α = ω = olim nat-to-ord, β = oz, γ = osuc oz.

By definitions:

  • ω ⊕ oz = olim (λ n → nat-to-ord n ⊕ oz) = olim nat-to-ord = ω
  • ω ⊕ osuc oz = olim (λ n → nat-to-ord n ⊕ osuc oz) = olim (λ n → nat-to-ord (suc n))

To prove ω ⊕ oz <′ ω ⊕ osuc oz we need osuc ω ≤′ olim (λ n → nat-to-ord (suc n)), which by the _≤′_ clause for osuc _ ≤′ olim _ requires a Σ k. osuc ω ≤′ nat-to-ord (suc k) = Σ k. ω ≤′ nat-to-ord k. But ω ≤′ nat-to-ord k = (m : ℕ) → nat-to-ord m ≤′ nat-to-ord k, which fails for m > k (osuc^(m−k) oz ≤′ oz = ⊥).

So no k works, and ω ⊕ oz ≮′ ω ⊕ osuc oz. The strict-mono-right lemma is false at this α.

Why this matters

RankBrouwer.agda's preamble closes the <ᵇʳᶠ-ψα and <ᵇʳᶠ-+2 cases of rank-mono via this lemma. Both can produce a limit α at the call site:

  • <ᵇʳᶠ-ψα with ν = ω: ω-rank ω = olim nat-to-ord (limit).
  • <ᵇʳᶠ-+2: rank x ⊕ rank y is a limit when the left rank is.

So the unbudgeted wf-<ᵇʳᶠ chain (Subrelation.wellFounded rank-mono (InverseImage.wellFounded rank wf-<)) can not close as currently scoped.

Fix options

(A) Right-recursive _⊕_ — recurse on β instead of α:

α ⊕ oz       = α
α ⊕ osuc β   = osuc (α ⊕ β)
α ⊕ olim f   = olim (λ n → α ⊕ f n)

Trivially right-strict-mono by induction on γ. Smallest mathematical change. Need to recheck psi-rank/ω-rank consequences (currently shaped around left-recursion).

(B) Hessenberg / natural sum — commutative + bi-monotonic. The Arithmetic preamble explicitly deferred this ("more machinery than pays off for the rank we actually need"). Heavier but cleanest semantically.

(C) Reshape rank so rank x is never a limit — wrap bOmega rank in osuc (and propagate). Keeps _⊕_ as is. Smallest blast radius for _⊕_, but every downstream use of ω-rank ν now carries an extra osuc.

Recommendation

(A). Right-recursive _⊕_ is the smallest change that makes the lemma true as stated, doesn't touch the rank shape that the SA + swarm already converged on, and lines up with how _≤′_'s recursion already favours the right argument (≤-trans "induct on γ first" — same intuition). Would also make ⊕-mono-≤-right hold via the same induction.

Where this discovery sits

Found while planning the work in the 2026-05-01 session handoff (P3 — Phase 1.3 arithmetic side). The Echidna design doc is otherwise sound; this is a single-line claim that did not survive contact with the recursive _≤′_ definitions actually shipped in Phase13.agda. No _⊕_ proof was attempted in this session — blocked here.

Activity

  1. hyperpolymath commented on May 11, 2026

    @hyperpolymath
    OwnerAuthor

    Resolved — fixable via option A. Full implementation plan below.

    Counterexample confirmed

    The hand-trace is correct. With left-recursive _⊕_, computing the goal
    ω ⊕ oz <′ ω ⊕ osuc oz (i.e. osuc ω ≤′ olim (λ n → nat-to-ord (suc n)))
    requires by the osuc _ ≤′ olim _ clause a witness Σ k. ω ≤′ nat-to-ord k,
    i.e. ∀ m. nat-to-ord m ≤′ nat-to-ord k, which fails for m = suc k.
    The lemma is genuinely false for the current definition.

    Fix: right-recursive _⊕_ in Arithmetic.agda

    _⊕_ : Ord → Ord → Ord
    α ⊕ oz       = α
    α ⊕ osuc β   = osuc (α ⊕ β)
    α ⊕ olim f   = olim (λ n → α ⊕ f n)

    The recursion direction now mirrors _≤′_'s second-argument structure, so the
    three cases of β <′ γ align exactly with the three cases of α ⊕ γ.

    Why ⊕-mono-<-right is provable after the change

    Prove ⊕-mono-<-right : β <′ γ → α ⊕ β <′ α ⊕ γ
    (i.e. osuc (α ⊕ β) ≤′ α ⊕ γ) by induction on γ:

    • γ = oz: hypothesis osuc β ≤′ oz = ⊥, vacuous.
    • γ = osuc γ': hypothesis β ≤′ γ'; goal α ⊕ β ≤′ α ⊕ γ';
      discharged by companion ⊕-mono-≤-right.
    • γ = olim g: hypothesis Σ n, osuc β ≤′ g n; goal
      osuc (α ⊕ β) ≤′ olim (λ n → α ⊕ g n);
      apply ≤′-lim at the witness n, reducing to osuc (α ⊕ β) ≤′ α ⊕ g n;
      closed by IH on g n (structural subterm). ✓

    The same structural argument on γ (with secondary induction on β) gives
    ⊕-mono-≤-right : β ≤′ γ → α ⊕ β ≤′ α ⊕ γ.

    Helper lemmas for Phase13.agda

    Two helpers are needed, both straightforward:

    -- weakening: x ≤′ y → x ≤′ osuc y
    -- induction on x; the osuc-x' case splits on y,
    -- using ≤′-lim + f-in-lim′ for the olim-y sub-case.
    ≤′-weaken-osuc : ∀ {x y} → x ≤′ y → x ≤′ osuc y
    
    -- left argument is always ≤ the sum: α ≤′ α ⊕ γ
    -- induction on γ:
    --   oz     → ≤′-refl
    --   osuc γ' → IH + ≤′-weaken-osuc
    --   olim g  → IH at g 0, then f-in-lim′ + ≤′-trans
    ⊕-left-≤-sum : ∀ {α γ} → α ≤′ α ⊕ γ

    ≤′-weaken-osuc is needed to thread the osuc step in ⊕-left-≤-sum's
    osuc γ' case; ⊕-left-≤-sum is needed for the β = oz base case of
    ⊕-mono-≤-right (goal is α ⊕ oz = α ≤′ α ⊕ γ).

    Collateral breakage in Arithmetic.agda

    ⊕-oz-left : ∀ β → oz ⊕ β ≡ β must be removed: oz ⊕ osuc β now
    reduces to osuc (oz ⊕ β), not osuc β, so the identity is propositional
    rather than definitional. Nothing in RankBrouwer.agda or Phase13.agda
    uses this equation.

    The right-unit law α ⊕ oz = α is now definitional — the identity that
    actually matters for rank-mono.

    psi-rank guarantee is unaffected

    ω-rank ν < psi-rank ν α requires ω-rank ν ≤′ ω-rank ν ⊕ α, which is
    exactly ⊕-left-≤-sum. No change to the psi-rank definition or shape.

    Closing chain

    Once ⊕-mono-<-right lands:

    • <ᵇʳᶠ-ψα: rank (bpsi ν α) = osuc (ω-rank ν ⊕ rank α); descent
      α <ᵇʳᶠ β maps to ⊕-mono-<-right on the right argument. ✓
    • <ᵇʳᶠ-+2: rank (bplus x y) = rank x ⊕ rank y; descent y <ᵇʳᶠ z
      maps to ⊕-mono-<-right with α = rank x. ✓
    wf-<ᵇʳᶠ : WellFounded _<ᵇʳᶠ_
    wf-<ᵇʳᶠ = Subrelation.wellFounded rank-mono
                 (InverseImage.wellFounded rank wf-<′)

    closes.

    Not impossible. Recommend proceeding with option A.

  2. hyperpolymath commented on May 11, 2026

    @hyperpolymath
    OwnerAuthor

    Resolved — fixable via option A. Full implementation plan below.

    Counterexample confirmed

    The hand-trace is correct. With left-recursive _⊕_, computing the goal
    ω ⊕ oz <′ ω ⊕ osuc oz (i.e. osuc ω ≤′ olim (λ n → nat-to-ord (suc n)))
    requires by the osuc _ ≤′ olim _ clause a witness Σ k. ω ≤′ nat-to-ord k,
    i.e. ∀ m. nat-to-ord m ≤′ nat-to-ord k, which fails for m = suc k.
    The lemma is genuinely false for the current definition.

    Fix: right-recursive _⊕_ in Arithmetic.agda

    _⊕_ : Ord → Ord → Ord
    α ⊕ oz       = α
    α ⊕ osuc β   = osuc (α ⊕ β)
    α ⊕ olim f   = olim (λ n → α ⊕ f n)

    The recursion direction now mirrors _≤′_'s second-argument structure, so the
    three cases of β <′ γ align exactly with the three cases of α ⊕ γ.

    Why ⊕-mono-<-right is provable after the change

    Prove ⊕-mono-<-right : β <′ γ → α ⊕ β <′ α ⊕ γ
    (i.e. osuc (α ⊕ β) ≤′ α ⊕ γ) by induction on γ:

    • γ = oz: hypothesis osuc β ≤′ oz = ⊥, vacuous.
    • γ = osuc γ': hypothesis β ≤′ γ'; goal α ⊕ β ≤′ α ⊕ γ';
      discharged by companion ⊕-mono-≤-right.
    • γ = olim g: hypothesis Σ n, osuc β ≤′ g n; goal
      osuc (α ⊕ β) ≤′ olim (λ n → α ⊕ g n);
      apply ≤′-lim at the witness n, reducing to osuc (α ⊕ β) ≤′ α ⊕ g n;
      closed by IH on g n (structural subterm). ✓

    The same structural argument on γ (with secondary induction on β) gives
    ⊕-mono-≤-right : β ≤′ γ → α ⊕ β ≤′ α ⊕ γ.

    Helper lemmas for Phase13.agda

    Two helpers are needed, both straightforward:

    -- weakening: x ≤′ y → x ≤′ osuc y
    -- induction on x; the osuc-x' case splits on y,
    -- using ≤′-lim + f-in-lim′ for the olim-y sub-case.
    ≤′-weaken-osuc : ∀ {x y} → x ≤′ y → x ≤′ osuc y
    
    -- left argument is always ≤ the sum: α ≤′ α ⊕ γ
    -- induction on γ:
    --   oz     → ≤′-refl
    --   osuc γ' → IH + ≤′-weaken-osuc
    --   olim g  → IH at g 0, then f-in-lim′ + ≤′-trans
    ⊕-left-≤-sum : ∀ {α γ} → α ≤′ α ⊕ γ

    ≤′-weaken-osuc is needed to thread the osuc step in ⊕-left-≤-sum's
    osuc γ' case; ⊕-left-≤-sum is needed for the β = oz base case of
    ⊕-mono-≤-right (goal is α ⊕ oz = α ≤′ α ⊕ γ).

    Collateral breakage in Arithmetic.agda

    ⊕-oz-left : ∀ β → oz ⊕ β ≡ β must be removed: oz ⊕ osuc β now
    reduces to osuc (oz ⊕ β), not osuc β, so the identity is propositional
    rather than definitional. Nothing in RankBrouwer.agda or Phase13.agda
    uses this equation.

    The right-unit law α ⊕ oz = α is now definitional — the identity that
    actually matters for rank-mono.

    psi-rank guarantee is unaffected

    ω-rank ν < psi-rank ν α requires ω-rank ν ≤′ ω-rank ν ⊕ α, which is
    exactly ⊕-left-≤-sum. No change to the psi-rank definition or shape.

    Closing chain

    Once ⊕-mono-<-right lands:

    • <ᵇʳᶠ-ψα: rank (bpsi ν α) = osuc (ω-rank ν ⊕ rank α); descent
      α <ᵇʳᶠ β maps to ⊕-mono-<-right on the right argument. ✓
    • <ᵇʳᶠ-+2: rank (bplus x y) = rank x ⊕ rank y; descent y <ᵇʳᶠ z
      maps to ⊕-mono-<-right with α = rank x. ✓
    wf-<ᵇʳᶠ : WellFounded _<ᵇʳᶠ_
    wf-<ᵇʳᶠ = Subrelation.wellFounded rank-mono
                 (InverseImage.wellFounded rank wf-<′)

    closes.

    Not impossible. Recommend proceeding with option A.

  3. added a commit that references this issue on May 15, 2026
    b09bb4e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions