Skip to content

Commit 9c5ada0

Browse files
committed
def: more general composition and cancellation properties
1 parent 17e9fba commit 9c5ada0

File tree

1 file changed

+185
-36
lines changed

1 file changed

+185
-36
lines changed

src/Cat/Displayed/Cartesian/Joint.lagda.md

Lines changed: 185 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -154,16 +154,19 @@ such that $f_{i} \circ \langle v , h_{i} \rangle = h_{i}$.
154154
<!--
155155
```agda
156156
private variable
157-
ℓi : Level
158-
Ix Ix' : Type ℓi
157+
ℓi ℓj : Level
158+
Ix : Type ℓi
159+
Jx : Ix → Type ℓj
159160
a b c : Ob
160161
bᵢ cᵢ : Ix → Ob
162+
cᵢⱼ : (i : Ix) → Jx i → Ob
161163
a' b' c' : Ob[ a ]
162164
bᵢ' cᵢ' : (ix : Ix) → Ob[ bᵢ ix ]
165+
cᵢⱼ' : (i : Ix) → (j : Jx i) → Ob[ cᵢⱼ i j ]
163166
u v : Hom a b
164-
uᵢ vᵢ : ∀ (ix : Ix) → Hom a (bᵢ ix)
167+
uᵢ uⱼ vᵢ vⱼ : ∀ (ix : Ix) → Hom a (bᵢ ix)
165168
f g : Hom[ u ] a' b'
166-
fᵢ fᵢ' gᵢ : ∀ (ix : Ix) → Hom[ uᵢ ix ] a' (bᵢ' ix)
169+
fᵢ fⱼ fᵢ' gᵢ gⱼ : ∀ (ix : Ix) → Hom[ uᵢ ix ] a' (bᵢ' ix)
167170
```
168171
-->
169172

@@ -252,13 +255,79 @@ empty-jointly-cartesian→discrete ¬ix fᵢ-cart v x' =
252255

253256
## Closure properties of jointly cartesian families
254257

255-
Jointly cartesian families are closed under precomposition with [[cartesian maps]].
258+
If $g_{i} : X' \to_{v_i} Y_{i}'$ is an $I$-indexed jointly cartesian family, and
259+
$f_{i,j} : Y_{i}' \to_{u_{i,j}} Z_{i,j}'$ is an $I$-indexed family of $J_{i}$-indexed
260+
jointly cartesian families, then their composite is a $\Sigma (i : I).\; J_i$-indexed
261+
jointly cartesian family.
262+
263+
```agda
264+
jointly-cartesian-∘
265+
: {uᵢⱼ : (i : Ix) → (j : Jx i) → Hom (bᵢ i) (cᵢⱼ i j)}
266+
→ {fᵢⱼ : (i : Ix) → (j : Jx i) → Hom[ uᵢⱼ i j ] (bᵢ' i) (cᵢⱼ' i j)}
267+
→ {vᵢ : (i : Ix) → Hom a (bᵢ i)}
268+
→ {gᵢ : (i : Ix) → Hom[ vᵢ i ] a' (bᵢ' i)}
269+
→ (∀ i → is-jointly-cartesian (uᵢⱼ i) (fᵢⱼ i))
270+
→ is-jointly-cartesian vᵢ gᵢ
271+
→ is-jointly-cartesian
272+
(λ ij → uᵢⱼ (ij .fst) (ij .snd) ∘ vᵢ (ij .fst))
273+
(λ ij → fᵢⱼ (ij .fst) (ij .snd) ∘' gᵢ (ij .fst))
274+
```
275+
276+
<!--
277+
```agda
278+
_ = cartesian-∘
279+
```
280+
-->
281+
282+
Despite the high quantifier complexity of the statement, the proof
283+
follows the exact same plan that we use to show that `cartesian maps compose`{.Agda ident=cartesian-∘}.
284+
285+
```agda
286+
jointly-cartesian-∘ {Ix = Ix} {uᵢⱼ = uᵢⱼ} {fᵢⱼ = fᵢⱼ} {vᵢ = vᵢ} {gᵢ = gᵢ} fᵢⱼ-cart gᵢ-cart =
287+
fᵢⱼ∘gᵢ-cart
288+
where
289+
module fᵢⱼ (i : Ix) = is-jointly-cartesian (fᵢⱼ-cart i)
290+
module gᵢ = is-jointly-cartesian gᵢ-cart
291+
open is-jointly-cartesian
292+
293+
fᵢⱼ∘gᵢ-cart
294+
: is-jointly-cartesian
295+
(λ ij → uᵢⱼ (ij .fst) (ij .snd) ∘ vᵢ (ij .fst))
296+
(λ ij → fᵢⱼ (ij .fst) (ij .snd) ∘' gᵢ (ij .fst))
297+
fᵢⱼ∘gᵢ-cart .universal v hᵢⱼ =
298+
gᵢ.universal v λ i →
299+
fᵢⱼ.universal' i (λ j → assoc (uᵢⱼ i j) (vᵢ i) v) λ j →
300+
hᵢⱼ (i , j)
301+
fᵢⱼ∘gᵢ-cart .commutes w hᵢⱼ (i , j) =
302+
cast[] $
303+
(fᵢⱼ i j ∘' gᵢ i) ∘' gᵢ.universal _ (λ i → fᵢⱼ.universal' i _ (λ j → hᵢⱼ (i , j))) ≡[]⟨ pullr[] _ (gᵢ.commutes w _ i) ⟩
304+
fᵢⱼ i j ∘' fᵢⱼ.universal' i _ (λ j → hᵢⱼ (i , j)) ≡[]⟨ fᵢⱼ.commutesp i _ _ j ⟩
305+
hᵢⱼ (i , j) ∎
306+
fᵢⱼ∘gᵢ-cart .unique {hᵢ = hᵢⱼ} other p =
307+
gᵢ.unique other $ λ i →
308+
fᵢⱼ.uniquep i _ _ _ (gᵢ i ∘' other) λ j →
309+
fᵢⱼ i j ∘' gᵢ i ∘' other ≡[]⟨ assoc' (fᵢⱼ i j) (gᵢ i) other ⟩
310+
(fᵢⱼ i j ∘' gᵢ i) ∘' other ≡[]⟨ p (i , j) ⟩
311+
hᵢⱼ (i , j) ∎
312+
```
313+
314+
As a nice corollary, we get that jointly cartesian families compose with
315+
[[cartesian maps]], as cartesian maps are precisely the singleton jointly cartesian
316+
families.
256317

