Skip to content

agda(Echo): equivalence-record packaging for cancel-iso (closes composition.md §4)#25

Merged
hyperpolymath merged 1 commit into
mainfrom
agda/cancel-iso-equivalence-record
Apr 28, 2026
Merged

agda(Echo): equivalence-record packaging for cancel-iso (closes composition.md §4)#25
hyperpolymath merged 1 commit into
mainfrom
agda/cancel-iso-equivalence-record

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

  • Adds two equivalence-record packagers in `Echo.agda` using stdlib's `Function.Bundles.` and `mk↔ₛ′`:
    • `Echo-comp-iso` — unconditional accumulation iso `Echo (g ∘ f) y ↔ Σ B (λ b → Echo f b × g b ≡ y)`, built from the existing `Echo-comp-iso-{to,from,from-to,to-from}` quartet.
    • `cancel-iso` — per-fiber cancellation equivalence `Echo (g ∘ f) y ↔ Echo f (s y)`, parameterised by `s-left`, `s-right`, and both triangle-identity coherences (`triangle₁`, `triangle₂`); built from the existing `cancel-iso-{to,from,from-to,to-from}` quartet.
  • Closes `docs/echo-types/composition.md` §4 ("Full cancel-iso with round-trips") cleanly. Each triangle is needed for the corresponding round-trip — one implies the other in HoTT but the adjustment is non-trivial path algebra, so both stay explicit.
  • Pinned in `Smoke.agda`.

Why

The four cancel-iso pieces had been load-bearing as separate lemmas, requiring downstream consumers to apply them in tandem to recover the equivalence shape. Packaging them into a single `↔` record gives one structured object (with strict-inverse laws available via `mk↔ₛ′`'s field projections) and matches stdlib's idiom for bi-invertible maps.

Compile-verification

```
agda -i proofs/agda proofs/agda/All.agda
agda -i proofs/agda proofs/agda/Smoke.agda
```

Both exit 0 under `--safe --without-K`. No postulates introduced.

Test plan

  • `agda -i proofs/agda proofs/agda/All.agda` exits 0
  • `agda -i proofs/agda proofs/agda/Smoke.agda` exits 0
  • `grep -n postulate proofs/agda/Echo.agda` returns nothing
  • `Echo-comp-iso` and `cancel-iso` headlines pinned in `Smoke.agda`

🤖 Generated with Claude Code

Closes docs/echo-types/composition.md §4 ("Full cancel-iso with
round-trips") via stdlib's `Function.Bundles._↔_`.

Two new headlines (pinned in Smoke.agda):

  * Echo-comp-iso : (f : A → B) (g : B → C) (y : C) →
                    Echo (g ∘ f) y ↔ Σ B (λ b → Echo f b × g b ≡ y)
    Unconditional accumulation iso, packaged from the existing
    Echo-comp-iso-{to, from, from-to, to-from} via mk↔ₛ′.

  * cancel-iso : (f : A → B) (g : B → C) (s : C → B)
                 (s-left  : ∀ b → s (g b) ≡ b)
                 (s-right : ∀ y → g (s y) ≡ y)
                 (triangle₁ : ∀ b → cong g (s-left b) ≡ s-right (g b))
                 (triangle₂ : ∀ y → cong s (s-right y) ≡ s-left (s y))
                 (y : C) →
                 Echo (g ∘ f) y ↔ Echo f (s y)
    Per-fiber cancellation equivalence, requiring both triangle
    identities. Built from cancel-iso-{to, from, from-to, to-from}
    via mk↔ₛ′. Each triangle is needed for the corresponding
    round-trip; one implies the other in HoTT but the adjustment
    is non-trivial path algebra, so both stay explicit.

Verification: agda proofs/agda/All.agda and agda proofs/agda/Smoke.agda
both exit 0 under --safe --without-K. No postulates introduced.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath merged commit facd2e7 into main Apr 28, 2026
2 checks passed
@hyperpolymath hyperpolymath deleted the agda/cancel-iso-equivalence-record branch April 28, 2026 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant