Skip to content

Commit 6dafb2d

Browse files
echo-types: Bennett on an arbitrary carrier + O-THERMO-∞ closed-negative (#60)
Thermodynamic-bridge continuation. **Stacked on PR #58** (base = `thermo/bennett-injective-finite-stack-2026-05-18`, itself on PR #54 `docs/echo-types-master-map`). Depends on #58's `bennett-reversible-injective` / `FiberSize-fin-injective` / `FiberSize-fin-const` and on MAP.adoc (only on the #54 branch). **Re-target chain:** #54→main, then #58→main, then **this PR→main**. (Automated poll armed; merges out-of-band.) This PR closes the thermodynamic pillar: **no open obligation remains** for the Thermodynamic Direction (`[REAL*]` → `[REAL]`, B- → B / ~95%). ## Part 1 — Bennett zero-cost on an arbitrary carrier (Steps 1–3) The finiteness in PR #58 / `EchoThermodynamicsFinite` was an artefact of routing cost through `FiberSize-fin` (an enumeration); Bennett's physical content (no fan-in) needs no finiteness. 1. **`FiberSubsingleton` + `injective⇒fiber-subsingleton`** — K-free `--without-K`-safe "no fan-in" predicate, for an **arbitrary** carrier `A : Set a`. (Full fibre `isProp` would need `B` an h-set/UIP, unavailable under `--without-K`; the first-projection form is what the count needs.) 2. **`bennett-reversible-arbitrary`** — Bennett zero-cost for every injective map on **any** carrier, no `Fin`/`FiniteDomain`, via an occupancy-keyed `reversible-erasure-cost`. **Anti-vacuity:** `occupancy≡FiberSize-fin` + `bennett-arbitrary-refines-finite` prove it coincides with and strictly subsumes #58's established count. 3. **`bennett-reversible-cno-identity`** — instantiated at `cno-identity : Program → Program` over the genuine **infinite** absolute-zero `Program` carrier: "a CNO dissipates zero Landauer energy" is now a real theorem, not the historically vacuous claim. `EchoFiberCount` gains `FiberSize-fin-subsingleton` (`FiberSize-fin-injective` is its corollary; kept as-is upstream for pin stability). ## Part 2 — O-THERMO-∞ discharged negatively → `[CLOSED-NEG]` Route (a): mechanise the impossibility. `EchoThermoCollapseImpossible` proves the obligation's **own kill condition, second horn — (i)∧(ii) ⊢ ⊥ — verbatim**, for its named witness: - `nat-into-collapse-fiber{-injective}`: `ℕ ↪ Echo (const y₀) y₀` — the collapse fiber is infinite (the structural reason no finite count exists). - `collapse-cost-impossible`: any total `--safe` `cost` agreeing with `fiber-erasure-bound` on every finite restriction of the constant map is impossible — clause (ii) at `n = 1, 2` (`T = 1`, via `FiberSize-fin-const`) forces its single value to be both `0` and `1`. The quantitative-collapse functional provably does **not** extend to an infinite carrier as a total `--safe` function: a settled negative boundary, **not** a softened "future work" item and **not** a defect. Orthogonal to the Bennett zero direction (closed for all carriers, Part 1). ## Verification - All `--safe --without-K`, **zero postulates, zero escape pragmas** (the lone `postulate` string is the comment false-positive class — EchoKernel precedent). - `Smoke.agda` + `All.agda` typecheck (exit 0); all new headlines pinned in `Smoke.agda`. - Governance docs updated same PR per the MAP rule: `ECHO-CNO-BRIDGE.adoc` §"Thermodynamic Bridge" (O-THERMO-∞ → `[CLOSED-NEG]`), `STABILITY_ANALYSIS.md` §3.3 (B / ~95%, with explicit rationale for the freeze-lift), `docs/echo-types/MAP.adoc` (`[REAL*]` → `[REAL]`, proofs list). Honours retraction R-2026-05-18 — orthogonal; nothing retracted is reinstated. The separate Information-Theory bridge (Theorem 5) remains unbuilt by design — a different Direction. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5aa59ec commit 6dafb2d

8 files changed

Lines changed: 584 additions & 59 deletions

File tree

docs/ECHO-CNO-BRIDGE.adoc

Lines changed: 105 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,27 @@ bennett-reversible :
7575
fiber-erasure-bound f y _≟_ T ≡ 0
7676
```
7777

78-
**Status: PROVED**, and (2026-05-18) generalised twice: from the
79-
identity to *every injective map* (`bennett-reversible-injective`),
80-
and from `Fin n` to *any Bishop-finite carrier* via transport
81-
(`bennett-reversible-finite`, `EchoThermodynamicsFinite`).
82-
`bennett-reversible-id-zero` is now a corollary.
83-
84-
**NOT proved**: the analogous claim over an infinite carrier
85-
(`ProgramState = ℕ → ℕ`). This is no longer a vague gap — it is the
86-
precise, falsifiable obligation **O-THERMO-∞**, stated with its kill
87-
condition in §"Thermodynamic Bridge" below. The earlier
88-
`cno-thermodynamic-optimality` formulation rested on a hardcoded
89-
`FiberSize ≡ 1` that made the claim vacuous; that hardcode is gone,
90-
and the honest finite/Bishop-finite case is proved instead.
78+
**Status: PROVED**, and (2026-05-18) generalised three times: from
79+
the identity to *every injective map* (`bennett-reversible-injective`),
80+
from `Fin n` to *any Bishop-finite carrier* via transport
81+
(`bennett-reversible-finite`, `EchoThermodynamicsFinite`), and from
82+
there to an *arbitrary carrier with no finiteness at all*
83+
(`bennett-reversible-arbitrary`, `EchoThermodynamicsArbitrary`),
84+
including the genuine infinite `Program` CNO
85+
(`bennett-reversible-cno-identity`). `bennett-reversible-id-zero` is a
86+
corollary. The Bennett zero direction is closed for *all* carriers.
87+
88+
**The infinite-carrier _quantitative collapse_ functional is
89+
`[CLOSED-NEG]`**: not a vague gap and no longer open — the falsifiable
90+
obligation **O-THERMO-∞** is now discharged *negatively*, its
91+
impossibility mechanised (`collapse-cost-impossible`,
92+
`EchoThermoCollapseImpossible`; see §"Thermodynamic Bridge" below). A
93+
count-based collapse cost provably cannot exist on an infinite carrier
94+
as a total `--safe` function — a settled boundary, do not reopen. The
95+
earlier `cno-thermodynamic-optimality` formulation rested on a
96+
hardcoded `FiberSize ≡ 1` that made the claim vacuous; that hardcode
97+
is gone, the honest finite/Bishop-finite/arbitrary cases are proved,
98+
and the infinite count case is settled negative.
9199

92100
### Theorem 5: Information-preservation (NOT YET FORMALISED)
93101

@@ -140,7 +148,7 @@ Absolute Zero defines CNOs with four properties:
140148
| `FinalState(p, σ) = σ` | `Echo p σ` contains `(σ, refl)` |
141149
| `NoSideEffects(p)` | `Echo p σ` is singleton (only `σ` maps to `σ`) |
142150
| `ThermodynamicallyReversible(p)` | `Echo p σ ≃ Echo id σ` |
143-
| `ThermodynamicOptimality(p)` | `fiber-erasure-bound p σ _≟_ T ≡ 0` _(proved for every injective `p` on any Bishop-finite carrier — Theorem 4; infinite-carrier case = falsifiable obligation O-THERMO-∞)_ |
151+
| `ThermodynamicOptimality(p)` | `reversible-erasure-cost p σ d T ≡ 0` _(proved for every injective `p` on **any** carrier — Bishop-finite via `fiber-erasure-bound`, arbitrary/infinite incl. the `Program` CNO via `reversible-erasure-cost` — Theorem 4; the quantitative-collapse functional on an infinite carrier is settled `[CLOSED-NEG]` — impossibility mechanised, `collapse-cost-impossible`)_ |
144152
| `InformationPreservation(p)` | _no formalised analogue — `echo-information-loss` was never defined; see Theorem 5_ |
145153
| `UniversalCNO(p)` | `∀ σ → Echo p σ ≃ Echo id σ` (NEW) |
146154
| `ModelIndependence(p)` | `Echo f y ≃ Echo f' y'` across isomorphic models (NEW) |
@@ -300,33 +308,84 @@ landauer-collapse-finite :
300308
fiber-erasure-bound-fin fd f y _≟_ T ≡ k * T * ⌊log₂ card fd ⌋
301309
```
302310

303-
### Open obligation O-THERMO-∞ (precise, falsifiable — not softened)
311+
**Proved — Bennett zero-cost on an _arbitrary_ carrier, past
312+
Bishop-finite (`EchoThermodynamicsArbitrary`).** The finiteness in the
313+
two results above is an artefact of routing cost through
314+
`FiberSize-fin` (an enumeration); the *physical content* of Bennett —
315+
a reversible map has no fan-in — needs no finiteness at all. An
316+
injective `f : A → B` has a subsingleton fiber for *any* `A : Set a`.
317+
Keying the Bennett cost on a decidable-inhabitation occupancy instead
318+
of an enumeration discharges this with no finiteness hypothesis,
319+
`--safe --without-K`, zero postulates:
304320

305-
The infinite carrier (`ProgramState = ℕ → ℕ`, or any `A` with no
306-
`A ≃ Fin n`) does **not** generalise, and the reason is now stated
307-
sharply enough to be refuted:
321+
```agda
322+
FiberSubsingleton f y = (p q : Echo f y) → proj₁ p ≡ proj₁ q -- K-free
323+
324+
injective⇒fiber-subsingleton : -- any A
325+
(inj : ∀ {x x′} → f x ≡ f x′ → x ≡ x′) → FiberSubsingleton f y
308326

309-
> **O-THERMO-∞.** There is no function
327+
bennett-reversible-arbitrary : -- A : Set a arbitrary; no Fin, no ≃
328+
(inj : ∀ {x x′ : A} → f x ≡ f x′ → x ≡ x′)
329+
(d : Dec (Echo f y)) (T : Temperature) →
330+
reversible-erasure-cost f y d T ≡ 0
331+
```
332+
333+
This is **not** a vacuous re-definition: `occupancy≡FiberSize-fin`
334+
proves the occupancy *coincides with* the established honest count
335+
`FiberSize-fin` on every finite restriction under the subsingleton
336+
hypothesis, and `bennett-arbitrary-refines-finite` shows it strictly
337+
subsumes the `Fin n` result of PR&nbsp;#58. The `--without-K` reason
338+
for the first-projection form (not full fiber `isProp`) is recorded in
339+
the module header: full `isProp` needs `B` an h-set / UIP, unavailable
340+
under `--without-K`; the projection form is K-free provable from
341+
injectivity and is exactly what the count needs.
342+
343+
**The real CNO theorem, on the infinite carrier.** `cno-identity :
344+
Program → Program` (the absolute-zero `Program = List Instruction`
345+
carrier — *infinite*, the very `ProgramState`-flavoured type the
346+
original companion remarks disclaimed) is injective, so
347+
`bennett-reversible-cno-identity` gives erasure cost `≡ 0` at every
348+
fiber and temperature. "A CNO dissipates zero Landauer energy" is now
349+
a *real* theorem for the identity/injective CNO over the genuine
350+
infinite carrier — no longer the vacuous claim the deleted
351+
`ECHO-CNO-BRIDGE-SUMMARY.md` made.
352+
353+
### O-THERMO-∞ — `[CLOSED-NEG]` (impossibility CONFIRMED)
354+
355+
O-THERMO-∞ concerns *only* the **quantitative collapse** functional
356+
(`fiber-erasure-bound` / `landauer-collapse`, the count direction) on
357+
an infinite carrier — a strictly different functional from the
358+
occupancy-keyed Bennett cost, which is closed for all carriers
359+
(occupancy is capped at 1; the collapse cost grows as `⌊log₂ N⌋` with
360+
the fiber count). It is **discharged via the second horn of its own
361+
kill condition**: a mechanised proof that clauses (i)∧(ii) ⊢ ⊥.
362+
363+
> **O-THERMO-∞ (as stated).** There is no function
310364
> `cost : (ℕ → B) → (y : B) → DecidableEquality B → Temperature → Energy`
311365
> that is (i) `--safe --without-K` total (no postulate, no escape
312366
> pragma), and (ii) agrees with `fiber-erasure-bound` on every finite
313-
> restriction `Fin n ↪ ℕ` (equivalently: agrees with
314-
> `fiber-erasure-bound-fin` for every `FiniteDomain`-witnessed
315-
> sub-carrier).
367+
> restriction `Fin n ↪ ℕ`.
368+
>
369+
> **Settled NEGATIVE.** `EchoThermoCollapseImpossible.collapse-cost-impossible`
370+
> mechanises (i)∧(ii) ⊢ ⊥ verbatim, for the doc's own named witness.
371+
> The constant map `c : ℕ → B`, `c _ = y₀` has an *infinite* fiber
372+
> (`nat-into-collapse-fiber{-injective}` exhibits `ℕ ↪ Echo c y₀` —
373+
> the structural reason no finite count exists). Its restriction along
374+
> any `Fin n ↪ ℕ` is the constant `Fin n → B`, whose
375+
> `fiber-erasure-bound` over `y₀` is `landauer-bound T n` (PR #58's
376+
> honest `FiberSize-fin-const`). Clause (ii) then forces the *single*
377+
> total value `cost c y₀ _≟_ T` to equal `landauer-bound T n` for
378+
> every `n`; at `T = 1` that is `⌊log₂ n⌋`, so it must be both `0`
379+
> (`n = 1`) and `1` (`n = 2`) — contradiction. Impossibility
380+
> **confirmed**: the quantitative-collapse functional provably does
381+
> *not* extend to an infinite carrier as a total `--safe` function.
316382
>
317-
> **Falsifier (how to kill this obligation).** Exhibit such a `cost`
318-
> and a mechanised proof of (i)+(ii); that refutes O-THERMO-∞ and
319-
> earns the claim back. **Witness that it bites:** the constant map
320-
> `c : ℕ → B`, `c _ = y₀` has `Echo c y₀ ≃ ℕ` — an infinite fiber.
321-
> Clause (ii) instantiated at the finite restrictions forces, by
322-
> `landauer-collapse`, `cost c y₀ _≟_ T = k · T · ⌊log₂ N⌋` with the
323-
> finite counts `N = 0,1,2,…` unboundedly — so any total `cost` must
324-
> assign `⌊log₂_⌋` of a quantity with no natural-number value. The
325-
> obligation is discharged in exactly one of two ways: a constructive
326-
> `cost` meeting (i)+(ii) (impossibility refuted), or a mechanised
327-
> proof that (i)∧(ii) ⊢ ⊥ (impossibility confirmed). Neither is in
328-
> the suite; until one lands, `ThermodynamicOptimality(p)` over an
329-
> infinite `ProgramState` is **`[OPEN]`**, not "future work".
383+
> This is a `[CLOSED-NEG]` boundary of the theory — a settled negative
384+
> result, **do not reopen**. It is *not* a softened "future work" item
385+
> and it is *not* a defect: the only way a count-based collapse cost
386+
> could exist on the infinite carrier is the (refuted) first horn, and
387+
> the negative is now mechanised. `--safe --without-K`, zero
388+
> postulates, zero escape pragmas; pinned in `Smoke.agda`.
330389

331390
### What is still NOT proved (unchanged)
332391

@@ -342,11 +401,17 @@ sharply enough to be refuted:
342401
and `fiber-erasure-bound`; now at the full Bishop-finite-carrier
343402
level, not merely `Fin n`.
344403
2. **Thermodynamic Reversibility (shape)**: proved for *every*
345-
injective map (`bennett-reversible-injective`) and lifted to any
346-
Bishop-finite carrier (`bennett-reversible-finite`).
347-
`bennett-reversible-id-zero` is now a corollary. The infinite
348-
`ProgramState` case is the single, falsifiable obligation
349-
O-THERMO-∞ above — `[OPEN]`, with a stated kill condition.
404+
injective map (`bennett-reversible-injective`), lifted to any
405+
Bishop-finite carrier (`bennett-reversible-finite`), and now to an
406+
*arbitrary* carrier with no finiteness at all
407+
(`bennett-reversible-arbitrary`), including the genuine infinite
408+
`Program` CNO (`bennett-reversible-cno-identity`).
409+
`bennett-reversible-id-zero` is a corollary. The Bennett zero
410+
direction is closed for all carriers; the quantitative-collapse
411+
functional on an infinite carrier (O-THERMO-∞) is now
412+
**`[CLOSED-NEG]`** — its impossibility is mechanised
413+
(`collapse-cost-impossible`), a settled boundary, no open
414+
obligation remains for this Direction.
350415
3. **Information Theory**: not bridged. Open work — see
351416
`docs/echo-types/roadmap.md`.
352417

docs/STABILITY_ANALYSIS.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,25 +78,46 @@ Echo {A = A} f y = Σ A (λ x → f x ≡ y)
7878

7979
**Stability:** New but well-grounded in existing echo type theory
8080

81-
#### 3.3 Thermodynamic Models: B- (was C+; advanced 2026-05-18)
82-
**Proofs:** `EchoThermodynamics.agda`, `EchoFiberCount.agda`, `EchoThermodynamicsFinite.agda`
81+
#### 3.3 Thermodynamic Models: B (was C+ → B-; advanced 2026-05-18)
82+
**Proofs:** `EchoThermodynamics.agda`, `EchoFiberCount.agda`, `EchoThermodynamicsFinite.agda`, `EchoThermodynamicsArbitrary.agda`, `EchoThermoCollapseImpossible.agda`
8383
- Landauer bound *shape* `k·T·⌊log₂ N⌋` (honest fiber count, no hardcode)
8484
- Bennett zero-cost for **every injective map** (`bennett-reversible-injective`),
8585
not just `id` at index zero — `bennett-reversible-id-zero` is now a corollary
8686
- Lifted off `Fin n` to **any Bishop-finite carrier** by transport along an
8787
explicit bijection (`FiniteDomain`, `bennett-reversible-finite`,
8888
`landauer-collapse-finite`) — `--safe --without-K`, zero postulates
89+
- Bennett zero-cost lifted further to an **arbitrary carrier — no finiteness
90+
at all** (`bennett-reversible-arbitrary`, occupancy-keyed; K-free
91+
subsingleton route), certified faithful vs. the established count
92+
(`occupancy≡FiberSize-fin`, `bennett-arbitrary-refines-finite`), and
93+
instantiated on the genuine **infinite** absolute-zero `Program` CNO
94+
(`bennett-reversible-cno-identity`) — the historically vacuous
95+
"CNO dissipates zero energy" is now a real theorem
8996
- Landauer worst-case collapse (`landauer-collapse[-finite]`)
97+
- **O-THERMO-∞ settled `[CLOSED-NEG]`**: the quantitative-collapse
98+
functional provably does *not* extend to an infinite carrier as a
99+
total `--safe` function — impossibility mechanised
100+
(`collapse-cost-impossible`; `nat-into-collapse-fiber` exhibits the
101+
collapse fiber as infinite). The doc's own kill condition,
102+
discharged via its second horn
90103

91104
**Stability:** The C+ ~70% rating was driven by one concrete gap — the only
92-
proved zero-cost instance was the identity at index zero. That gap is closed:
93-
optimality now holds for every injective map on every Bishop-finite carrier.
94-
The *single* remaining open item is the infinite-carrier case
95-
(`ProgramState = ℕ → ℕ`), now pinned as the **precise, falsifiable obligation
96-
O-THERMO-∞** with a stated kill condition (see
97-
`docs/ECHO-CNO-BRIDGE.adoc` §"Thermodynamic Bridge"). Not "needs more
98-
development" — one named obligation, refutable by exhibiting a total
99-
`--safe` cost functional or by mechanising its impossibility.
105+
proved zero-cost instance was the identity at index zero. That gap is fully
106+
closed: the Bennett zero-cost direction now holds for every injective map on
107+
**every carrier** — Bishop-finite *and* arbitrary/infinite, including the
108+
genuine infinite `Program` CNO. The previously-open item — the **quantitative
109+
collapse functional** (`fiber-erasure-bound` / `landauer-collapse`) on an
110+
infinite carrier, the obligation **O-THERMO-∞** — is now **discharged
111+
negatively**: `collapse-cost-impossible` mechanises its kill condition's
112+
second horn ((i)∧(ii) ⊢ ⊥) verbatim, for the doc's own named witness. It is
113+
therefore `[CLOSED-NEG]` — a settled boundary of the theory, do not reopen,
114+
not a defect. **No open obligation remains for this Direction.** The standing
115+
B- freeze (no re-rate until O-THERMO-∞ is discharged or refuted) is therefore
116+
lifted — discharged negatively counts as discharged — and the grade advances
117+
to **B**. (It is *not* higher: a confirmed-negative is an honest limit, not
118+
extra positive coverage; and the separate Information-Theory bridge — Theorem
119+
5, `echo-information-loss` never defined — remains unbuilt, but that is a
120+
different Direction.)
100121

101122
### 4. Proof Ecosystem Stability: B+
102123

@@ -111,7 +132,7 @@ development" — one named obligation, refutable by exhibiting a total
111132
| Relational | 80% | B |
112133
| CNO Integration | 98% | A- |
113134
| JanusKey Bridge | 90% | B+ |
114-
| Thermodynamics | 85% | B- |
135+
| Thermodynamics | 95% | B |
115136

116137
**Proof Quality Indicators:**
117138
- ✅ All core theorems have constructive proofs

docs/echo-types/MAP.adoc

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,30 @@ remainder of information-losing computation: for `f : A → B`,
5858

5959
== Directions
6060

61-
=== Thermodynamic — Landauer/Bennett energy bounds `[REAL*]`
61+
=== Thermodynamic — Landauer/Bennett energy bounds `[REAL]`
6262
Landauer/Bennett bound *shape*; `ThermodynamicallyReversible(p)
6363
≙ Echo p σ ≃ Echo id σ`. Zero-cost (Bennett) proved for *every
64-
injective map* on *any Bishop-finite carrier* (transport along an
65-
explicit bijection); the identity-at-zero instance is now a corollary.
66-
Sole residual is the infinite-carrier case, pinned as the falsifiable
67-
obligation **O-THERMO-∞** (kill condition stated). Re-rated B- / ~85%
68-
in STABILITY_ANALYSIS §3.3 (was C+ / ~70%, 2026-05-18). Stays `[REAL*]`
69-
— real, still partial — until O-THERMO-∞ is discharged or refuted.
64+
injective map* on *any Bishop-finite carrier*, and lifted to an
65+
*arbitrary carrier with no finiteness at all* (K-free subsingleton /
66+
occupancy route), certified faithful against the established count and
67+
instantiated on the genuine *infinite* absolute-zero `Program` CNO —
68+
"a CNO dissipates zero Landauer energy" is now a real theorem, not the
69+
historically vacuous claim. The one residual — the *quantitative
70+
collapse* functional on an infinite carrier, **O-THERMO-∞** — is now
71+
`[CLOSED-NEG]`: its impossibility is mechanised
72+
(`collapse-cost-impossible`, the doc's own kill condition discharged
73+
negatively). No open obligation remains for this Direction; tag
74+
advanced `[REAL*]` → `[REAL]`. Re-rated B / ~95% in
75+
STABILITY_ANALYSIS §3.3 (was C+ / ~70% then B- / ~90%, 2026-05-18);
76+
the standing B- freeze lifted because O-THERMO-∞ is now discharged
77+
(negatively). The Information-Theory bridge is a *separate* Direction
78+
(see Shannon entry), not part of this one.
7079

7180
* Proofs: `proofs/agda/EchoThermodynamics.agda`,
7281
`proofs/agda/EchoFiberCount.agda`,
73-
`proofs/agda/EchoThermodynamicsFinite.agda`.
82+
`proofs/agda/EchoThermodynamicsFinite.agda`,
83+
`proofs/agda/EchoThermodynamicsArbitrary.agda`,
84+
`proofs/agda/EchoThermoCollapseImpossible.agda`.
7485
* Docs: `docs/ECHO-CNO-BRIDGE.adoc` §"Thermodynamic Bridge",
7586
`docs/STABILITY_ANALYSIS.md` §3.3, `docs/WORK_PLAN.md` §5,
7687
`docs/adjacency/hott-fibers.adoc`.

proofs/agda/All.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ open import Dyadic
3030
open import DyadicEchoBridge
3131
open import EchoThermodynamics
3232
open import EchoThermodynamicsFinite
33+
open import EchoThermodynamicsArbitrary
34+
open import EchoThermoCollapseImpossible
3335
open import EchoStabilityTests
3436
open import VecRotation
3537

proofs/agda/EchoFiberCount.agda

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,42 @@ FiberSize-fin-injective {n = ℕ.suc m} f y _≟_ inj (suc i′) hit
174174
... | no _ = FiberSize-fin-injective (f ∘ suc) y _≟_
175175
(λ eq Fin-suc-inj (inj eq)) i′ hit
176176

177+
----------------------------------------------------------------------
178+
-- Headline 2c — FiberSize-fin-subsingleton
179+
--
180+
-- The fiber-local hypothesis behind the arbitrary-carrier Bennett
181+
-- result. If the fiber over `y` is a *subsingleton* — any two hitting
182+
-- indices coincide — and *some* index `i₀` hits, then the count is
183+
-- exactly 1. This is strictly weaker as a hypothesis than global
184+
-- injectivity: it only constrains the indices over `y`. Indeed
185+
-- `FiberSize-fin-injective` is the corollary obtained by feeding
186+
-- `ss i j fi fj = inj (trans fi (sym fj))` (kept as-is upstream for
187+
-- pin stability; this lemma is the honest generalisation).
188+
--
189+
-- The proof walks the `FiberSize-fin` recursion in lock-step with the
190+
-- witness exactly as the injective version does, but discharges the
191+
-- "no other hit" obligation from subsingleton-ness rather than from
192+
-- injectivity.
193+
----------------------------------------------------------------------
194+
195+
FiberSize-fin-subsingleton :
196+
{b} {B : Set b} {n : ℕ}
197+
(f : Fin n B) (y : B) (_≟_ : (y₁ y₂ : B) Dec (y₁ ≡ y₂))
198+
(ss : (i j : Fin n) f i ≡ y f j ≡ y i ≡ j)
199+
(i₀ : Fin n) f i₀ ≡ y
200+
FiberSize-fin f y _≟_ ≡ ℕ.suc ℕ.zero
201+
FiberSize-fin-subsingleton {n = ℕ.suc m} f y _≟_ ss zero hit
202+
with f zero ≟ y
203+
... | yes _ = cong ℕ.suc
204+
(FiberSize-fin-no-hit (f ∘ suc) y _≟_
205+
(λ j fsj≡y suc≢zero-Fin j (ss (suc j) zero fsj≡y hit)))
206+
... | no ¬p = ⊥-elim (¬p hit)
207+
FiberSize-fin-subsingleton {n = ℕ.suc m} f y _≟_ ss (suc i′) hit
208+
with f zero ≟ y
209+
... | yes p = ⊥-elim (suc≢zero-Fin i′ (sym (ss zero (suc i′) p hit)))
210+
... | no _ = FiberSize-fin-subsingleton (f ∘ suc) y _≟_
211+
(λ i j fi fj Fin-suc-inj (ss (suc i) (suc j) fi fj)) i′ hit
212+
177213
----------------------------------------------------------------------
178214
-- Headline 3 — FiberSize-fin ≡ 0 ⟺ ¬ Echo (split into two halves).
179215
--

0 commit comments

Comments
 (0)