Skip to content

Commit b9342e0

Browse files
ncfavierplt-amy
authored andcommitted
defn: based identity systems
1 parent 4571f46 commit b9342e0

File tree

1 file changed

+128
-3
lines changed

1 file changed

+128
-3
lines changed

src/1Lab/Path/IdentitySystem.lagda.md

Lines changed: 128 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ IdsJ-refl {R = R} {r = r} {a = a} ids P x =
8282
transport (λ i → P (ids .to-path (r a) i) (ids .to-path-over (r a) i)) x ≡⟨⟩
8383
subst P' (λ i → ids .to-path (r a) i , ids .to-path-over (r a) i) x ≡⟨ ap (λ e → subst P' e x) lemma ⟩
8484
subst P' refl x ≡⟨ transport-refl x ⟩
85-
x ∎
85+
x
8686
where
8787
P' : Σ _ (R a) → Type _
8888
P' (b , r) = P b r
@@ -117,9 +117,10 @@ to-path-over-refl {a = a} ids = ap (ap snd) $ to-path-refl-coh ids a
117117
-->
118118

119119
Note that for any $(R, r)$, the type of identity system data on $(R, r)$
120-
is a proposition. This is because it is exactly equivalent to the type
120+
is a [[proposition]]. This is because it is exactly equivalent to the type
121121
$\sum_a (R a)$ being contractible for every $a$, which is a proposition
122-
by standard results.
122+
by standard results. One direction is `is-contr-ΣR`{.Agda}; we prove
123+
the converse direction now.
123124

124125
```agda
125126
contr→identity-system
@@ -175,6 +176,130 @@ identity-system-gives-path {R = R} {r = r} ids =
175176
∙ transport-refl _ )
176177
```
177178

