Skip to content

Commit d3c6498

Browse files
Session/epi mono consumer (#155)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ea46e09 commit d3c6498

2 files changed

Lines changed: 181 additions & 7 deletions

File tree

docs/echo-types/echo-kernel-note.adoc

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,22 @@ kernel** — the boundary is real and lives outside this core.
148148
module. Listed so the DAG audit is complete.
149149

150150
| *Exploratory (not in `All.agda`)*
151-
| `EchoDecorationBridge`
151+
| `EchoDecorationBridge`, `EchoImageFactorizationPropPostulated`
152152
| Deliberately omitted from `proofs/agda/All.agda` so the verified
153-
suite is unaffected. Re-issues `EchoIntegration`'s integration
154-
claim through a `DecorationFit` record. Listed here only to
155-
satisfy the classification-drift lint
156-
(`scripts/kernel-guard.sh` Check B); the module itself is
157-
exploratory per `roadmap.adoc` § R5 and
153+
suite is unaffected. `EchoDecorationBridge` re-issues
154+
`EchoIntegration`'s integration claim through a `DecorationFit`
155+
record; exploratory per `roadmap.adoc` § R5 and
158156
`docs/echo-types/explorations/decoration-bridge/README.adoc`.
159-
Not kernel, not load-bearing, subject to abandonment.
157+
`EchoImageFactorizationPropPostulated` is the postulated-
158+
truncation-interface consumer for `EchoImageFactorizationProp`
159+
(flag profile `--without-K` only, no `--safe`, because
160+
`postulate` is forbidden under `--safe`) — demonstrates the
161+
parametric `TruncInterface` slot is plug-in-usable; the
162+
postulates assert the standard (-1)-truncation laws without
163+
proving them. Both modules listed here to satisfy the
164+
classification-drift lint (`scripts/kernel-guard.sh` Check B);
165+
neither is kernel, neither load-bearing, both subject to
166+
abandonment.
160167
|===
161168

162169
`EchoOrdinal` is Tier-1 off `Echo` but additionally pulls the
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
{-# OPTIONS --without-K #-}
2+
3+
-- Postulated-truncation consumer for `EchoImageFactorizationProp`.
4+
--
5+
-- ## Purpose
6+
--
7+
-- `EchoImageFactorizationProp` is module-parameterised in a
8+
-- `TruncInterface`, deliberately scoped to ship the (epi, mono)
9+
-- factorisation content WITHOUT committing to any particular
10+
-- implementation of propositional truncation. The base module
11+
-- itself is `--safe --without-K` with zero postulates; the
12+
-- propositional-truncation OBLIGATION is bumped to the consumer.
13+
--
14+
-- This module demonstrates the parameter is USABLE by exhibiting a
15+
-- concrete `TruncInterface ℓ` instance built from four postulates
16+
-- matching the four interface fields, then opens
17+
-- `ImageProp T f` to confirm the parametric content goes through
18+
-- on a concrete consumer.
19+
--
20+
-- ## Honest scope
21+
--
22+
-- This is a POSTULATED-INTERFACE demonstration, NOT a HIT
23+
-- construction. The postulates assert that propositional
24+
-- truncation exists and satisfies its standard laws — they do not
25+
-- prove the existence; they assume it.
26+
--
27+
-- The classification consequence:
28+
--
29+
-- * The flag profile is `--without-K` only (no `--safe`),
30+
-- because `--safe` forbids `postulate` entirely. This module
31+
-- therefore lives OUTSIDE the kernel cone and outside
32+
-- `proofs/agda/All.agda` (per the existing
33+
-- `EchoDecorationBridge` Exploratory precedent in
34+
-- `docs/echo-types/echo-kernel-note.adoc`).
35+
-- * Classification: Exploratory. Listed in the note to satisfy
36+
-- `scripts/kernel-guard.sh` Check B (classification-drift
37+
-- lint), not load-bearing.
38+
-- * The base `EchoImageFactorizationProp` remains kernel-cone
39+
-- compatible (`--safe --without-K`, zero postulates) and is
40+
-- the load-bearing artefact.
41+
--
42+
-- ## What this module ships
43+
--
44+
-- * Four `postulate` declarations realising the
45+
-- `TruncInterface ℓ` record fields.
46+
-- * `trunc : TruncInterface ℓ` — the packaged interface.
47+
-- * `module ImagePropPostulated f` re-opening
48+
-- `EchoImageFactorizationProp.ImageProp trunc f` for any
49+
-- `f : A → B` at the chosen levels.
50+
-- * `prop-factor-right-injective-demo` — a pinned re-export of
51+
-- the mono-side theorem from the parametric content,
52+
-- specialised to the postulated interface.
53+
-- * `prop-factor-left-mere-surjective-demo` — same for the
54+
-- epi-side.
55+
--
56+
-- ## What this module deliberately DOES NOT prove
57+
--
58+
-- * That the postulated `Trunc` IS the standard (-1)-truncation.
59+
-- It satisfies the interface laws by assumption; that is all
60+
-- the parametric proofs in `ImageProp` need.
61+
-- * Anything about the postulates' consistency. The standard
62+
-- HoTT discipline says the four laws together characterise
63+
-- `Trunc A` up to equivalence (and Cubical Agda or a hand-
64+
-- rolled HIT realises them concretely); we cite that
65+
-- literature rather than mechanise it.
66+
--
67+
-- The mechanical contribution: pin that the parameterised
68+
-- `EchoImageFactorizationProp.ImageProp` module can be CONSUMED
69+
-- via interface plug-in. The demonstrative side-effect is a
70+
-- visible auditable check that the base module's parameter slots
71+
-- match a real `TruncInterface ℓ` shape.
72+
--
73+
-- ## Headlines (this module's contribution)
74+
--
75+
-- * `trunc` — the packaged interface
76+
-- * `prop-factor-right-injective-demo` — mono side, plugged
77+
-- * `prop-factor-left-mere-surjective-demo` — epi side, plugged
78+
79+
module EchoImageFactorizationPropPostulated where
80+
81+
open import EchoImageFactorizationProp using (TruncInterface; module ImageProp)
82+
open import Echo using (Echo)
83+
84+
open import Level using (Level; suc)
85+
open import Data.Product.Base using (Σ; _,_)
86+
open import Relation.Binary.PropositionalEquality
87+
using (_≡_)
88+
89+
private variable
90+
: Level
91+
92+
----------------------------------------------------------------------
93+
-- Postulated truncation interface
94+
----------------------------------------------------------------------
95+
96+
-- The four standard propositional-truncation obligations. Cubical
97+
-- Agda or a hand-rolled HIT realises these concretely; here we take
98+
-- them as assumed.
99+
100+
postulate
101+
Trunc-pos : Set Set
102+
∣_∣-pos : {A : Set ℓ} A Trunc-pos A
103+
is-prop-pos : {A : Set ℓ} (x y : Trunc-pos A) x ≡ y
104+
rec-pos : {A B : Set ℓ}
105+
((x y : B) x ≡ y)
106+
(A B)
107+
Trunc-pos A B
108+
109+
----------------------------------------------------------------------
110+
-- Packaged `TruncInterface ℓ` from the postulates
111+
----------------------------------------------------------------------
112+
113+
-- Repackage the four postulates as the `TruncInterface ℓ` record
114+
-- consumed by `EchoImageFactorizationProp.module ImageProp`.
115+
116+
trunc : TruncInterface ℓ
117+
trunc = record
118+
{ Trunc = Trunc-pos
119+
; ∣_∣ = ∣_∣-pos
120+
; is-prop = is-prop-pos
121+
; rec = rec-pos
122+
}
123+
124+
----------------------------------------------------------------------
125+
-- Consumer demonstration: open `ImageProp trunc f` and re-export
126+
----------------------------------------------------------------------
127+
128+
-- Both `A` and `B` need to live at the SAME level `ℓ` per
129+
-- `ImageProp`'s implicit-equal-level signature. Same-level is the
130+
-- common Σ-product case in practice; cross-level consumers would
131+
-- need to lift to a common level (`Level.Lift`).
132+
133+
module ImagePropPostulated {A B : Set ℓ} (f : A B) where
134+
-- Open the parametric module with the postulated interface
135+
-- plugged in. Every name inside `ImageProp` is now available
136+
-- under this module's namespace.
137+
open ImageProp trunc f public
138+
139+
----------------------------------------------------------------------
140+
-- Demonstrative pinned exports
141+
----------------------------------------------------------------------
142+
143+
-- Headline 1 — MONO side, plugged. Pin the mono-side theorem at
144+
-- the postulated-interface specialisation. This confirms the
145+
-- parametric content goes through under interface plug-in (the
146+
-- proof type-checks at the concrete instance).
147+
148+
prop-factor-right-injective-demo :
149+
{A B : Set ℓ} (f : A B)
150+
{z₁ z₂ : Σ B (λ y Trunc-pos (Echo f y))}
151+
ImagePropPostulated.prop-factor-right f z₁
152+
153+
ImagePropPostulated.prop-factor-right f z₂
154+
z₁ ≡ z₂
155+
prop-factor-right-injective-demo f =
156+
ImagePropPostulated.prop-factor-right-injective f
157+
158+
-- Headline 2 — EPI side, plugged. Pin the epi-side theorem at the
159+
-- postulated-interface specialisation. The truncated existence is
160+
-- exactly the standard (-1)-truncated surjectivity.
161+
162+
prop-factor-left-mere-surjective-demo :
163+
{A B : Set ℓ} (f : A B)
164+
(z : Σ B (λ y Trunc-pos (Echo f y)))
165+
Trunc-pos (Σ A λ a ImagePropPostulated.prop-factor-left f a ≡ z)
166+
prop-factor-left-mere-surjective-demo f =
167+
ImagePropPostulated.prop-factor-left-mere-surjective f

0 commit comments

Comments
 (0)