Skip to content

Commit e822b8f

Browse files
committed
feat: forget-witness-encoding-has-section — universal LL-encoding gap
Strengthens EchoLLEncoding's existence theorem (`ll-encoding-gap`, the trivial ⊤-shadow) to the UNIVERSAL form over the forget-witness class: every shallow LL encoding whose `X linear` is a proposition (no inhabitant-level witness at the linear mode) admits an encoded section of `wX`. The section is the constant map at a fixed linear inhabitant `enc echo-true`, correct by forget-witness propositionality — uniform over the class, no cherry-picked carrier. - `ForgetsWitness E = (x y : X linear) → x ≡ y` — the invariant. - `forget-witness-encoding-has-section` — the universal headline. - `trivial-forgets-witness` — the ⊤-shadow is in the class. - `trivial-via-universal` — the existence form recovered from the universal one (the generalisation is checked, not asserted). Sharpens the dichotomy: forget the witness ⇒ a section always exists; keep it (`X linear` not a proposition) ⇒ no-section may be preserved, but the encoding is then no longer the standard `!A := 1` shadow. Header headline list, scope guardrail, and companion remark updated to match. `--safe --without-K`, zero postulates. 4 Smoke pins; `EchoLLEncoding` already classified (no new module). EchoLLEncoding + Smoke.agda + All.agda exit 0; kernel-guard PASS. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018CaSgNjNURC7ocsyjYh9We
1 parent 8a23fa4 commit e822b8f

2 files changed

Lines changed: 84 additions & 16 deletions

File tree

proofs/agda/EchoLLEncoding.agda

Lines changed: 80 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,26 @@
5656
-- * source-no-section -- matched-negative: source-side
5757
-- no-section-weaken (cited)
5858
-- * gap-paired -- gap + source matched in one Σ
59+
-- * ForgetsWitness -- the forget-witness invariant
60+
-- (`X linear` a proposition)
61+
-- * forget-witness-encoding-has-section -- UNIVERSAL form: every
62+
-- forget-witness encoding has a
63+
-- section
64+
-- * trivial-forgets-witness -- the trivial shadow is in the class
65+
-- * trivial-via-universal -- existence form recovered from the
66+
-- universal one (checked)
5967
--
60-
-- Scope guardrail. The theorem proved is the *existence* of an LL-
61-
-- shallow encoding with an encoded section. It is NOT a claim that
62-
-- *every* LL encoding loses the no-section property — a sufficiently
63-
-- rich encoding (one that keeps the witness equality in `X linear`)
64-
-- could in principle preserve it. The interesting content is that
65-
-- the *standard* LL collapse — sending `!A` to a forget-resources
66-
-- shadow — already loses it. The companion remark at the end of the
67-
-- file makes this explicit.
68+
-- Scope guardrail. Two strengths are proved. (1) `ll-encoding-gap` is the
69+
-- *existence* of an LL-shallow encoding with an encoded section.
70+
-- (2) `forget-witness-encoding-has-section` is the *universal* form over
71+
-- the *forget-witness class*: every encoding whose `X linear` is a
72+
-- proposition (no inhabitant-level witness at the linear mode) has an
73+
-- encoded section. What remains NOT claimed is universality over *all*
74+
-- encodings: an encoding that does NOT forget the witness (re-introduces
75+
-- the second-projection equality into `X linear`, so `X linear` is not a
76+
-- proposition) could preserve no-section — but it is then no longer the
77+
-- standard `!A := 1` LL shadow. The companion remark sharpens this
78+
-- dichotomy.
6879

6980
module EchoLLEncoding where
7081

@@ -74,6 +85,7 @@ open import EchoLinear
7485
; weaken
7586
; no-section-weaken
7687
)
88+
open import EchoCharacteristic using (echo-true)
7789

7890
open import Data.Product.Base using (Σ; _,_; proj₁; proj₂; _×_)
7991
open import Data.Unit.Base using (⊤; tt)
@@ -201,17 +213,69 @@ gap-paired :
201213
(λ raise e raise (weaken e) ≡ e))
202214
gap-paired = ll-encoding-gap , source-no-section
203215

