Commit 0a83258
hygiene: per-lemma Smoke pins for EchoApprox via concrete instance module (#71)
## Summary
Closes a silent violation of the CLAUDE.md "Working rules" invariant —
*"Every headline theorem must be pinned in `Smoke.agda` via `using`
clause"* — for parameterised modules. `EchoApprox.Approx` lemmas could
not be named in `Smoke.agda` until *some* `PseudoMetric` was supplied,
so the invariant has been quietly skipped for every `echo-approx-*` and
`echo-strict→approx` lemma. PR #70 (Lane C of the multi-lane swarm)
added the retract-direction lemmas (`echo-approx-comp-sound`,
`echo-approx-comp-retract-to`, `echo-approx-comp-retract-A`) but,
following existing convention, left them unpinned for the same reason.
This PR closes the gap with the smallest, most honest possible instance.
**Instance chosen:** the trivial / collapse-to-strict pseudometric on
the unit carrier `⊤`.
- `Tol := ⊤`, `zero := tt`, `_+_ := λ _ _ → tt`
- `_≤_ := λ _ _ → ⊤`
- `dist := λ _ _ → tt` on `B := ⊤`
Every order / monotonicity / triangle obligation discharges to `tt`.
Every approximate echo collapses to `Σ A (λ _ → ⊤)`, so each pinned
lemma is a proof-of-life sanity check that the parameterised module's
term is well-typed at *some* instance — exactly the hygiene contract the
invariant asks for. No new mathematical content. When a genuine metric
instance lands in the repo, the per-lemma pins below can be re-pointed
at it (this is option 1 of two candidates considered; option 2, a
discrete metric over `Bool`, adds nothing for the pinning purpose).
## Headlines now pinned in `Smoke.agda` (9 names)
| New top-level name | Underlying `Approx` term |
|---|---|
| `approx-EchoR` | `EchoR` |
| `approx-intro` | `echo-approx-intro` |
| `approx-strict→approx` | `echo-strict→approx` |
| `approx-relax` | `echo-approx-relax` |
| `approx-NonExpansive` | `NonExpansive` |
| `approx-compose` | `echo-approx-compose` |
| `approx-comp-sound` | `echo-approx-comp-sound` |
| `approx-comp-retract-to` | `echo-approx-comp-retract-to` |
| `approx-comp-retract-A` | `echo-approx-comp-retract-A` |
Plus the instance constructors `trivialTolerance`,
`trivialPseudoMetric`.
## Build status
Verified in the parent session (a sandbox quirk in this worktree denied
positional-argument `agda` invocations despite project
`.claude/settings.json` allowing them; the call worked from the parent):
```
$ LC_ALL=C.UTF-8 agda -i proofs/agda proofs/agda/All.agda
exit: 0
$ LC_ALL=C.UTF-8 agda -i proofs/agda proofs/agda/Smoke.agda
exit: 0
```
`--safe --without-K` invariants intact (Agda would have errored
otherwise). No postulates, no funext, no path algebra — every field is
`tt` or `refl`.
## Files
- New: `proofs/agda/EchoApproxInstance.agda` (instance + 9 per-lemma
re-bindings)
- Modified: `proofs/agda/All.agda` (one `open import` line, keeps
orphan-module-as-dead-code rule satisfied)
- Modified: `proofs/agda/Smoke.agda` (per-lemma `using` clause adjacent
to the existing `Approx` block)
## Refs
- Refs #70 — Lane C surfaced the gap by landing retract-direction lemmas
in a parameterised module.
- Refs CLAUDE.md "Working rules" invariant: *"Every headline theorem
must be pinned in `Smoke.agda` via `using` clause."*
- Does **not** Close any issue.
## Test plan
- [x] `LC_ALL=C.UTF-8 agda -i proofs/agda proofs/agda/All.agda` exits 0
under `--safe --without-K` (verified parent session)
- [x] `LC_ALL=C.UTF-8 agda -i proofs/agda proofs/agda/Smoke.agda` exits
0 under `--safe --without-K` (verified parent session)
- [x] No new postulates introduced
- [x] No `--safe` weakening or escape pragmas
- [ ] CI green on this branch
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent eacce15 commit 0a83258
3 files changed
Lines changed: 116 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
78 | 95 | | |
79 | 96 | | |
80 | 97 | | |
| |||
0 commit comments