179+
## Based identity systems {defines="based-identity-system unary-identity-system"}
180+
181+
It is sometimes useful to characterise the *based* identity type at
182+
a point $a : A$, i.e. the family $a \is -$, instead of the whole
183+
binary family of paths $- \equiv -$. To that end, we introduce a unary
184+
variant of identity systems called **based identity systems**, or
185+
**unary identity systems**.
186+
187+
```agda
188+
record
189+
is-based-identity-system {ℓ ℓ'} {A : Type ℓ}
190+
(a : A)
191+
(C : A → Type ℓ')
192+
(refl : C a)
193+
: Type (ℓ ⊔ ℓ')
194+
where
195+
no-eta-equality
196+
field
197+
to-path : ∀ {b} → C b → a ≡ b
198+
to-path-over
199+
: ∀ {b} (p : C b)
200+
→ PathP (λ i → C (to-path p i)) refl p
201+
202+
open is-based-identity-system public
203+
204+
is-contr-ΣC
205+
: ∀ {ℓ ℓ'} {A : Type ℓ} {a : A} {C : A → Type ℓ'} {r : C a}
206+
→ is-based-identity-system a C r
207+
→ is-contr (Σ A C)
208+
is-contr-ΣC {r = r} ids .centre = _ , r
209+
is-contr-ΣC {r = r} ids .paths x i .fst = ids .to-path (x .snd) i
210+
is-contr-ΣC {r = r} ids .paths x i .snd = ids .to-path-over (x .snd) i
211+
```
212+
213+
As previously, the data of a based identity system at $a : A$ is
214+
precisely what is required to implement *based* path induction at $a$.
215+
216+
```agda
217+
IdsJ-based
218+
: ∀ {ℓ ℓ' ℓ''} {A : Type ℓ} {a : A} {C : A → Type ℓ'} {r : C a}
219+
→ is-based-identity-system a C r
220+
→ (P : ∀ b → C b → Type ℓ'')
221+
→ P a r
222+
→ ∀ {b} s → P b s
223+
IdsJ-based ids P pr s = transport
224+
(λ i → P (ids .to-path s i) (ids .to-path-over s i)) pr
225+
```
226+
227+
<!--
228+
```agda
229+
IdsJ-based-refl
230+
: ∀ {ℓ ℓ' ℓ''} {A : Type ℓ} {a : A} {C : A → Type ℓ'} {r : C a}
231+
→ (ids : is-based-identity-system a C r)
232+
→ (P : ∀ b → C b → Type ℓ'')
233+
→ (x : P a r)
234+
→ IdsJ-based ids P x r ≡ x
235+
IdsJ-based-refl {C = C} {r = r} ids P x =
236+
transport (λ i → P (ids .to-path r i) (ids .to-path-over r i)) x ≡⟨⟩
237+
subst P' (λ i → ids .to-path r i , ids .to-path-over r i) x ≡⟨ ap (λ e → subst P' e x) lemma ⟩
238+
subst P' refl x ≡⟨ transport-refl x ⟩
239+
x ∎
240+
where
241+
P' : Σ _ C → Type _
242+
P' (b , c) = P b c
243+
244+
lemma : Σ-pathp (ids .to-path r) (ids .to-path-over r) ≡ refl
245+
lemma = is-contr→is-set (is-contr-ΣC ids) _ _ _ _
246+
247+
to-path-based-refl-coh
248+
: ∀ {ℓ ℓ'} {A : Type ℓ} {a : A} {C : A → Type ℓ'} {r : C a}
249+
→ (ids : is-based-identity-system a C r)
250+
→ (Σ-pathp (ids .to-path r) (ids .to-path-over r)) ≡ refl
251+
to-path-based-refl-coh {r = r} ids =
252+
is-contr→is-set (is-contr-ΣC ids) _ _
253+
(Σ-pathp (ids .to-path r) (ids .to-path-over r))
254+
refl
255+
256+
to-path-based-refl
257+
: ∀ {ℓ ℓ'} {A : Type ℓ} {a : A} {C : A → Type ℓ'} {r : C a}
258+
→ (ids : is-based-identity-system a C r)
259+
→ ids .to-path r ≡ refl
260+
to-path-based-refl ids = ap (ap fst) $ to-path-based-refl-coh ids
261+
262+
to-path-over-based-refl
263+
: ∀ {ℓ ℓ'} {A : Type ℓ} {a : A} {C : A → Type ℓ'} {r : C a}
264+
→ (ids : is-based-identity-system a C r)
265+
→ PathP (λ i → PathP (λ j → C (to-path-based-refl ids i j)) r r)
266+
(ids .to-path-over r)
267+
refl
268+
to-path-over-based-refl ids = ap (ap snd) $ to-path-based-refl-coh ids
269+
270+
contr→based-identity-system
271+
: ∀ {ℓ ℓ'} {A : Type ℓ} {a : A} {C : A → Type ℓ'} {r : C a}
272+
→ is-contr (Σ _ C)
273+
→ is-based-identity-system a C r
274+
contr→based-identity-system {a = a} {C = C} {r} c = ids where
275+
paths' : ∀ (p : Σ _ C) → (a , r) ≡ p
276+
paths' _ = is-contr→is-prop c _ _
277+
278+
ids : is-based-identity-system a C r
279+
ids .to-path p = ap fst (paths' (_ , p))
280+
ids .to-path-over p = ap snd (paths' (_ , p))
281+
282+
based-identity-system-gives-path
283+
: ∀ {ℓ ℓ'} {A : Type ℓ} {a : A} {C : A → Type ℓ'} {r : C a}
284+
→ is-based-identity-system a C r
285+
→ ∀ {b} → C b ≃ (a ≡ b)
286+
based-identity-system-gives-path {a = a} {C = C} {r = r} ids =
287+
Iso→Equiv (ids .to-path , iso from ri li) where
288+
from : ∀ {b} → a ≡ b → C b
289+
from p = subst C p r
290+
291+
ri : ∀ {b} → is-right-inverse (from {b}) (ids .to-path)
292+
ri = J (λ y p → ids .to-path (from p) ≡ p)
293+
( ap (ids .to-path) (transport-refl _)
294+
∙ to-path-based-refl ids)
295+
296+
li : ∀ {b} → is-left-inverse (from {b}) (ids .to-path)
297+
li = IdsJ-based ids (λ y p → from (ids .to-path p) ≡ p)
298+
( ap from (to-path-based-refl ids)
299+
∙ transport-refl _)
300+
```
301+
-->
302+
178303
## In subtypes
179304

180305
Let $f : A \mono B$ be an embedding. If $(R, r)$ is an identity system

0 commit comments

Comments
 (0)