216+
----------------------------------------------------------------------
217+
-- The universal form: the gap holds for the WHOLE forget-witness class.
218+
--
219+
-- `ll-encoding-gap` is an existence statement (the trivial shadow). The
220+
-- strengthening below pins the *universal* content the audit asked for:
221+
-- EVERY shallow LL encoding that *forgets the witness* admits an encoded
222+
-- section of `wX`. "Forgets the witness" is made precise as `X linear`
223+
-- being a *proposition* (a subsingleton) — no inhabitant-level
224+
-- distinction survives at the linear mode, exactly the data
225+
-- `no-section-weaken` depends on. The standard `!A := 1` shadow is the
226+
-- minimal member of this class; so is any `X m := F m` with `F` constant
227+
-- on inhabitants.
228+
--
229+
-- The section is the constant map at a fixed linear inhabitant
230+
-- `enc echo-true`, correct because forget-witness propositionality makes
231+
-- every `X linear` element equal to it. No cherry-picked carrier: the
232+
-- argument is uniform over the class.
233+
----------------------------------------------------------------------
234+
235+
-- The forget-witness invariant: `X linear` is a proposition.
236+
ForgetsWitness : LLShallowEncoding Set
237+
ForgetsWitness E = let open LLShallowEncoding E in (x y : X linear) x ≡ y
238+
239+
-- Universal headline: any forget-witness shallow LL encoding has an
240+
-- encoded section, so the encoded analogue of `no-section-weaken` fails
241+
-- across the whole class — not merely at the trivial shadow.
242+
forget-witness-encoding-has-section :
243+
(E : LLShallowEncoding) ForgetsWitness E
244+
let open LLShallowEncoding E
245+
in Σ (X affine X linear) (λ s x s (wX x) ≡ x)
246+
forget-witness-encoding-has-section E prop =
247+
let open LLShallowEncoding E
248+
in (λ _ enc {linear} echo-true) , (λ x prop (enc {linear} echo-true) x)
249+
250+
-- The trivial `⊤`-shadow is a member of the forget-witness class
251+
-- (`X linear = ⊤` is a proposition)…
252+
trivial-forgets-witness : ForgetsWitness trivial-encoding
253+
trivial-forgets-witness tt tt = refl
254+
255+
-- …so the existence form `trivial-encoding-has-section` is recovered as
256+
-- the universal form instantiated at the trivial encoding — the
257+
-- generalisation is checked, not merely asserted.
258+
trivial-via-universal :
259+
let open LLShallowEncoding trivial-encoding
260+
in Σ (X affine X linear) (λ s x s (wX x) ≡ x)
261+
trivial-via-universal =
262+
forget-witness-encoding-has-section trivial-encoding trivial-forgets-witness
263+
204264
----------------------------------------------------------------------
205265
-- Companion remark on what is NOT claimed.
206266
--
207-
-- * This is an EXISTENCE statement: there exists a shallow LL
208-
-- encoding under which `no-section-weaken` fails to lift. It is
209-
-- NOT a universal statement that every conceivable LL-style
210-
-- encoding loses the property. A sufficiently rich encoding — one
211-
-- that re-introduces the second-projection equality witness into
212-
-- `X linear` — could preserve no-section, but such an encoding is
213-
-- no longer the standard `!A := 1` LL shadow; it has smuggled the
214-
-- Echo structure back in.
267+
-- * The result is now SHARP, in two strengths. `ll-encoding-gap` is the
268+
-- existence statement (the trivial shadow loses no-section).
269+
-- `forget-witness-encoding-has-section` is universal over the
270+
-- forget-witness class: EVERY encoding whose `X linear` is a
271+
-- proposition loses it. The dichotomy is exact — forget the witness
272+
-- (`X linear` a proposition) ⇒ an encoded section always exists; keep
273+
-- the witness (re-introduce the second-projection equality into
274+
-- `X linear`, so it is not a proposition) ⇒ no-section may be
275+
-- preserved, but the encoding is then no longer the standard
276+
-- `!A := 1` LL shadow; it has smuggled the Echo structure back in.
277+
-- So the *only* way for a shallow LL encoding to carry Echo's
278+
-- no-section discipline is to stop being a witness-forgetting shadow.
215279
--
216280
-- * The encoding gap is therefore best read as: "the standard LL
217281
-- `!A` interpretation is too weak to be a faithful translation of

proofs/agda/Smoke.agda

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,10 @@ open import EchoLLEncoding using
671671
; ll-encoding-gap
672672
; source-no-section
673673
; gap-paired
674+
; ForgetsWitness
675+
; forget-witness-encoding-has-section
676+
; trivial-forgets-witness
677+
; trivial-via-universal
674678
)
675679

676680
-- examples.EchoVsSigma — Track C of the Echo-vs-Σ identity claim.

0 commit comments

Comments
 (0)