Skip to content

Commit ec9c836

Browse files
4e554c4cplt-amy
andauthored
introduce total categories (#535)
I wanted to introduce total categories (see #489) and some of their properties, in particular their adjoint functor theorem (that any cocontinuous functor from a total category has a right adjoint). This turned out to be really hard, and I didn't finish it (but I'm still working). In particular, adjoint functor theorems seem to be *all about* size conditions, and these are a bit tricky when converting from classical texts to the 1lab. Instead, I explored a lot of concepts, dualized many more, and I thought it'd be best to PR what I have before it gets any more bloated. Notable (non-dual) additions are: - ~wide pullbacks~ - free objects are colimits - diagonal adjoints are (co)limits - absolute kans are adjoints - all presheaf epis are regular --------- Co-authored-by: Amélia Liao <[email protected]>
1 parent e51776c commit ec9c836

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1659
-188
lines changed

src/Cat/Base.lagda.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,16 @@ Id .Functor.F-id = refl
401401
Id .Functor.F-∘ f g = refl
402402
```
403403

404+
<!--
405+
```agda
406+
Id^op≡Id : ∀ {o ℓ} {C : Precategory o ℓ} → Functor.op (Id {C = C}) ≡ Id
407+
Id^op≡Id i .Functor.F₀ z = z
408+
Id^op≡Id i .Functor.F₁ f = f
409+
Id^op≡Id i .Functor.F-id = refl
410+
Id^op≡Id i .Functor.F-∘ f g = refl
411+
```
412+
-->
413+
404414
# Natural transformations {defines="natural-transformation"}
405415

406416
Another common theme in category theory is that roughly _every_ concept

src/Cat/Diagram/Colimit/Base.lagda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ module _ {o₁ h₁ o₂ h₂ : _} {J : Precategory o₁ h₁} {C : Precategory
537537
Colimit-is-prop cat = Lan-is-prop cat
538538
```
539539

540-
# Cocompleteness {defines="cocomplete-category"}
540+
# Cocompleteness {defines="cocomplete cocomplete-category"}
541541

542542
A category is **cocomplete** if it admits colimits for diagrams of arbitrary shape.
543543
However, in the presence of excluded middle, if a category admits
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!--
2+
```agda
3+
open import Cat.Diagram.Limit.Initial
4+
open import Cat.Diagram.Colimit.Base
5+
open import Cat.Diagram.Limit.Base
6+
open import Cat.Diagram.Terminal
7+
open import Cat.Diagram.Duals
8+
open import Cat.Morphism
9+
open import Cat.Prelude
10+
11+
import Cat.Reasoning as Cat
12+
13+
open make-is-colimit
14+
open Terminal
15+
```
16+
-->
17+
18+
```agda
19+
module Cat.Diagram.Colimit.Terminal {o ℓ} {C : Precategory o ℓ} where
20+
```
21+
22+
# Terminal objects as colimits
23+
24+
This module provides a characterisation of [[terminal objects]] as
25+
[[*colimits*]] rather than as [[limits]]. Namely, while an terminal
26+
object is the limit of the empty diagram, it is the *co*limit of the
27+
identity functor, considered as a diagram.
28+
29+
Proving this consists of reversing the arrows in the proof that
30+
[[initial objects are limits]].
31+
32+
```agda
33+
Id-colimit→Terminal : Colimit (Id {C = C}) → Terminal C
34+
Id-colimit→Terminal L = Coinitial→terminal
35+
$ Id-limit→Initial
36+
$ natural-iso→limit (path→iso Id^op≡Id)
37+
$ Colimit→Co-limit L
38+
39+
Terminal→Id-colimit : Terminal C → Colimit (Id {C = C})
40+
Terminal→Id-colimit terminal = Co-limit→Colimit
41+
$ natural-iso→limit (path→iso (sym Id^op≡Id))
42+
$ Initial→Id-limit
43+
$ Terminal→Coinitial terminal
44+
```

src/Cat/Diagram/Coproduct/Copower.lagda.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,8 @@ uniqueness properties of colimiting maps.
9494
coprods X (λ _ → A) .match λ i → coprods Y (λ _ → B) .ι (idx i) ∘ obj
9595
Copowering .F-id {X , A} = sym $
9696
coprods X (λ _ → A) .unique _ λ i → sym id-comm
97-
Copowering .F-∘ {X , A} f g = sym $
98-
coprods X (λ _ → A) .unique _ λ i →
99-
pullr (coprods _ _ .commute) ∙ extendl (coprods _ _ .commute)
97+
Copowering .F-∘ {X , A} f g = sym $ coprods X (λ _ → A) .unique _ λ i →
98+
pullr (coprods _ _ .commute) ∙ extendl (coprods _ _ .commute)
10099
```
101100

102101
```agda

src/Cat/Diagram/Coproduct/Indexed.lagda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ there for motivation and exposition.
2424

2525
<!--
2626
```agda
27-
import Cat.Reasoning C as C
27+
open import Cat.Reasoning C as C
2828
private variable
2929
o' ℓ' : Level
3030
Idx : Type ℓ'
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<!--
2+
```agda
3+
open import Cat.Diagram.Product.Indexed
4+
open import Cat.Diagram.Product.Power
5+
open import Cat.Functor.Properties
6+
open import Cat.Functor.Hom
7+
open import Cat.Prelude
8+
9+
import Cat.Reasoning
10+
import Cat.Morphism
11+
```
12+
-->
13+
14+
```agda
15+
module Cat.Diagram.Coseparator {o ℓ} (C : Precategory o ℓ) where
16+
```
17+
18+
<!--
19+
```agda
20+
open Cat.Reasoning C
21+
open _=>_
22+
```
23+
-->
24+
# Coseparating objects {defines="coseparating-object cogenerating-object coseparator"}
25+
26+
27+
A coseparating (or cogenerating) object is formally the dual of a
28+
[[separator]].
29+
30+
31+
```agda
32+
is-coseparator : Ob → Type _
33+
is-coseparator c =
34+
∀ {x y} {f g : Hom x y}
35+
→ (∀ (m : Hom y c) → m ∘ f ≡ m ∘ g)
36+
→ f ≡ g
37+
```
38+
39+
Equivalently, an object $S$ is a coseparator if the hom functor $\cC(-,S)$
40+
is [[faithful]].
41+
42+
```agda
43+
coseparator→faithful : ∀ {s} → is-coseparator s → is-faithful (よ₀ C s)
44+
coseparator→faithful cos p = cos (happly p)
45+
46+
faithful→coseparator : ∀ {s} → is-faithful (よ₀ C s) → is-coseparator s
47+
faithful→coseparator faithful p = faithful (ext p)
48+
```
49+
50+
# Coseparating families {defines="coseparating-family"}
51+
52+
Likewise, a coseparating family is dual to a [[separating family]].
53+
54+
```agda
55+
is-coseparating-family : ∀ {ℓi} {Idx : Type ℓi} → (Idx → Ob) → Type _
56+
is-coseparating-family s =
57+
∀ {x y} {f g : Hom x y}
58+
→ (∀ {i} (mᵢ : Hom y (s i)) → mᵢ ∘ f ≡ mᵢ ∘ g )
59+
→ f ≡ g
60+
```
61+
62+
## Coseparators and powers
63+
64+
Equivalently to approximating objects with [[separators and copowers]], we
65+
may approximate them with coseparators and powers.
66+
67+
```agda
68+
module _ (powers : (I : Set ℓ) → has-products-indexed-by C ∣ I ∣) where
69+
open Powers powers
70+
71+
coseparator→mono
72+
: ∀ {s x} → is-coseparator s → is-monic (⋔!.tuple (Hom x s) s λ f → f)
73+
coseparator→mono {s} {x} cosep f g p = cosep λ m →
74+
m ∘ f ≡⟨ pushl (sym $ ⋔!.commute _ _) ⟩
75+
⋔!.π _ _ m ∘ (⋔!.tuple _ _ λ f → f) ∘ f ≡⟨ refl⟩∘⟨ p ⟩
76+
⋔!.π _ _ m ∘ (⋔!.tuple _ _ λ f → f) ∘ g ≡⟨ pulll $ ⋔!.commute _ _ ⟩
77+
m ∘ g ∎
78+
79+
mono→coseparator
80+
: ∀ {s} → (∀ {x} → is-monic (⋔!.tuple (Hom x s) s λ f → f)) → is-coseparator s
81+
mono→coseparator monic {f = f} {g = g} p = monic f g $ ⋔!.unique₂ _ _ λ m →
82+
assoc _ _ _ ∙ p _ ∙ sym (assoc _ _ _)
83+
84+
coseparating-family→mono
85+
: ∀ (Idx : Set ℓ) (sᵢ : ∣ Idx ∣ → Ob)
86+
→ is-coseparating-family sᵢ
87+
→ ∀ {x} → is-monic (∏!.tuple (Σ[ i ∈ ∣ Idx ∣ ] Hom x (sᵢ i)) (sᵢ ⊙ fst) snd )
88+
coseparating-family→mono Idx sᵢ cosep f g p = cosep λ {i} mᵢ →
89+
mᵢ ∘ f ≡⟨ pushl (sym $ ∏!.commute _ _) ⟩
90+
∏!.π _ _ (i , mᵢ) ∘ (∏!.tuple _ _ snd) ∘ f ≡⟨ refl⟩∘⟨ p ⟩
91+
∏!.π _ _ (i , mᵢ) ∘ (∏!.tuple _ _ snd) ∘ g ≡⟨ pulll $ ∏!.commute _ _ ⟩
92+
mᵢ ∘ g ∎
93+
94+
coseparating-family→make-mono
95+
: ∀ (Idx : Set ℓ) (sᵢ : ∣ Idx ∣ → Ob)
96+
→ is-coseparating-family sᵢ
97+
→ ∀ {x} → x ↪ ∏!.ΠF (Σ[ i ∈ ∣ Idx ∣ ] Hom x (sᵢ i)) (sᵢ ⊙ fst)
98+
coseparating-family→make-mono Idx sᵢ cosep = make-mono _ $
99+
coseparating-family→mono Idx sᵢ cosep
100+
101+
mono→coseparating-family
102+
: ∀ (Idx : Set ℓ)
103+
→ (sᵢ : ∣ Idx ∣ → Ob)
104+
→ (∀ {x} → is-monic (∏!.tuple (Σ[ i ∈ ∣ Idx ∣ ] Hom x (sᵢ i)) (sᵢ ⊙ fst) snd))
105+
→ is-coseparating-family sᵢ
106+
mono→coseparating-family Idx sᵢ monic {f = f} {g = g} p = monic f g $
107+
∏!.unique₂ _ _ λ (i , mᵢ) → assoc _ _ _ ∙ p _ ∙ sym (assoc _ _ _)
108+
```

src/Cat/Diagram/Duals.lagda.md

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
11
<!--
22
```agda
3+
open import Cat.Functor.Naturality.Reflection
4+
open import Cat.Diagram.Coproduct.Indexed
5+
open import Cat.Instances.Shape.Terminal
6+
open import Cat.Diagram.Product.Indexed
37
open import Cat.Diagram.Colimit.Cocone
48
open import Cat.Diagram.Colimit.Base
59
open import Cat.Diagram.Coequaliser
10+
open import Cat.Functor.Kan.Duality
611
open import Cat.Diagram.Limit.Base
712
open import Cat.Diagram.Limit.Cone
13+
open import Cat.Functor.Kan.Unique
14+
open import Cat.Functor.Naturality
815
open import Cat.Diagram.Coproduct
916
open import Cat.Diagram.Equaliser
17+
open import Cat.Functor.Coherence
1018
open import Cat.Diagram.Pullback
1119
open import Cat.Diagram.Terminal
20+
open import Cat.Functor.Constant
21+
open import Cat.Functor.Kan.Base
1222
open import Cat.Diagram.Initial
1323
open import Cat.Diagram.Product
1424
open import Cat.Diagram.Pushout
1525
open import Cat.Prelude
26+
open import Cat.Base
27+
28+
import Cat.Functor.Reasoning
29+
import Cat.Reasoning
1630
```
1731
-->
1832

@@ -22,8 +36,15 @@ module Cat.Diagram.Duals where
2236

2337
<!--
2438
```agda
39+
private
40+
variable
41+
o' ℓ' : Level
42+
Idx : Type ℓ'
2543
module _ {o ℓ} {C : Precategory o ℓ} where
26-
private module C = Precategory C
44+
private
45+
module C = Cat.Reasoning C
46+
variable
47+
S : C.Ob
2748
```
2849
-->
2950

@@ -35,7 +56,9 @@ particular, we have the following pairs of "redundant" definitions:
3556

3657
[agda-categories]: https://arxiv.org/abs/2005.07059
3758

38-
- [[Products]] and coproducts
59+
- [[Products]] and coproducts (and their [[indexed|indexed product]]
60+
versions)
61+
- [[Pullbacks]] and pushouts
3962
- [[Pullbacks]] and pushouts
4063
- [[Equalisers]] and coequalisers
4164
- [[Terminal objects]] and initial objects
@@ -71,6 +94,22 @@ $C\op$. We prove these correspondences here:
7194
where module iscop = is-coproduct iscop
7295
```
7396

97+
## Indexed Co/products
98+
99+
```agda
100+
is-indexed-co-product→is-indexed-coproduct
101+
: ∀ {F : Idx → C.Ob} {ι : ∀ i → C.Hom (F i) S} → is-indexed-product (C ^op) F ι
102+
→ is-indexed-coproduct C F ι
103+
is-indexed-co-product→is-indexed-coproduct prod =
104+
record { is-indexed-product prod renaming (tuple to match) }
105+
106+
is-indexed-coproduct→is-indexed-co-product
107+
: ∀ {F : Idx → C.Ob} {ι : ∀ i → C.Hom (F i) S} → is-indexed-coproduct C F ι
108+
→ is-indexed-product (C ^op) F ι
109+
is-indexed-coproduct→is-indexed-co-product coprod =
110+
record { is-indexed-coproduct coprod renaming (match to tuple) }
111+
```
112+
74113
## Co/equalisers
75114

76115
```agda
@@ -109,17 +148,33 @@ $C\op$. We prove these correspondences here:
109148
: ∀ {A} → is-terminal (C ^op) A → is-initial C A
110149
is-coterminal→is-initial x = x
111150
151+
is-terminal→is-coinitial
152+
: ∀ {A} → is-terminal C A → is-initial (C ^op) A
153+
is-terminal→is-coinitial x = x
154+
112155
is-initial→is-coterminal
113156
: ∀ {A} → is-initial C A → is-terminal (C ^op) A
114157
is-initial→is-coterminal x = x
115158
159+
is-coinitial→is-terminal
160+
: ∀ {A} → is-initial (C ^op) A → is-terminal C A
161+
is-coinitial→is-terminal x = x
162+
116163
Coterminal→Initial : Terminal (C ^op) → Initial C
117164
Coterminal→Initial term .bot = term .top
118165
Coterminal→Initial term .has⊥ = is-coterminal→is-initial (term .has⊤)
119166
167+
Terminal→Coinitial : Terminal C → Initial (C ^op)
168+
Terminal→Coinitial term .bot = term .top
169+
Terminal→Coinitial term .has⊥ = is-terminal→is-coinitial (term .has⊤)
170+
120171
Initial→Coterminal : Initial C → Terminal (C ^op)
121172
Initial→Coterminal init .top = init .bot
122173
Initial→Coterminal init .has⊤ = is-initial→is-coterminal (init .has⊥)
174+
175+
Coinitial→terminal : Initial (C ^op) → Terminal C
176+
Coinitial→terminal init .top = init .bot
177+
Coinitial→terminal init .has⊤ = is-coinitial→is-terminal (init .has⊥)
123178
```
124179

125180
## Pullback/pushout
@@ -157,6 +212,7 @@ $C\op$. We prove these correspondences here:
157212
```agda
158213
module _ {o ℓ} {J : Precategory o ℓ} {F : Functor J C} where
159214
open Functor F renaming (op to F^op)
215+
private module F = Cat.Functor.Reasoning F
160216
161217
open Cocone-hom
162218
open Cone-hom
@@ -233,4 +289,15 @@ We could work around this, but it's easier to just do the proofs by hand.
233289
mc .universal eta p = lim.universal eta p
234290
mc .factors eta p = lim.factors eta p
235291
mc .unique eta p other q = lim.unique eta p other q
292+
293+
module _ {o ℓ} {C : Precategory o ℓ} where
294+
co-is-complete→is-cocomplete : is-complete o' ℓ' (C ^op) → is-cocomplete o' ℓ' C
295+
co-is-complete→is-cocomplete co-complete F = Co-limit→Colimit $
296+
co-complete $ Functor.op F
297+
298+
is-cocomplete→co-is-complete : is-cocomplete o' ℓ' (C ^op) → is-complete o' ℓ' C
299+
is-cocomplete→co-is-complete cocomplete F = to-limit (to-is-limit ml) where
300+
dual = Colimit→Co-limit $ cocomplete $ Functor.op F
301+
ml : make-is-limit F $ Limit.apex dual
302+
ml = record { Limit dual }
236303
```

src/Cat/Diagram/Limit/Initial.lagda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ open Initial
1515
module Cat.Diagram.Limit.Initial where
1616
```
1717

18-
# Initial objects as limits
18+
# Initial objects as limits {defines="initial-objects-are-limits"}
1919

2020
This module provides a characterisation of [[initial objects]] as
2121
[[*limits*]], rather than as [[colimits]]. Namely, while an initial

0 commit comments

Comments
 (0)