Commit 7603e72
feat: echo-approx-compose-lipschitz — Rung D (Lipschitz composition) (#252)
## What
Closes **Rung D** (Lipschitz composition) that `EchoApprox.agda`
deferred — generalising approximate-echo composition from a
*non-expansive* outer leg (`L = 1`) to a *Lipschitz* leg with constant
`L`.
## How
The module's own note: *"Rung D … requires multiplication on
`Tolerance`, another interface call."* Per your "do both", I resolved
that interface call in favour of the repo's established pattern — a
**layered opt-in record**, exactly like `BalancedTolerance` /
`Separated`, leaving the base `Tolerance` minimal:
```agda
record LipschitzScale (T : Tolerance ℓ) where
field _*_ : Tol → Tol → Tol
*-monoʳ : ∀ {s a c} → a ≤ c → (s * a) ≤ (s * c)
```
Then, in a `Lipschitz (S : LipschitzScale T)` sub-module of `Approx`:
```agda
IsLipschitz L g = ∀ b₁ b₂ → dist (g b₁) (g b₂) ≤ (L * dist b₁ b₂)
echo-approx-compose-lipschitz :
IsLipschitz L g → EchoR ε₁ f b → dist (g b) y ≤ ε₂ →
EchoR ((L * ε₁) + ε₂) (g ∘ f) y
```
Same triangle + accumulate skeleton as `echo-approx-compose`; the
non-expansive step `dist (g·)(g·) ≤ dist · ·` becomes the Lipschitz step
`≤ L * dist · ·`, and `*-monoʳ` carries the inner bound `dist (f x) b ≤
ε₁` through the constant to `L * ε₁`. It recovers `echo-approx-compose`
at the corner `L * ε ≡ ε`.
Minimal by design: only `_*_` + right-monotonicity are needed;
associativity/identity/distributivity are left to richer carriers.
## Discipline
- `--safe --without-K`, **zero postulates**.
- Trivial-`⊤` `LipschitzScale` instance + 2 pins in `EchoApproxInstance`
(the parameterised-module Smoke-pinning pattern); header "Rung D
deferred" note flipped to LANDED.
- **Verified on latest `main`:** `EchoApprox`, `EchoApproxInstance`,
`Smoke.agda`, `All.agda` all exit 0; `kernel-guard.sh` PASS (existing
modules — no new module).
## Context
This is gap 2-of-3 from the proof survey. Gap 3 (EchoSearch sequential
composition) is next — it's a genuine product-search whose `n₁ * n₂`
bound provably requires a bound-dependent row-major pairing (`DivMod`),
which I'm building now.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_018CaSgNjNURC7ocsyjYh9We
---
_Generated by [Claude
Code](https://claude.ai/code/session_018CaSgNjNURC7ocsyjYh9We)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent a8ef31d commit 7603e72
3 files changed
Lines changed: 79 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| |||
160 | 163 | | |
161 | 164 | | |
162 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
163 | 188 | | |
164 | 189 | | |
165 | 190 | | |
| |||
542 | 567 | | |
543 | 568 | | |
544 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
92 | 106 | | |
93 | 107 | | |
94 | 108 | | |
| |||
102 | 116 | | |
103 | 117 | | |
104 | 118 | | |
| 119 | + | |
105 | 120 | | |
106 | 121 | | |
107 | 122 | | |
| |||
123 | 138 | | |
124 | 139 | | |
125 | 140 | | |
| 141 | + | |
| 142 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
| 420 | + | |
| 421 | + | |
420 | 422 | | |
421 | 423 | | |
422 | 424 | | |
| |||
0 commit comments