Commit a8ef31d
feat: bounded-search-is-decidable — EchoSearch decidability bridge (#251)
## What
Closes the `bounded-search-is-decidable` gap that `EchoSearch.agda`
flagged under "where next" — the concrete bridge from `EchoSearch` to
`EchoDecidable` (axis 8(3)).
## How
`EchoS enum f y n` is *exactly* the bounded existential `Σ k. (k < n) ×
(f (enum k) ≡ y)`, so under decidable equality on `B` it's decidable by
structural recursion on the budget `n`:
```agda
bounded-search-is-decidable :
(_≟_ : (x y : B) → Dec (x ≡ y))
(enum : SearchStrategy A) (f : A → B) (y : B) (n : ℕ) →
Dec (EchoS enum f y n)
```
- `n = 0` → `no` (via the existing `echo-search-bound-zero`).
- `n = suc n` → test the new index `n` with `_≟_`; on a hit, `yes`;
otherwise recurse on `n`. The negative case refutes every index below
`suc n` via `<-cmp` trichotomy: indices `< n` by the recursive `¬below`,
the index `n` itself by `¬eq`, and none strictly between `n` and `suc
n`.
A small design touch: the refutation matches the `<` proof as `s≤s k≤n`
to get `k ≤ n` directly, avoiding any `≤-pred` name dependency.
## Discipline
- `--safe --without-K`, **zero postulates**, structural recursion (no
`TERMINATING`).
- Pinned in `Smoke.agda`; the module's "where next" note marked LANDED.
`EchoSearch` was already classified (only a lemma added, no new module),
so `kernel-guard.sh` PASS.
- **Verified on latest `main`:** `EchoSearch.agda`, `Smoke.agda`,
`All.agda` all `agda --safe --without-K` exit 0 (captured locally).
## Context
This is one of only three small gaps a full proof-surface survey found
still open (the rest of the historical roadmap has landed). The other
two are **not** clean closes and I'm leaving them for your steer (see
the session note): EchoApprox's Lipschitz bound needs an
interface-design decision (a multiplicative-tolerance algebra), and
EchoSearch's sequential composition needs a from-scratch `ℕ × ℕ ↔ ℕ`
Cantor pairing (stdlib has none) that the module itself defers until a
consumer needs it.
🤖 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 7721c91 commit a8ef31d
2 files changed
Lines changed: 45 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
| 70 | + | |
| 71 | + | |
72 | 72 | | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | | - | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | | - | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| |||
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
| 485 | + | |
485 | 486 | | |
486 | 487 | | |
487 | 488 | | |
| |||
0 commit comments