/
pregroupoids.lagda.md
144 lines (108 loc) · 4.4 KB
/
pregroupoids.lagda.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Pregroupoids
```agda
module category-theory.pregroupoids where
```
<details><summary>Imports</summary>
```agda
open import category-theory.isomorphisms-in-precategories
open import category-theory.precategories
open import foundation.dependent-pair-types
open import foundation.equivalences
open import foundation.identity-types
open import foundation.iterated-dependent-product-types
open import foundation.propositions
open import foundation.sets
open import foundation.type-arithmetic-dependent-pair-types
open import foundation.universe-levels
```
</details>
## Idea
A **pregroupoid** is a [precategory](category-theory.precategories.md) in which
every morphism is an
[isomorphism](category-theory.isomorphisms-in-precategories.md).
## Definitions
### The predicate on precategories of being pregroupoids
```agda
module _
{l1 l2 : Level} (C : Precategory l1 l2)
where
is-pregroupoid-Precategory : UU (l1 ⊔ l2)
is-pregroupoid-Precategory =
(x y : obj-Precategory C) (f : hom-Precategory C x y) →
is-iso-Precategory C f
is-prop-is-pregroupoid-Precategory : is-prop is-pregroupoid-Precategory
is-prop-is-pregroupoid-Precategory =
is-prop-iterated-Π 3 (λ x y → is-prop-is-iso-Precategory C)
is-pregroupoid-prop-Precategory : Prop (l1 ⊔ l2)
pr1 is-pregroupoid-prop-Precategory = is-pregroupoid-Precategory
pr2 is-pregroupoid-prop-Precategory = is-prop-is-pregroupoid-Precategory
```
### The type of pregroupoids
```agda
Pregroupoid :
(l1 l2 : Level) → UU (lsuc l1 ⊔ lsuc l2)
Pregroupoid l1 l2 = Σ (Precategory l1 l2) (is-pregroupoid-Precategory)
module _
{l1 l2 : Level} (G : Pregroupoid l1 l2)
where
precategory-Pregroupoid : Precategory l1 l2
precategory-Pregroupoid = pr1 G
is-pregroupoid-Pregroupoid :
is-pregroupoid-Precategory precategory-Pregroupoid
is-pregroupoid-Pregroupoid = pr2 G
obj-Pregroupoid : UU l1
obj-Pregroupoid = obj-Precategory precategory-Pregroupoid
hom-set-Pregroupoid : obj-Pregroupoid → obj-Pregroupoid → Set l2
hom-set-Pregroupoid = hom-set-Precategory precategory-Pregroupoid
hom-Pregroupoid : obj-Pregroupoid → obj-Pregroupoid → UU l2
hom-Pregroupoid = hom-Precategory precategory-Pregroupoid
id-hom-Pregroupoid :
{x : obj-Pregroupoid} → hom-Pregroupoid x x
id-hom-Pregroupoid = id-hom-Precategory precategory-Pregroupoid
comp-hom-Pregroupoid :
{x y z : obj-Pregroupoid} → hom-Pregroupoid y z →
hom-Pregroupoid x y → hom-Pregroupoid x z
comp-hom-Pregroupoid = comp-hom-Precategory precategory-Pregroupoid
associative-comp-hom-Pregroupoid :
{x y z w : obj-Pregroupoid} (h : hom-Pregroupoid z w)
(g : hom-Pregroupoid y z) (f : hom-Pregroupoid x y) →
( comp-hom-Pregroupoid (comp-hom-Pregroupoid h g) f) =
( comp-hom-Pregroupoid h (comp-hom-Pregroupoid g f))
associative-comp-hom-Pregroupoid =
associative-comp-hom-Precategory precategory-Pregroupoid
left-unit-law-comp-hom-Pregroupoid :
{x y : obj-Pregroupoid} (f : hom-Pregroupoid x y) →
( comp-hom-Pregroupoid id-hom-Pregroupoid f) = f
left-unit-law-comp-hom-Pregroupoid =
left-unit-law-comp-hom-Precategory precategory-Pregroupoid
right-unit-law-comp-hom-Pregroupoid :
{x y : obj-Pregroupoid} (f : hom-Pregroupoid x y) →
( comp-hom-Pregroupoid f id-hom-Pregroupoid) = f
right-unit-law-comp-hom-Pregroupoid =
right-unit-law-comp-hom-Precategory precategory-Pregroupoid
iso-Pregroupoid : (x y : obj-Pregroupoid) → UU l2
iso-Pregroupoid = iso-Precategory precategory-Pregroupoid
```
## Properties
### The type of isomorphisms in a pregroupoid is equivalent to the type of morphisms
```agda
module _
{l1 l2 : Level} (G : Pregroupoid l1 l2)
where
inv-compute-iso-Pregroupoid :
{x y : obj-Pregroupoid G} → iso-Pregroupoid G x y ≃ hom-Pregroupoid G x y
inv-compute-iso-Pregroupoid {x} {y} =
right-unit-law-Σ-is-contr
( λ f →
is-proof-irrelevant-is-prop
( is-prop-is-iso-Precategory (precategory-Pregroupoid G) f)
( is-pregroupoid-Pregroupoid G x y f))
compute-iso-Pregroupoid :
{x y : obj-Pregroupoid G} → hom-Pregroupoid G x y ≃ iso-Pregroupoid G x y
compute-iso-Pregroupoid = inv-equiv inv-compute-iso-Pregroupoid
```
## See also
- [Cores of precategories](category-theory.cores-precategories.md)
## External links
- [Groupoids](https://1lab.dev/Cat.Groupoid.html) at 1lab
- [pregroupoid](https://ncatlab.org/nlab/show/pregroupoid) at $n$Lab