Skip to content

Commit 0731c38

Browse files
redeem(thermo): honest Landauer/Bennett bounds for finite-domain echoes (#23)
## Summary - New \`EchoFiberCount.agda\` formalises an honest finite-domain fiber count \`FiberSize-fin : (Fin n → B) → B → DecEq → ℕ\` plus four headline lemmas; replaces the earlier \`FiberSize ≡ 1\` hardcode in \`EchoThermodynamics\` that rendered every Landauer/Bennett claim vacuous. - \`EchoThermodynamics.agda\` rewritten against \`Data.Nat.Logarithm.⌊log₂_⌋\`; proves \`bennett-reversible : FiberSize ≡ 1 ⇒ erasure bound = 0\` (with the \`id : Fin (suc m) → Fin (suc m)\` instance discharged by \`bennett-reversible-id-zero\`) and \`landauer-collapse : (∀ x → f x ≡ y) ⇒ bound = k·T·⌊log₂ n⌋\`. - \`docs/ECHO-CNO-BRIDGE.adoc\` swept: Theorem 4 / Theorem 5 / Thermodynamic Bridge sections now state precisely what is proved (finite domain only) and which earlier claims (\`echo-information-loss\`, infinite-domain \`cno-zero-energy\`, \`cno-energy-hierarchy\`, \`thermodynamic-cno-verification\`) had no formal analogue. - \`docs/echo-types/taxonomy.md\` §8 references \`EchoFiberCount\` as the quantitative companion to \`EchoDecidable\`. ## Why this matters The earlier \`FiberSize f y = 1\` definition collapsed \`landauer-energy T = k * T\` to zero alongside it (since \`fiber-energy = landauer-energy * 1\`), which made every downstream \`cno-zero-*\` headline trivially true and informationally empty. The redemption replaces that with an actual count over \`Fin n\` (\`EchoFiberCount.FiberSize-fin\`) and proves the *shape* of the Landauer / Bennett bounds at the level where the count is constructively meaningful. The infinite-domain \`ProgramState = ℕ → ℕ\` case is explicitly out of scope and flagged as such in the bridge doc. ## Compile-verification status **Compile-verification required by user's local toolchain.** This branch was authored by an agent whose environment has \`agda 2.8.0\` + \`agda-stdlib v2\` available; both \`All.agda\` and \`Smoke.agda\` exit 0 under \`--safe --without-K\` with no postulates introduced. To re-verify locally: \`\`\` cd <repo> agda -i proofs/agda proofs/agda/All.agda agda -i proofs/agda proofs/agda/Smoke.agda \`\`\` Both should exit 0. ## Test plan - [ ] \`agda -i proofs/agda proofs/agda/All.agda\` exits 0 - [ ] \`agda -i proofs/agda proofs/agda/Smoke.agda\` exits 0 - [ ] No new postulates (\`grep -n postulate proofs/agda/EchoFiberCount.agda proofs/agda/EchoThermodynamics.agda\` returns nothing) - [ ] \`--safe --without-K\` pragma at the top of both new files - [ ] \`Smoke.agda\` pins all 13 new headlines (6 from EchoFiberCount, 6 from EchoThermodynamics, plus \`⌊log₂1⌋≡0\`) ## What this PR does NOT do - Does not address Shannon-entropy / mutual-information formalisation (open). - Does not extend the bound to infinite-domain \`ProgramState = ℕ → ℕ\` (open; needs measure / capacity / equivalence-class machinery). - Does not claim physical-heat-dissipation realisation; \`landauer-bound\` is a lower-bound shape only. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
2 parents ae0b31f + cc229fa commit 0731c38

7 files changed

Lines changed: 540 additions & 140 deletions

File tree

docs/ECHO-CNO-BRIDGE.adoc

Lines changed: 93 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,45 @@ cno-composition-echo : ∀ (s : ProgramState) (e : Echo cno-identity s) →
6565

6666
**Proof**: Composing identity functions preserves echo structure.
6767

68-
### Theorem 4: CNO Thermodynamic Optimality (NEW)
68+
### Theorem 4: Bennett-reversible erasure cost (FINITE DOMAIN ONLY)
6969

7070
```agda
71-
cno-thermodynamic-optimality : ∀ (s : ProgramState) (T : Temperature) →
72-
fiber-energy cno-identity s T ≡ zero
71+
-- in EchoThermodynamics
72+
bennett-reversible :
73+
(f : Fin n → B) (y : B) (_≟_ : DecidableEquality B) (T : Temperature) →
74+
FiberSize-fin f y _≟_ ≡ 1 →
75+
fiber-erasure-bound f y _≟_ T ≡ 0
7376
```
7477

75-
**Proof**: CNOs dissipate zero energy according to Landauer's principle.
76-
77-
### Theorem 5: CNO Information Preservation
78-
79-
```agda
80-
cno-information-preservation : ∀ (s : ProgramState) →
81-
echo-information-loss cno-identity s ≡ zero
82-
```
83-
84-
**Proof**: CNOs preserve all information (zero information loss).
78+
**Status: PROVED** for the finite-domain `Fin n → B` case. The
79+
identity `id : Fin (suc m) → Fin (suc m)` is a canonical instance
80+
discharged by `bennett-reversible-id-zero`.
81+
82+
**NOT proved**: the analogous claim over the original
83+
`ProgramState = ℕ → ℕ` carrier. Counting fibers of a function on
84+
an infinite type is not constructively meaningful without a
85+
heavier semantic framework (capacity, measure, equivalence-class
86+
quotients), and the `cno-identity : ProgramState → ProgramState`
87+
case stays open. The earlier `cno-thermodynamic-optimality`
88+
formulation rested on a hardcoded `FiberSize ≡ 1` that made the
89+
claim vacuous; that hardcode is gone, and the honest finite case
90+
is proved instead.
91+
92+
### Theorem 5: Information-preservation (NOT YET FORMALISED)
93+
94+
The earlier `cno-information-preservation` headline referenced a
95+
function `echo-information-loss` that was never defined and a
96+
notion of CNO-information that has no formal analogue in the
97+
current Agda corpus. **No theorem of this form exists in the
98+
proven suite.** The closest formalised statement is the qualitative
99+
`FiberSize-fin ≡ 0 ⟺ ¬ Echo` bidirectional in `EchoFiberCount`
100+
the count is zero exactly when no metatheoretic witness exists —
101+
but that is a witness-presence statement, not an
102+
information-preservation statement.
103+
104+
A real Shannon-entropy / mutual-information formalisation is open
105+
work; see `docs/echo-types/roadmap.md` under the thermodynamic
106+
items.
85107

86108
### Theorem 6: Universal CNO Definition (NEW)
87109

@@ -118,8 +140,8 @@ Absolute Zero defines CNOs with four properties:
118140
| `FinalState(p, σ) = σ` | `Echo p σ` contains `(σ, refl)` |
119141
| `NoSideEffects(p)` | `Echo p σ` is singleton (only `σ` maps to `σ`) |
120142
| `ThermodynamicallyReversible(p)` | `Echo p σ ≃ Echo id σ` |
121-
| `ThermodynamicOptimality(p)` | `fiber-energy p σ T ≡ zero` |
122-
| `InformationPreservation(p)` | `echo-information-loss p σ ≡ zero` |
143+
| `ThermodynamicOptimality(p)` | `fiber-erasure-bound p σ _≟_ T ≡ 0` _(proved at finite-domain `Fin n → B` only — see Theorem 4)_ |
144+
| `InformationPreservation(p)` | _no formalised analogue — `echo-information-loss` was never defined; see Theorem 5_ |
123145
| `UniversalCNO(p)` | `∀ σ → Echo p σ ≃ Echo id σ` (NEW) |
124146
| `ModelIndependence(p)` | `Echo f y ≃ Echo f' y'` across isomorphic models (NEW) |
125147

@@ -164,39 +186,73 @@ ModelIndependence : ∀ {A B A' B' : Ob} (f : A → B) (f' : A' → B')
164186
3. **Category Theory Module**: Formalizes echo types as fibrations
165187
4. **Functorial Properties**: Proves echo maps preserve categorical structure
166188
167-
## Thermodynamic Bridge
189+
## Thermodynamic Bridge — finite-domain Landauer/Bennett bounds
168190

169-
The `EchoThermodynamics.agda` module establishes a critical connection between echo types and Landauer's principle, directly supporting Absolute Zero's thermodynamic formalization goals.
191+
The `EchoFiberCount.agda` + `EchoThermodynamics.agda` pair
192+
formalises the *shape* of Landauer's bound at the finite-domain
193+
`Fin n → B` level. The earlier draft of this section claimed
194+
significantly more than was proved (a `FiberSize ≡ 1` hardcode
195+
made `cno-zero-energy` and `cno-zero-information-loss` vacuous);
196+
those claims have been retracted and replaced with what is
197+
actually in the proven suite.
170198

171199
### Key Concepts
172200

173-
1. **Fiber Energy**: `fiber-energy f y T = landauer-energy T * fiber-size f y`
174-
2. **Information Loss**: `echo-information-loss f x = fiber-size f (f x) - 1`
175-
3. **CNO Optimality**: CNOs minimize energy dissipation
201+
1. **Honest fiber count**:
202+
`FiberSize-fin f y _≟_` enumerates `Fin n` and asks the
203+
decidable equality at each index — actual preimage count, not
204+
a hardcoded constant.
205+
2. **Landauer bound shape**:
206+
`landauer-bound T n = k * T * ⌊log₂ n⌋`. Linear in T,
207+
logarithmic in the alternatives count. `⌊log₂ 0⌋ = ⌊log₂ 1⌋ = 0`
208+
discharges the trivial corners.
209+
3. **Fiber erasure bound**:
210+
`fiber-erasure-bound f y _≟_ T = landauer-bound T (FiberSize-fin f y _≟_)`.
176211
177-
### Core Theorems
212+
### Core Theorems (proved, finite domain only)
178213

179214
```agda
180-
-- CNOs dissipate zero energy
181-
cno-zero-energy : ∀ (s : ProgramState) (T : Temperature) →
182-
fiber-energy cno-identity s T ≡ zero
183-
184-
-- CNOs preserve all information
185-
cno-zero-information-loss : ∀ (s : ProgramState) →
186-
echo-information-loss cno-identity s ≡ zero
187-
188-
-- Thermodynamic verification
189-
thermodynamic-cno-verification : ∀ (p : ProgramState → ProgramState) →
190-
(∀ σ → fiber-energy p σ T ≡ zero) →
191-
(∀ σ → cno-zero-energy σ T)
215+
-- Bennett: if the fiber size at y is 1, the erasure bound is 0
216+
bennett-reversible :
217+
(f : Fin n → B) (y : B) (_≟_ : DecidableEquality B) (T : Temperature) →
218+
FiberSize-fin f y _≟_ ≡ 1 →
219+
fiber-erasure-bound f y _≟_ T ≡ 0
220+
221+
-- Identity at index zero — canonical instance
222+
bennett-reversible-id-zero :
223+
(_≟_ : DecidableEquality (Fin (suc m))) (T : Temperature) →
224+
fiber-erasure-bound (λ x → x) zero _≟_ T ≡ 0
225+
226+
-- Landauer worst case: every input maps to the same y
227+
landauer-collapse :
228+
(f : Fin n → B) (y : B) (_≟_ : DecidableEquality B) (T : Temperature) →
229+
(∀ x → f x ≡ y) →
230+
fiber-erasure-bound f y _≟_ T ≡ k * T * ⌊log₂ n⌋
192231
```
193232

233+
### What is NOT proved
234+
235+
* `cno-zero-energy` over the original `ProgramState = ℕ → ℕ`
236+
carrier — counting fibers on an infinite type is not
237+
constructively meaningful here.
238+
* `echo-information-loss` and `cno-zero-information-loss`
239+
`echo-information-loss` was never defined in any module;
240+
the prior claims rested on undeclared identifiers.
241+
* `cno-energy-hierarchy`, `thermodynamic-cno-verification`
242+
no proven analogue exists.
243+
194244
### Connection to Absolute Zero Goals
195245

196-
1. **Landauer's Principle**: Formalized via `fiber-energy` and `landauer-energy`
197-
2. **Thermodynamic Reversibility**: Proven via `cno-zero-energy`
198-
3. **Energy Hierarchy**: Established via `cno-energy-hierarchy`
199-
4. **Information Theory**: Bridged via `echo-information-loss`
246+
1. **Landauer's Principle (shape)**: formalised via `landauer-bound`
247+
and `fiber-erasure-bound` at the finite-domain level.
248+
2. **Thermodynamic Reversibility (shape)**: `bennett-reversible` is
249+
proved as a corollary of `FiberSize-fin ≡ 1` and `⌊log₂ 1⌋ ≡ 0`.
250+
`bennett-reversible-id-zero` is the proved instance for
251+
`id : Fin (suc m) → Fin (suc m)` at index zero. The general
252+
"all CNOs dissipate zero energy" claim over `ProgramState` is
253+
open.
254+
4. **Information Theory**: not bridged. Open work — see
255+
`docs/echo-types/roadmap.md`.
200256
201257
## Practical Implications
202258

docs/echo-types/taxonomy.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,29 @@ intensional core, same proof relevance, etc.) and differ only in
210210
whether a witness is reachable by a feasible algorithm. The security
211211
of every modern cryptosystem depends on this axis being real.
212212

213-
*Agda anchor.* `EchoDecidable.agda` formalises refinement 3 below
214-
(decidability-respecting echo) as the first axis-8 artifact under
215-
`--safe --without-K`. Full cost-tracking refinements (1, 2, 4) are
216-
not yet formalised — Agda's type system does not express complexity
217-
bounds, so asymptotic computational access cannot be named at the
218-
type level without further machinery. Adjacent stdlib pieces:
219-
- `Data.Nat.Logarithm.⌊log₂⌋` and arithmetic complexity conventions
220-
admit informal-level statements like "this function runs in `O(n
221-
log n)`", but without a cost monad.
213+
*Agda anchor.* Two artifacts now live at this axis:
214+
- `EchoDecidable.agda` formalises refinement 3 below
215+
(decidability-respecting echo) as the first axis-8 artifact under
216+
`--safe --without-K` — the *qualitative* "yes / no" layer.
217+
- `EchoFiberCount.agda` (companion) provides the *quantitative*
218+
layer for the finite-domain regime: `FiberSize-fin f y _≟_ : ℕ`
219+
enumerates `Fin n` and asks the decidable equality at each
220+
index, returning the actual preimage count. Headlines:
221+
`FiberSize-fin-id-zero` (id has fiber 1), `FiberSize-fin-const`
222+
(constant collapse: fiber n), and the bidirectional
223+
`FiberSize-fin ≡ 0 ⟺ ¬ Echo`. This is the count
224+
`EchoThermodynamics.fiber-erasure-bound` runs on, replacing the
225+
earlier `FiberSize ≡ 1` hardcode that rendered all
226+
Landauer/Bennett claims vacuous.
227+
228+
Full cost-tracking refinements (1, 2, 4) remain unformalised —
229+
Agda's type system does not express complexity bounds, so
230+
asymptotic computational access cannot be named at the type level
231+
without further machinery. Adjacent stdlib pieces:
232+
- `Data.Nat.Logarithm.⌊log₂⌋` (now imported by
233+
`EchoThermodynamics`) and arithmetic complexity conventions admit
234+
informal-level statements like "this function runs in `O(n log n)`",
235+
but without a cost monad.
222236
- `EchoLinear.agda` and `EchoGraded.agda` restrict what one can *do*
223237
with witnesses via usage modes and grades. These are proxies for
224238
resource control, not full computational-access tracking.

proofs/agda/All.agda

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ open import EchoCNOBridge
1818
open import EchoApprox
1919
open import EchoIndexed
2020
open import EchoDecidable
21+
open import EchoFiberCount
2122
open import EchoEpistemicResidue
2223
open import EchoRelational
2324
open import EchoCategorical

proofs/agda/EchoFiberCount.agda

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
{-# OPTIONS --safe --without-K #-}
2+
3+
-- EchoFiberCount: honest finite-domain fiber counting.
4+
--
5+
-- Companion to EchoDecidable. Where EchoDecidable answers
6+
-- "does an echo exist?" (axis-8 decidability), this module
7+
-- answers "how many?" — but only in the regime where the
8+
-- question has a constructive answer: a finite domain `Fin n`
9+
-- with decidable equality on the codomain.
10+
--
11+
-- The headline value `FiberSize-fin f y _≟_` counts the
12+
-- preimages of `y : B` under `f : Fin n → B`, computed by
13+
-- enumerating `Fin n` and asking the decidable equality at
14+
-- each index. This replaces the earlier
15+
-- `EchoThermodynamics.FiberSize = 1` hardcode (which rendered
16+
-- every Landauer/Bennett claim vacuous): with an actual count
17+
-- in hand we can state honest finite-domain bounds.
18+
--
19+
-- Headline lemmas (pinned in Smoke.agda):
20+
--
21+
-- * FiberSize-fin-id-zero -- id : Fin (suc m) → Fin (suc m) has fiber 1 at zero
22+
-- * FiberSize-fin-const -- (λ _ → y₀) has fiber n at y₀
23+
-- * FiberSize-fin≡0⇒no-echo -- count 0 ⇒ no echo witness
24+
-- * no-echo⇒FiberSize-fin≡0 -- no echo witness ⇒ count 0
25+
--
26+
-- The id-zero lemma is the single instance the
27+
-- `bennett-reversible` corollary in `EchoThermodynamics`
28+
-- runs on; the const lemma is the worst-case input for
29+
-- `landauer-collapse`; the bidirectional ≡0/¬Echo lemmas
30+
-- pin the count to the metatheoretic structure of `Echo`.
31+
32+
module EchoFiberCount where
33+
34+
open import Function.Base using (_∘_)
35+
open import Data.Empty using (⊥; ⊥-elim)
36+
import Data.Nat.Base as ℕ
37+
open using (ℕ)
38+
open import Data.Fin.Base using (Fin; zero; suc)
39+
open import Data.Product.Base using (Σ; _,_)
40+
open import Relation.Nullary using (¬_)
41+
open import Relation.Nullary.Decidable.Core using (Dec; yes; no)
42+
open import Relation.Binary.PropositionalEquality using (_≡_; refl; cong)
43+
44+
open import Echo using (Echo)
45+
46+
----------------------------------------------------------------------
47+
-- The fiber count
48+
----------------------------------------------------------------------
49+
50+
-- Counts the preimages of `y` under `f : Fin n → B` by enumerating
51+
-- the domain and asking the decidable equality at each index. Total
52+
-- and terminating: each recursion call shrinks the implicit `n`.
53+
54+
FiberSize-fin :
55+
{b} {B : Set b} {n : ℕ}
56+
(f : Fin n B) (y : B)
57+
((y₁ y₂ : B) Dec (y₁ ≡ y₂))
58+
59+
FiberSize-fin {n = ℕ.zero} f y _≟_ = ℕ.zero
60+
FiberSize-fin {n = ℕ.suc m} f y _≟_ with f zero ≟ y
61+
... | yes _ = ℕ.suc (FiberSize-fin (f ∘ suc) y _≟_)
62+
... | no _ = FiberSize-fin (f ∘ suc) y _≟_
63+
64+
----------------------------------------------------------------------
65+
-- Auxiliary "all-hit" / "no-hit" lemmas
66+
----------------------------------------------------------------------
67+
68+
private
69+
suc≢0 : {k} ℕ.suc k ≡ ℕ.zero
70+
suc≢0 ()
71+
72+
suc≢zero-Fin : {n} (i : Fin n) ¬ (suc i ≡ zero)
73+
suc≢zero-Fin _ ()
74+
75+
----------------------------------------------------------------------
76+
-- "no-hit" / "all-hit" lemmas (exposed for downstream use).
77+
--
78+
-- These are the two extremal shapes of the count: the count is
79+
-- zero exactly when no index hits, and the count is `n` exactly
80+
-- when every index hits. Both proofs walk the FiberSize-fin
81+
-- recursion in lock-step with a hypothesis on f.
82+
----------------------------------------------------------------------
83+
84+
-- If f never hits y, the count is 0.
85+
FiberSize-fin-no-hit :
86+
{b} {B : Set b} {n : ℕ}
87+
(f : Fin n B) (y : B) (_≟_ : (y₁ y₂ : B) Dec (y₁ ≡ y₂))
88+
( i ¬ (f i ≡ y))
89+
FiberSize-fin f y _≟_ ≡ ℕ.zero
90+
FiberSize-fin-no-hit {n = ℕ.zero} f y _≟_ h = refl
91+
FiberSize-fin-no-hit {n = ℕ.suc m} f y _≟_ h with f zero ≟ y
92+
... | yes p = ⊥-elim (h zero p)
93+
... | no _ = FiberSize-fin-no-hit (f ∘ suc) y _≟_ (λ i h (suc i))
94+
95+
-- If f hits y everywhere, the count is n.
96+
FiberSize-fin-all-hit :
97+
{b} {B : Set b} {n : ℕ}
98+
(f : Fin n B) (y : B) (_≟_ : (y₁ y₂ : B) Dec (y₁ ≡ y₂))
99+
( i f i ≡ y)
100+
FiberSize-fin f y _≟_ ≡ n
101+
FiberSize-fin-all-hit {n = ℕ.zero} f y _≟_ h = refl
102+
FiberSize-fin-all-hit {n = ℕ.suc m} f y _≟_ h with f zero ≟ y
103+
... | yes _ = cong ℕ.suc (FiberSize-fin-all-hit (f ∘ suc) y _≟_ (λ i h (suc i)))
104+
... | no ¬p = ⊥-elim (¬p (h zero))
105+
106+
----------------------------------------------------------------------
107+
-- Headline 1 — FiberSize-fin-id-zero
108+
--
109+
-- The identity `id : Fin (suc m) → Fin (suc m)` has fiber size 1
110+
-- at the zero index. Specific instance of "any injection has
111+
-- singleton fibers everywhere"; the `bennett-reversible` corollary
112+
-- in `EchoThermodynamics` runs on this lemma plus `⌊log₂ 1 ⌋ ≡ 0`.
113+
----------------------------------------------------------------------
114+
115+
FiberSize-fin-id-zero :
116+
{m : ℕ} (_≟_ : (a b : Fin (ℕ.suc m)) Dec (a ≡ b))
117+
FiberSize-fin {n = ℕ.suc m} (λ x x) zero _≟_ ≡ ℕ.suc ℕ.zero
118+
FiberSize-fin-id-zero {m} _≟_ with (zero {m}) ≟ (zero {m})
119+
... | yes refl = cong ℕ.suc (FiberSize-fin-no-hit (λ x suc x) zero _≟_ suc≢zero-Fin)
120+
... | no ¬p = ⊥-elim (¬p refl)
121+
122+
----------------------------------------------------------------------
123+
-- Headline 2 — FiberSize-fin-const
124+
--
125+
-- The constant function `(λ _ → y₀) : Fin n → B` has fiber size n
126+
-- at `y₀`: every domain index hits, so the count equals the domain
127+
-- size. This is the worst-case input for the Landauer bound — every
128+
-- Fin-index is collapsed onto a single output value.
129+
----------------------------------------------------------------------
130+
131+
FiberSize-fin-const :
132+
{b} {B : Set b} {n : ℕ}
133+
(y₀ : B) (_≟_ : (y₁ y₂ : B) Dec (y₁ ≡ y₂))
134+
FiberSize-fin {n = n} (λ _ y₀) y₀ _≟_ ≡ n
135+
FiberSize-fin-const y₀ _≟_ = FiberSize-fin-all-hit (λ _ y₀) y₀ _≟_ (λ _ refl)
136+
137+
----------------------------------------------------------------------
138+
-- Headline 3 — FiberSize-fin ≡ 0 ⟺ ¬ Echo (split into two halves).
139+
--
140+
-- The constructive count zero is exactly the constructive absence
141+
-- of an echo. Pins `FiberSize-fin` to the metatheoretic structure
142+
-- of `Echo` from `Echo.agda`: count zero is the *only* numerical
143+
-- shape consistent with there being no witness.
144+
----------------------------------------------------------------------
145+
146+
FiberSize-fin≡0⇒no-echo :
147+
{b} {B : Set b} {n : ℕ}
148+
(f : Fin n B) (y : B) (_≟_ : (y₁ y₂ : B) Dec (y₁ ≡ y₂))
149+
FiberSize-fin f y _≟_ ≡ ℕ.zero
150+
¬ Echo f y
151+
FiberSize-fin≡0⇒no-echo {n = ℕ.zero} f y _≟_ p (() , _)
152+
FiberSize-fin≡0⇒no-echo {n = ℕ.suc m} f y _≟_ p (zero , q) with f zero ≟ y
153+
... | yes _ = ⊥-elim (suc≢0 p)
154+
... | no ¬q = ¬q q
155+
FiberSize-fin≡0⇒no-echo {n = ℕ.suc m} f y _≟_ p (suc i , q) with f zero ≟ y
156+
... | yes _ = ⊥-elim (suc≢0 p)
157+
... | no _ = FiberSize-fin≡0⇒no-echo (f ∘ suc) y _≟_ p (i , q)
158+
159+
no-echo⇒FiberSize-fin≡0 :
160+
{b} {B : Set b} {n : ℕ}
161+
(f : Fin n B) (y : B) (_≟_ : (y₁ y₂ : B) Dec (y₁ ≡ y₂))
162+
¬ Echo f y
163+
FiberSize-fin f y _≟_ ≡ ℕ.zero
164+
no-echo⇒FiberSize-fin≡0 {n = ℕ.zero} f y _≟_ ¬e = refl
165+
no-echo⇒FiberSize-fin≡0 {n = ℕ.suc m} f y _≟_ ¬e with f zero ≟ y
166+
... | yes p = ⊥-elim (¬e (zero , p))
167+
... | no _ = no-echo⇒FiberSize-fin≡0 (f ∘ suc) y _≟_ (λ { (i , q) ¬e (suc i , q) })
168+
169+
----------------------------------------------------------------------
170+
-- Companion remark.
171+
--
172+
-- This module deliberately stays at the finite-domain `Fin n` level.
173+
-- The infinite-domain case (e.g. `ProgramState = ℕ → ℕ`) is *not*
174+
-- addressed: counting fibers of a function on an infinite type is
175+
-- not constructively meaningful in general. EchoThermodynamics's
176+
-- claims about CNOs over infinite state spaces are out of reach
177+
-- without a heavier semantic framework (capacity, measure, or
178+
-- equivalence-class quotients), and that limitation is now made
179+
-- explicit in `docs/ECHO-CNO-BRIDGE.adoc`.

0 commit comments

Comments
 (0)