257318
```agda
258319
jointly-cartesian-cartesian-∘
259320
: is-jointly-cartesian uᵢ fᵢ
260321
→ is-cartesian v g
261322
→ is-jointly-cartesian (λ ix → uᵢ ix ∘ v) (λ ix → fᵢ ix ∘' g)
323+
```
324+
325+
<details>
326+
<summary>We actually opt to prove this corollary by hand to get nicer
327+
definitional behaviour of the resulting universal maps.
328+
</summary>
329+
330+
```agda
262331
jointly-cartesian-cartesian-∘ {uᵢ = uᵢ} {fᵢ = fᵢ} {v = v} {g = g} fᵢ-cart g-cart = fᵢ∘g-cart
263332
where
264333
module fᵢ = is-jointly-cartesian fᵢ-cart
@@ -278,6 +347,7 @@ jointly-cartesian-cartesian-∘ {uᵢ = uᵢ} {fᵢ = fᵢ} {v = v} {g = g} fᵢ
278347
fᵢ.uniquep _ _ _ (g ∘' other) λ ix →
279348
assoc' (fᵢ ix) g other ∙[] pᵢ ix
280349
```
350+
</details>
281351

282352
Similarly, if $f_{i}$ is a family of maps with each $f_{i}$ individually
283353
cartesian, and $g_{i}$ is jointly cartesian, then the composite $f_{i} \circ g_{i}$
@@ -288,6 +358,12 @@ pointwise-cartesian-jointly-cartesian-∘
288358
: (∀ ix → is-cartesian (uᵢ ix) (fᵢ ix))
289359
→ is-jointly-cartesian vᵢ gᵢ
290360
→ is-jointly-cartesian (λ ix → uᵢ ix ∘ vᵢ ix) (λ ix → fᵢ ix ∘' gᵢ ix)
361+
```
362+
363+
<details>
364+
<summary>We again prove this by hand to get better definitional behaviour.
365+
</summary>
366+
```agda
291367
pointwise-cartesian-jointly-cartesian-∘
292368
{uᵢ = uᵢ} {fᵢ = fᵢ} {vᵢ = vᵢ} {gᵢ = gᵢ} fᵢ-cart gᵢ-cart = fᵢ∘gᵢ-cart where
293369
module fᵢ ix = is-cartesian (fᵢ-cart ix)
@@ -307,6 +383,7 @@ pointwise-cartesian-jointly-cartesian-∘
307383
fᵢ.uniquep ix _ _ _ (gᵢ ix ∘' other)
308384
(assoc' (fᵢ ix) (gᵢ ix) other ∙[] p ix)
309385
```
386+
</details>
310387

311388
Like their non-familial counterparts, jointly cartesian maps are stable
312389
under vertical retractions.
@@ -334,7 +411,8 @@ so we omit the details.
334411
</summary>
335412
```agda
336413
jointly-cartesian-vertical-retraction-stable
337-
{uᵢ = uᵢ} {fᵢ = fᵢ} {fᵢ' = fᵢ'} {ϕ = ϕ} fᵢ-cart ϕ-sect factor = fᵢ'-cart
414+
{uᵢ = uᵢ} {fᵢ = fᵢ} {fᵢ' = fᵢ'} {ϕ = ϕ} fᵢ-cart ϕ-sect factor
415+
= fᵢ'-cart
338416
where
339417
module fᵢ = is-jointly-cartesian fᵢ-cart
340418
module ϕ = has-section[_] ϕ-sect
@@ -369,7 +447,9 @@ jointly-cartesian-vertical-retraction-stable
369447

370448
## Cancellation properties of jointly cartesian families
371449

372-
Every jointly cartesian family is a [[jointly weak monic family]].
450+
Every jointly cartesian family is a [[jointly weak monic family]];
451+
this follows immediately from the uniqueness portion of the
452+
universal property.
373453

374454
```agda
375455
jointly-cartesian→jointly-weak-monic
@@ -380,16 +460,105 @@ jointly-cartesian→jointly-weak-monic {fᵢ = fᵢ} fᵢ-cart {g = w} g h p p'
380460
where module fᵢ = is-jointly-cartesian fᵢ-cart
381461
```
382462

383-
If $f_{i} \circ g_{i}$ is jointly cartesian, and each $f_{i}$ is
384-
[[weakly monic]], then $g_{i}$ must be jointly cartesian.
463+
If $f_{i,j}$ is an $I$-indexed family of $J_{i}$-indexed
464+
[[jointly weak monic families]] and $f_{i,j} \circ g_{i}$ is a
465+
$\Sigma (i : I).\; J_{i}$-indexed jointly cartesian family, then
466+
$g_{i}$ must be a $I$-indexed jointly cartesian family.
467+
468+
```agda
469+
jointly-cartesian-weak-monic-cancell
470+
: {uᵢⱼ : (i : Ix) → (j : Jx i) → Hom (bᵢ i) (cᵢⱼ i j)}
471+
→ {fᵢⱼ : (i : Ix) → (j : Jx i) → Hom[ uᵢⱼ i j ] (bᵢ' i) (cᵢⱼ' i j)}
472+
→ {vᵢ : (i : Ix) → Hom a (bᵢ i)}
473+
→ {gᵢ : (i : Ix) → Hom[ vᵢ i ] a' (bᵢ' i)}
474+
→ (∀ i → is-jointly-weak-monic (fᵢⱼ i))
475+
→ is-jointly-cartesian
476+
(λ ij → uᵢⱼ (ij .fst) (ij .snd) ∘ vᵢ (ij .fst))
477+
(λ ij → fᵢⱼ (ij .fst) (ij .snd) ∘' gᵢ (ij .fst))
478+
→ is-jointly-cartesian vᵢ gᵢ
479+
```
480+
481+
Like the general composition lemma for jointly cartesian families,
482+
the statement is more complicated than the proof, which follows from
483+
some short calculations.
484+
485+
```agda
486+
jointly-cartesian-weak-monic-cancell
487+
{uᵢⱼ = uᵢⱼ} {fᵢⱼ} {vᵢ} {gᵢ} fᵢⱼ-weak-mono fᵢⱼ∘gᵢ-cart
488+
= gᵢ-cart
489+
where
490+
module fᵢⱼ∘gᵢ = is-jointly-cartesian fᵢⱼ∘gᵢ-cart
491+
open is-jointly-cartesian
492+
493+
gᵢ-cart : is-jointly-cartesian vᵢ gᵢ
494+
gᵢ-cart .universal w hᵢ =
495+
fᵢⱼ∘gᵢ.universal' (λ (i , j) → sym (assoc (uᵢⱼ i j) (vᵢ i) w)) λ (i , j) →
496+
fᵢⱼ i j ∘' hᵢ i
497+
gᵢ-cart .commutes w hᵢ i =
498+
fᵢⱼ-weak-mono i _ _ refl $ λ j →
499+
cast[] $
500+
fᵢⱼ i j ∘' gᵢ i ∘' fᵢⱼ∘gᵢ.universal' _ (λ (i , j) → fᵢⱼ i j ∘' hᵢ i) ≡[]⟨ assoc' _ _ _ ⟩
501+
(fᵢⱼ i j ∘' gᵢ i) ∘' fᵢⱼ∘gᵢ.universal' _ (λ (i , j) → fᵢⱼ i j ∘' hᵢ i) ≡[]⟨ fᵢⱼ∘gᵢ.commutesp _ _ (i , j) ⟩
502+
fᵢⱼ i j ∘' hᵢ i ∎
503+
gᵢ-cart .unique other p =
504+
fᵢⱼ∘gᵢ.uniquep _ _ _ other λ (i , j) →
505+
pullr[] _ (p i)
506+
```
507+
508+
As an immediate corollary, we get a left cancellation property
509+
for composites of joint cartesian families.
510+
511+
```agda
512+
jointly-cartesian-cancell
513+
: {uᵢⱼ : (i : Ix) → (j : Jx i) → Hom (bᵢ i) (cᵢⱼ i j)}
514+
→ {fᵢⱼ : (i : Ix) → (j : Jx i) → Hom[ uᵢⱼ i j ] (bᵢ' i) (cᵢⱼ' i j)}
515+
→ {vᵢ : (i : Ix) → Hom a (bᵢ i)}
516+
→ {gᵢ : (i : Ix) → Hom[ vᵢ i ] a' (bᵢ' i)}
517+
→ (∀ i → is-jointly-cartesian (uᵢⱼ i) (fᵢⱼ i))
518+
→ is-jointly-cartesian
519+
(λ ij → uᵢⱼ (ij .fst) (ij .snd) ∘ vᵢ (ij .fst))
520+
(λ ij → fᵢⱼ (ij .fst) (ij .snd) ∘' gᵢ (ij .fst))
521+
→ is-jointly-cartesian vᵢ gᵢ
522+
jointly-cartesian-cancell fᵢⱼ-cart fᵢⱼ∘gᵢ-cart =
523+
jointly-cartesian-weak-monic-cancell
524+
(λ i → jointly-cartesian→jointly-weak-monic (fᵢⱼ-cart i))
525+
fᵢⱼ∘gᵢ-cart
526+
```
527+
528+
We also obtain a further set of corollaries that describe some special
529+
cases of the general cancellation property.
385530

386531
```agda
387532
jointly-cartesian-pointwise-weak-monic-cancell
388533
: (∀ ix → is-weak-monic (fᵢ ix))
389534
→ is-jointly-cartesian (λ ix → uᵢ ix ∘ vᵢ ix) (λ ix → fᵢ ix ∘' gᵢ ix)
390535
→ is-jointly-cartesian vᵢ gᵢ
536+
537+
jointly-cartesian-jointly-weak-monic-cancell
538+
: is-jointly-weak-monic fᵢ
539+
→ is-jointly-cartesian (λ ix → uᵢ ix ∘ v) (λ ix → fᵢ ix ∘' g)
540+
→ is-cartesian v g
541+
542+
jointly-cartesian-pointwise-cartesian-cancell
543+
: (∀ ix → is-cartesian (uᵢ ix) (fᵢ ix))
544+
→ is-jointly-cartesian (λ ix → uᵢ ix ∘ vᵢ ix) (λ ix → fᵢ ix ∘' gᵢ ix)
545+
→ is-jointly-cartesian vᵢ gᵢ
546+
547+
jointly-cartesian-cartesian-cancell
548+
: is-jointly-cartesian uᵢ fᵢ
549+
→ is-jointly-cartesian (λ ix → uᵢ ix ∘ v) (λ ix → fᵢ ix ∘' g)
550+
→ is-cartesian v g
551+
```
552+
553+
<details>
554+
<summary>As before, we opt to prove these results by hand to get nicer
555+
definitional behaviour.
556+
</summary>
557+
558+
```agda
391559
jointly-cartesian-pointwise-weak-monic-cancell
392-
{uᵢ = uᵢ} {fᵢ = fᵢ} {vᵢ = vᵢ} {gᵢ = gᵢ} fᵢ-weak-monic fᵢ∘gᵢ-cart = gᵢ-cart
560+
{uᵢ = uᵢ} {fᵢ = fᵢ} {vᵢ = vᵢ} {gᵢ = gᵢ} fᵢ-weak-monic fᵢ∘gᵢ-cart
561+
= gᵢ-cart
393562
where
394563
module fᵢ∘gᵢ = is-jointly-cartesian fᵢ∘gᵢ-cart
395564
open is-jointly-cartesian
@@ -406,19 +575,10 @@ jointly-cartesian-pointwise-weak-monic-cancell
406575
fᵢ ix ∘' hᵢ ix ∎
407576
gᵢ-cart .unique other p =
408577
fᵢ∘gᵢ.uniquep _ _ _ other (λ ix → pullr[] _ (p ix))
409-
```
410-
411-
We can sharpen the previous result when $g_{i}$ is a constant family.
412-
In particular, if $f_{i} \circ g$ is jointly cartesian, and $f_{i}$ is a
413-
[[jointly weak monic family]], then $g$ must be cartesian.
414578
415-
```agda
416579
jointly-cartesian-jointly-weak-monic-cancell
417-
: is-jointly-weak-monic fᵢ
418-
→ is-jointly-cartesian (λ ix → uᵢ ix ∘ v) (λ ix → fᵢ ix ∘' g)
419-
→ is-cartesian v g
420-
jointly-cartesian-jointly-weak-monic-cancell
421-
{uᵢ = uᵢ} {fᵢ = fᵢ} {v = v} {g = g} fᵢ-weak-monic fᵢ∘g-cart = g-cart
580+
{uᵢ = uᵢ} {fᵢ = fᵢ} {v = v} {g = g} fᵢ-weak-monic fᵢ∘g-cart
581+
= g-cart
422582
where
423583
module fᵢ∘g = is-jointly-cartesian fᵢ∘g-cart
424584
open is-cartesian
@@ -434,30 +594,19 @@ jointly-cartesian-jointly-weak-monic-cancell
434594
fᵢ ix ∘' h ∎
435595
g-cart .unique other p =
436596
fᵢ∘g.uniquep _ _ _ other (λ ix → pullr[] _ p)
437-
```
438-
439-
As corollaries, we get a pair of cancellation properties for jointly
440-
cartesian families.
441597
442-
```agda
443-
jointly-cartesian-pointwise-cartesian-cancell
444-
: (∀ ix → is-cartesian (uᵢ ix) (fᵢ ix))
445-
→ is-jointly-cartesian (λ ix → uᵢ ix ∘ vᵢ ix) (λ ix → fᵢ ix ∘' gᵢ ix)
446-
→ is-jointly-cartesian vᵢ gᵢ
447598
jointly-cartesian-pointwise-cartesian-cancell fᵢ-cart fᵢ∘gᵢ-cart =
448599
jointly-cartesian-pointwise-weak-monic-cancell
449600
(λ ix → cartesian→weak-monic (fᵢ-cart ix))
450601
fᵢ∘gᵢ-cart
451602
452-
jointly-cartesian-cartesian-cancell
453-
: is-jointly-cartesian uᵢ fᵢ
454-
→ is-jointly-cartesian (λ ix → uᵢ ix ∘ v) (λ ix → fᵢ ix ∘' g)
455-
→ is-cartesian v g
456603
jointly-cartesian-cartesian-cancell fᵢ-cart fᵢ∘g-cart =
457604
jointly-cartesian-jointly-weak-monic-cancell
458605
(jointly-cartesian→jointly-weak-monic fᵢ-cart)
459606
fᵢ∘g-cart
607+
460608
```
609+
</details>
461610

462611
## Universal properties
463612

@@ -565,7 +714,7 @@ cartesian fibrations, but is a bit verbose.
565714
where
566715
open Joint-cartesian-lift (fib Ix uᵢ yᵢ')
567716
using ()
568-
renaming (x' to *)
717+
renaming (x' to *)
569718
public
570719
571720
module _
@@ -595,7 +744,7 @@ spaces arising from lifts of empty families.
595744
```agda
596745
opaque
597746
Disc* : ∀ (x : Ob) → Ob[ x ]
598-
Disc* x = * (Lift _ ⊥) {yᵢ = λ ()} (λ ()) (λ ())
747+
Disc* x = * (Lift _ ⊥) {yᵢ = λ ()} (λ ()) (λ ())
599748
600749
disc*
601750
: ∀ {x y : Ob}

0 commit comments

Comments
 (0)