-
Notifications
You must be signed in to change notification settings - Fork 23
/
group.tex
1888 lines (1733 loc) · 86.3 KB
/
group.tex
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\chapter{Groups, concretely}
\label{ch:groups}
An identity type is not just any type: in the previous sections we have seen that the identity type $a\eqto_Aa$ reflects the ``symmetries'' of an element $a$ in a type $A$.\footnote{%
Since the symmetries $p : a\eqto_A a$ are paths that start and end
at the point $a:A$, we also call them \emph{loops} at $a$,
or \emph{automorphisms} of $a$.\par
\begin{tikzpicture}
\draw plot [smooth cycle] coordinates {(0,0) (2.3,0) (2,1.9) (0,2.1)};
\node[dot,label=left:$a$] (a) at (0.5,0.3) {};
\node (A) at (2.5,2.1) {$A$};
\draw[->] (a) .. controls ++(-10:3) and ++(100:2.5) .. node[auto,swap] {$p$} (a);
\end{tikzpicture}}
Symmetries have special properties. For instance, you can rotate a square by $90\mathdegree$, and you can reverse that motion by rotating it by $-90\mathdegree$.
Symmetries can also be composed, and this composition respects certain rules that hold in all examples. One way to study the concept of ``symmetries'' would be to isolate the common rules for all our examples, and to show, conversely, that anything satisfying these rules actually \emph{is} an example.
With inspiration of geometric and algebraic origins, it became clear to mathematicians at the end of the 19\textsuperscript{th} century that the properties of such symmetries could be codified by saying that they form an abstract \emph{group}.
In \cref{sec:identity-types} we saw that equality is ``reflexive, symmetric
and transitive'' -- implemented by operations $\refl{a}$, $\symm_{a,b}$
and $\trans_{a,b,c}$, and an abstract group is just a set with such
operations satisfying appropriate rules.
We attack the issue more concretely:
instead of focusing on the abstract properties,
we bring the type exhibiting the symmetries to the fore.
This type is called the \emph{classifying type} of the group.
The axioms for an abstract group follow from the rules for identity types,
without us needing to impose them.
We will show in~\cref{ch:absgroup} that the two approaches give the same end result.
In this chapter we lay the foundations and provide some basic examples of groups.
\section{Brief overview of the chapter}
In \cref{sec:typegroup} we give the formal definition of a group
along with some basic examples.
In \cref{sec:identity-type-as-abstract} we expand on the properties of a group
and compare these with those of an abstract group.
In \cref{sec:homomorphisms} we explain how groups map to each other through
``homomorphisms'' (which to us are simply given by pointed maps),
and what this entails for the identity types:
the preservation of the abstract group properties.
As an important example, we study the sign homomorphism
in~\cref{sec:sign-homomorphism}, which also provides us with the
alternating groups.
In most of our exposition we make the blanket assumption that the identity type in question is a set, but in~\cref{sec:inftygps} we briefly discuss $\infty$-groups, where this assumption is dropped.
%With all this in place, the structure of the type of groups is in many aspects similar to the universe, in the sense that many of the constructions on the universe that we're accustomed to have analogues for groups, namely:
%functions are replaced by homomorphisms;
%products stay ``the same,'' as we will see in \cref{ex:productofgroups}
%(and more generally, product types over sets ``stay the same'');
%and the sum of two groups has a simple implementation as the sum of the underlying types with the base points identified, as defined more precisely in \cref{def:wedge}.
%In the usual treatment this is a somewhat more difficult subject involving ``words'' taken from the two groups.
%This reappears in our setting when we show that homomorphisms
%from a sum to another group
%correspond to pairs of homomorphisms
%(just as for sums of types and functions between types).
%
%A deeper study of subgroups is postponed to \cref{ch:subgroups},
%where they take center stage.
\section{The type of groups}
\label{sec:typegroup}
In order to motivate the formal definition of a group we
revisit some types that we have seen in earlier chapters,
paying special attention to the symmetries in these types.
\begin{example}\label{ex:base=base}
We defined the circle $\Sc$ in \cref{def:circle} by declaring
that it has a point $\base$ and an identification (``symmetry'')
$\Sloop:\base\eqto\base$.
In \cref{cor:S1groupoid} we proved that $\base\eqto\base$ is equivalent
to the set $\zet$ (of integers),
where $n\in\zet$ corresponds to the $n$-fold composition of $\Sloop$ with itself
(which works for both positive and negative $n$).
We can think of this as describing the symmetries of $\base$ as follows.
We have one ``generating symmetry'' $\Sloop$,
and this symmetry can be composed with itself any number of times,
giving a symmetry for each integer.
Composition of symmetries here corresponds to addition of integers.
The circle is an efficient packaging of the ``{group}'' of integers,
for the declaration of $\base$ and $\Sloop$ not only gives the \emph{set}
$\zet$ of integers, but also the addition operation.
\end{example}
\begin{example}
Recall the finite set $\bn{2}:\FinSet_2$ from \cref{def:finiteset},
containing two elements.
According to \cref{xca:C2}, the identity type $\bn{2} \eqto \bn{2}$
has exactly two distinct elements, $\refl{\bn{2}}$ and $\twist$,
and doing $\twist$ twice yields $\refl{\bn{2}}$.
We see that these are all the symmetries
of a two point set you'd expect to have:
you can let everything stay in place ($\refl{\bn{2}}$);
or you can swap the two elements ($\twist$).
If you swap twice, the result leaves everything in place.
The pointed type $\FinSet_2$ (of ``finite sets with two elements''),
with $\bn{2}$ as the base point, is our embodiment of these symmetries,
\ie they are the elements of $\bn{2} \eqto \bn{2}$.
Observe that, by the induction principle of $\Sc$,
there is an interesting function $\Sc\to\FinSet_2$,
sending $\base:\Sc$ to $\bn{2} :\FinSet_2$ and $\Sloop$ to $\twist$.
We saw this already in~\cref{fig:covering}.
\end{example}
Note that the types $\Sc$ and $\FinSet_2$ in the examples above are groupoids.
For an arbitrary type $A$ and an element $a:A$,
the symmetries of $a$ in $A$ form an \inftygp, cf.~\cref{sec:inftygps} below.
However, in elementary texts it is customary to restrict the notion
of a group to the case when $a\eqto_A a$ is a \emph{set},
as we will do, starting in \cref{sec:identity-type-as-abstract}.
This makes things considerably easier: if are we given two elements
$g,h:a\eqto_A a$, then the identity type $g\eqto h$ is a proposition
(and we can simply write $g = h$). That is, $g$ can be equal to $h$ in
at most one way, and questions relating to uniqueness of
identification will never present a problem.
The examples of groups that Klein and Lie were interested in
often had more structure on the set $a\eqto_A a$,
for instance a topology or a smooth structure.
For such a group it makes sense to look at smooth maps from the real numbers
to $a\eqto_A a$, or to talk about a convergent sequence of symmetries of $a$.
\footnote{%
Such groups give rise to \inftygps by converting
continuous (or smooth) symmetries of $a$ in $A$
parametrized by the continuous (or smooth) real interval,
into identifications,
as described already in \cref{ft:cohesive}
in \cref{ch:univalent-mathematics}.
Then also smooth or continuous paths in $a\eqto_A a$
turn into identifications of symmetries.
See also~\cref{sec:topology}.}
See \cref{ch:grouphistory} for a brief summary of the history of groups.
\begin{remark}\label{rem:heap-preview}
The reader may wonder about the status of the identity type
$a\eqto_A a'$ where $a,a':A$ are different elements.
One problem is of course that if $p,q:a\eqto_A a'$,
there is no obvious way of composing $p$ and $q$
to get another element in $a\eqto_A a'$.
Another problem is that $a\eqto_A a'$ does not have a distinguished element,
such as $\refl{a}:a\eqto_A a$.\footnote{%
The type $a\eqto_A a'$ does have an interesting \emph{ternary}
composition, mapping $p,q,r$ to $p\inv{q}r$.
A set with this kind of operation is called a \emph{heap},
and we'll explore heaps further in \cref{sec:heaps}.}
Given an $f:a\eqto_A a'$ we can use transport along $f$ to compare
$a\eqto_A a'$ with $a\eqto_A a$ (much as affine planes can be compared
with the standard plane or a finite dimensional real vector space is
isomorphic to some Euclidean space), but absent the existence and choice
of such an $f$ the identity types $a\eqto_Aa'$ and $a\eqto_Aa$ are
different animals.
We will return to this example in \cref{sec:heaps}.
\end{remark}
\begin{remark}
\label{rem:whypointedconngpoid}
As a consequence of \cref{lem:subtype-eq-=},\marginnote{%
\begin{tikzpicture}
\draw plot [smooth cycle] coordinates {(0,0) (2.8,0) (2.5,1.9) (0,2.1)};
\draw[dashed] plot [smooth cycle] coordinates
{(.1,.1) (1.2,.1) (1,1.5) (.1,1.7)};
\node[dot,label=left:$a$] (a) at (0.5,.3) {};
\node[dot,label=right:$b$] (b) at (1.8,.3) {};
\node (cdots) at (1.8,1.4) {$\cdots$};
\node (A) at (2.6,2.1) {$A$};
\node (Aa) at (.7,1.9) {$A_{(a)}$};
\draw[->] (a) .. controls ++(-10:1) and ++(110:1.6) .. node[auto,swap]
{$p$} (a);
\draw[dashed] plot [smooth cycle] coordinates
{(1.5,.1) (2.5,.2) (2.6,.8) (1.5,.9)};
\draw[dashed] plot [smooth cycle] coordinates
{(1.5,1.1) (2.5,1.2) (2.4,1.8) (1.2,2)};
\end{tikzpicture}}
the inclusion of the component $\conncomp A a \defequi \sum_{x:A}
\Trunc{a\eqto x}$ into $A$ (\ie the first projection)
induces an equivalence of identity types
from $(a,!)\eqto_{A_{(a)}}(a,!)$ to $a\eqto_A a$.
This means that, when considering the loop type $a\eqto_A a$,
``only the elements $x:A$ with $x$ merely equal to $a$ are relevant''.
To avoid irrelevant extra components,
we should consider only \emph{connected} types $A$ (\cf \cref{def:connected}).
Also, our preference for $a\eqto_A a$ to be a \emph{set}
indicates that we should consider only the connected types $A$
that are \emph{groupoids}.
\end{remark}
\begin{definition}\label{def:pt-conn-groupoid}
The type of \emph{pointed, connected groupoids} is the type\marginnote{%
The meaning of the superscript ``${=1}$'' can be explained as follows:
We also define
\begin{align*}
\UU^{\le1}&\defeq\Groupoid\\
&\defeq
\sum_{A:\UU} \isgrpd(A)
\end{align*}
to emphasize that groupoids are $1$-types;
the type of connected types is defined as follows.
\[
\UU^{>0} \defeq \sum_{A:\UU} \isconn(A)
\]
Similar notations with a subscript ``$*$'' indicate pointed types.}%
\glossary(UU1){$\protect\UUscone$}{pointed, connected groupoids, \cref{def:pt-conn-groupoid}}
\[
\UUscone \defeq \sum_{A:\UU} ( A \times \isconn(A) \times \isgrpd(A) ).\qedhere
\]
\end{definition}
\begin{xca}\label{xca:defgroup}
Given a type $A$ and an element $a:A$,
show that $A$ is connected if and only if the proposition
$\prod_{x:A}\Trunc{a \eqto_A x}$ holds.
Show furthermore that $A$ is a groupoid if and only if the
type $a\eqto_A a$ is a set.
Conclude by showing that the type $\UUscone$ is equivalent to the type
\[
\sum_{A:\UU} \sum_{a:A} \biggl( \Bigl( \prod_{x:A}\Trunc{a \eqto_A x} \Bigr)
\times \isset( a\eqto_A a ) \biggr).\qedhere
\]
\end{xca}
\begin{remark}
We shall refer to a pointed connected groupoid $(A,a,p,q)$ simply
by the pointed type $X \defeq (A,a)$.
There is no essential ambiguity in this, for
the types $\isconn(A)$ and $\isgrpd(A)$ are propositions
(\cref{lem:prop-utils} and \cref{lem:isX-is-prop}),
and so the witnesses $p$ and $q$ are unique.
\end{remark}
We are now ready to define the type of groups.
\begin{definition}\label{def:typegroup}
The \emph{type of groups} is a wrapped copy (see \cref{sec:unary-sum-types})
of the type of pointed connected groupoids $\UUscone$,
\[
\typegroup \defequi \Copy_{\mkgroup}(\UUscone),
\]
with constructor $\mkgroup : \UUscone \to \Group$.%
\glossary(924Omega_){$\protect\mkgroup$}{group constructor,
\cref{def:typegroup}}\index{group}%
\footnote{%
The reader may ask why we use $\mkgroup$, which only makes a wrapped
copy of each $(A,s,p,q): \UUscone$. The answer is that flatly defining
groups as their classifying types would be confusing.
Using $\mkgroup$ we avoid awkward terminology such as `
`the group of the integers is the circle''.
The symbol $\mkgroup$ is inspired by $\loops$
in \cref{def:looptype}, which in \cref{sec:identity-type-as-abstract}
will be used to recover the traditional concept of a group.
Recall also the example of the negated natural numbers $\NNN$
from \cref{sec:unary-sum-types}:
Its elements are $-n$ for $n:\NN$ to remind us how to think about them.
And the same applies to $\Group$:
Its elements are $\mkgroup X$ for $X : \UUscone$
to remind us how to think about them.
}
A \emph{group} is an element of $\typegroup$.
\end{definition}
\begin{definition}\label{def:classifying-type}
We write $\B : \typegroup \to \UUscone$ for the
destructor associated with $\Copy_{\mkgroup}(\UUscone)$.
For $G : \typegroup$,
we call $\BG$ the \emph{classifying type}\index{classifying type}
of $G$.\footnote{%
As a notational convention we always write the ``$\B$''
so that it sits next to and matches the shape
of its operand.
You see immediately the typographical reason behind this convention:
The italic letters $B$, $G$ get along nicely,
while the roman $\B$ would clash with its italic friend $G$
if we wrote $\B G$ instead.}
Moreover, the elements of $\BG$ will be referred to as the \emph{shapes of $G$},
and we define the \emph{designated shape of $G$}\index{designated shape}\index{shape}
by setting
$\shape_G\defequi \pt_{\BG}$,
\ie the designated shape of $G$ is the base point of its
classifying type, see \cref{def:pointedtypes}.
\end{definition}
\begin{definition}\label{def:looptype}
Given a pointed type $X\jdeq(A,a)$, we define
$\loops X \defeq (a \eqto_A a)$, \ie the type of the symmetries
of $a:A$. %also called the \emph{symmetries in} $X$ / $G$ below?
The type $\loops X$ is pointed at $\refl{a}$.%
\index{loop type constructor}\index{symmetry type constructor}
\glossary(924Omega){$\protect\loops X$}%
{type of symmetries (loops) in pointed type, \cref{def:looptype}}
\end{definition}
\begin{definition}\label{def:group-symmetries}
Let $G$ be a group.
We regard every group as a group of symmetries,
and thus we refer to the elements of $\loops \BG$ as the
\emph{symmetries in $G$};\index{symmetries in a group $G$}
they are the symmetries of the designated shape $\shape_G$ of $G$.
We adopt the notation
\[
\USymG \defeq \loops \BG
\]
for the type of symmetries in $G$; it is a set.\footnote{%
Taking the symmetries in a group
thus defines a map
$\USym : \Group \to \Set$,
with $\mkgroup X \mapsto \loops X$.
Just as with ``$\B$'', we write the ``$\USym$'' so that it matches
the shape of its operand.}
(Notice the careful distinction above between the phrases
``\emph{symmetries in}'' and ``\emph{symmetries of}''.)
\end{definition}
\begin{remark}\label{rem:aut}
As noted in \cref{sec:unary-sum-types},
the constructor and destructor pair forms an equivalence $\Group \weq \UUscone$.
The type $\UUscone$ is a subtype of $\UUp$, so
once you know that a pointed type $X$ is a connected groupoid,
you also know that $X$ is the classifying type of a group,
namely $G\defeq\mkgroup X$.
Note that the equivalence also entails that identifications (of groups) of type $G \eqto H$ are equivalent to identifications (of pointed
types) of type $\BG \eqto \BH$.
\end{remark}
\begin{remark}\label{rem:BG-convention}
Defining a function $f : \prod_{G:\Group}T(G)$,
where $T(G)$ is a type parametrized by $G:\Group$,
amounts to defining $f(G)$ for $G\jdeq\mkgroup X$,
where $X$ is a pointed connected groupoid,
namely the classifying type $\BG$.\footnote{%
If you are bothered by the convention
to write the classifying type of $G$ in \emph{italic} like a variable,
you can either think of $\BG$ as a locally defined
variable denoting the classifying type that is
defined whenever a variable $G$ of type $\Group$ is introduced,
or you can imagine that whenever such a $G$ is introduced
(with the goal of making a construction or proving a proposition),
we silently apply the induction principle to
reveal a wrapped variable $\BG:\UUscone$.}
\end{remark}
Frequently we want to consider the symmetries $\loops(A,a)$ of some element $a$ in some groupoid $A$, so we introduce the following definition.
\begin{definition}\label{def:automorphism-group}
For a groupoid $A$ with a specified point $a$,
we define the \emph{automorphism group} of $a:A$ by%
\glossary(Aut){$\protect\Aut_A(a)$}{automorphism group of the element $a$
in the type $A$, \cref{def:automorphism-group}}\index{automorphism group}%
\index{group!of automorphisms}
\[
\Aut_A(a) \defeq \mkgroup (A_{(a)},(a,!)),
\]
\ie $\Aut_A(a)$ is the group with classifying type
$\BAut_A(a) \jdeq (A_{(a)},(a,!))$,
the connected component of $A$ containing $a$, pointed at $a$.
\end{definition}
\begin{remark}
\label{rem:symmetriesofnonconnectedgroupoids}
If $A$ is connected, then $\fst: A_{(a)} \to A$ is an equivalence
between the pointed types $(A_{(a)},(a,!))$ and $(A,a)$, pointed by $\refl{a}$.
Consequently, for any $G \jdeq \mkgroup(A,a) : \Group$,
we have an identification of type $G \eqto \Aut_A(a)$.
In other words, for any $G \jdeq \mkgroup\BG$, we have
an identification $G \eqto \Aut_{\BG}(\shape_G)$, of $G$ with the automorphism
group of the designated shape $\shape_G : \BG$.
\end{remark}
\subsection{First examples}
\label{sec:firstgroupexamples}
\begin{example}\label{ex:circlegroup}
The circle $\Sc$, which we defined in \cref{def:circle},
is a connected groupoid (\cref{lem:circleisconnected}, \cref{cor:S1groupoid})
and is pointed at $\base$.
The identity type $\base\eqto_\Sc\base$ is equivalent to
the set of integers $\zet$ and composition corresponds to addition.
This justifies our definition of the \emph{group of integers} as%
\glossary(ZZ){$\protect\ZZ$}{group of integers,
\cref{ex:circlegroup}}\index{group!of integers}
\[
\ZZ \defeq \mkgroup(\Sc,\base).
\]
In other words, the classifying type of $\ZZ$ is $\B\ZZ \defeq \Sc$,
pointed at $\base$.
Recall from~\cref{rem:symmetriesofnonconnectedgroupoids} that there is
then a canonical identification of type $\ZZ \eqto \Aut_\Sc(\base)$.
It is noteworthy that along the way we gave several
versions of the circle, each of which has its own merits.
For example, the type of infinite cycles in \cref{def:S1toC}
and \cref{thm:S1bysymmetries},
\[
\InfCyc\jdeq %\conncomp{\biggl(\sum_{X:\UU}(X\to X)\biggr)}{\zet,\zs}
\sum_{X:\UU} \sum_{t:X\to X} \Trunc{(\zet,\zs)\eqto(X,t)}.\qedhere
\]
\end{example}
\begin{xca}\label{xca:groups}
Use various results from \cref{cha:circle} to construct two different
identifications of type $\ZZ \eqto \Aut_\Cyc(\zet,\zs)$.
\end{xca}
\begin{example}\label{ex:groups}
Apart from the circle, there are some important groups that come
almost for free: namely the automorphisms of specific elements
in the groupoid $\Set$, and even one in the groupoid $\Prop$.
\begin{enumerate}
\item\label{ex:trivgroup}
Recall that $\true$, and hence $\true \eqto \true$, is contractible.
Hence $\Aut_\Prop(\true)$ is a group called the
\emph{trivial group}. \index{trivial group}
In fact, for any proposition $P$ we can also identify the trivial group
with $\Aut_\Prop(P)$, see \cref{xca:group-example-details}.
Unlike $\Prop$, the type $\true$ is connected,
so we can also identify the trivial group with
$\mkgroup (\true,\triv)$, or with $\mkgroup (C,c)$ for
any contractible type $C$ and element $c:C$, or
with $\Aut_{S}(x)$ for any set $S$ and element $x:S$.\footnote{%
This note is for those who worry about size issues -- a
theme we usually ignore in our exposition.
Recall from \cref{sec:universes} the chain of
universes $\UU_0 : \UU_1 : \UU_2 : \dots$ such that for each $i$
all types in $\UU_i$ are also in $\UU_j$ for all $j>i$.
Let $\Prop_0 \defeq \sum_{P:\UU_0}\isprop(P)$ be the type of
propositions in $\UU_0$. Then $\true:\Prop_0$
and $\Prop_0 : \UU_1$ (because the sum is taken over $\UU_0$).
In order to accommodate the trivial group $\Aut_{\Prop_0}(\true)$,
the universe ``$\UU$'' appearing as a subscript of the first
$\Sigma$-type in \cref{def:pt-conn-groupoid}, reappearing later in
\cref{def:typegroup} of the type of groups,
needs to be at least as big as $\UU_1$.
If $\UU$ is taken to be $\UU_1$, then the type $\typegroup$ of groups
will not be in $\UU_1$, but in the bigger universe $\UU_2$.
\Cref{xca:typegroupisgroupoid} below asks you to verify that $\Group$
is a (large) groupoid. If we then choose some group $G:\typegroup$
and look at its group of automorphisms, $\Aut_\Group(G)$,
this will be an element of $\typegroup$ only if the universe $\UU$ in the
definition of $\typegroup$ is at least as big as $\UU_2$. Clearly,
this doesn't stop and so we also need an ascending chain of types of groups:
\[
\typegroup_i \defequi \Copy_{\mkgroup}\bigl( (\UU_i)_*^{=1} \bigr) : \UU_{i+1}.
\]
Any group we encounter will be an element of $\typegroup_i$ for $i$
large enough. As a matter of fact, the trivial group $\Aut_{\true}(\triv)$
is an element of $\typegroup_0$. The Replacement~\cref{pri:replacement}
often allows us to conclude that a group $G$ belongs to $\typegroup_0$.
This is the case for $\SG_S$, for $S:\Set_0$, and for $\Aut_\Group(G)$,
for $G:\Group_0$, as we invite the reader to check.
(Hint: use \cref{xca:comp-loc-small-ess-small}.)
However, even with this principle there are groups that only belong
to $\typegroup_i$ for $i>0$ large enough.
Issues concerning universes are nontrivial and important,
but in this text we have chosen to focus on other matters.
}
\item\label{ex:permgroup}
If $n:\NN$, then the \emph{permutation group of $n$ letters}
(also known as the \emph{symmetric group of degree $n$}) is%
\glossary(918Sigma2){$\protect\SG_n$}{symmetric group of degree $n$,
\cref{ex:groups}\ref{ex:permgroup}}\index{symmetric group}%
\index{group!symmetric group}
\[
\SG_n\defequi \Aut_{\Set}(\bn n). %\mkgroup(\FinSet_n,\bn{n}),
\]
The classifying type is thus $\BSG_n\jdeq (\FinSet_n,\bn{n})$,
where $\FinSet_n \jdeq \Set_{(\bn{n})}$ is the groupoid of
sets of cardinality $n$ (\cf \ref{def:groupoidFin}).
Again, we can also identify the group $\SG_n$ with
$\Aut_\FinSet(\bn{n})$ (by \cref{xca:group-example-details}), with
$\Aut_{\FinSet_n}(\bn n)$ (by \cref{rem:symmetriesofnonconnectedgroupoids}),
or even with $\Aut_{\UU}(\bn n)$ (by stretching the definition of $\Aut$,
using that $\UU_{(\bn n)}$ is a connected groupoid, see~\cref{rem:autinfgp}).
\item\label{ex:genpermgroup}
More generally, if $S$ is a set, is there a pointed connected groupoid $(A,a)$ so that $a\eqto_Aa$ models all the ``permutations'' $S\eqto_{\Set}S$ of $S$?
Again, the only thing wrong with the groupoid $\Set$ of sets
is that $\Set$ is not connected.
%}!\footnote{it's so simple -- so very simple -- that only a child can do it!} %
The \emph{group of permutations of $S$} is defined to be%
\glossary(918Sigma3){$\protect\SG_S$}{permutation group on a set $S$,
\cref{ex:groups}\ref{ex:genpermgroup}}\index{permutation group}%
\index{group!permutation group}
\[
\SG_S\defequi \Aut_{\Set}(S),
\]
with classifying type $\BSG_S\jdeq(\conncomp \Set S,S)$.\qedhere
\end{enumerate}
\end{example}
\begin{xca}
\label{xca:group-example-details}
Show that $\Aut_\Prop(P)$ is a trivial group for any proposition $P$.
Verify that $\SG_0$, $\SG_1$, and $\SG_\false$ are all trivial groups.
Using~\cref{def:finiteset}, give identifications of type
$\Aut_\FinSet(\bn{n})\eqto\Sigma_{\bn{n}}$ for $n:\NN$.
Also, give an identification of type $\Aut_\Set(\NN)\eqto\Aut_\Set(\zet)$.
\end{xca}
\begin{example}\label{ex:cyclicgroups}
In \cref{cor:id-m-cycle} we studied the symmetries of the
standard $m$-cycle $(\bn m,\zs)$ for $m$ a positive integer,
and showed that there were $m$ different such symmetries.
Moreover, we showed that these symmetries can be identified with the elements
$0,1,\dots,m-1$ of $\bn m$ (according to the image of $0$),
and under this correspondence composition of symmetries correspond to
addition modulo $m$, with $0$ the identity.
Note that all of these can be obtained from $1$ under addition.
With $\Cyc,\,\Cyc_m$ from \cref{def:Cyc}, \ref{def:Cyc-components},
the \emph{cyclic group of order $m$} is thus defined to be
\[
\CG_m \defeq \Aut_\Cyc(\bn m,\zs),
\]
with classifying type $\BCG_m \jdeq (\Cyc_m, (\bn m,\zs))$.\footnote{%
Note that the cyclic group of order $1$ is the trivial group,
the cyclic group of order $2$ is equivalent to the symmetric group $\SG_2$:
there is exactly one nontrivial symmetry $f$ and $f^2$ is the identity.
When $m>2$ the cyclic group of order $m$ is a group that does not appear
elsewhere in our current list.
In particular, the cyclic group of order $m$ has only $m$ different
symmetries, whereas we will see that the group of
permutations $\SG_m$ has $m!=1\cdot 2\cdot\dots\cdot m$ symmetries.}
By using univalence on the equivalences of~\cref{thm:coveringsofS1perms}, we get a chain of identifications
\[
\begin{tikzcd}
\CG_m \rar[eqtol] & \Aut_{\sum_{X:\Set}(X\to X)}(\bn m,\zs) \dar[eqtol] &
\\
& \Aut_{\SetBundle(\Sc)}(\Sc,\dg{m}) \rar[eqtol] & \Aut_{\Sc\to\Set}(R_m),
\end{tikzcd}
\]
where $\dg{m} : \Sc \to \Sc$ is the degree $m$ map,
and $R_m : \Sc \to \Set$ is the $m$\th power bundle from~\cref{def:RmtoS1}.
For reasons that will become clear later (\cref{def:normalquotient}),
we introduce another name for the cyclic group of order $m$, corresponding
to the last step above, namely,
\[
\ZZ/m\ZZ \defeq \Aut_{\Sc\to\Set}(R_m).\qedhere
\]
\end{example}
\begin{example}
\label{ex:Cm}
There are other (beside the symmetries of the $m$-cycle and of the $m$-fold \covering) ways of obtaining the cyclic group of order $m$, which occasionally are more convenient.
The prime other interpretation comes from thinking about the symmetries of the $m$-cycle in a slightly different way.
We can picture the $m$-cycle as consisting of $m$ points on a circle,
\eg as the set of $m$\th roots of unity in the complex plane, as shown in~\cref{fig:m-cycle-roots}.
\begin{marginfigure}
\begin{tikzpicture}
\foreach \n/\deg in {0/0, 1/35, 2/70, m-1/325} {
\node[dot] (x\n) at (\deg:1) {};
\node (l\n) [at=(x\n.\deg), anchor=\deg+180, shift=(\deg:1pt)] {$\xi^{\n}$};
\draw[->,shorten <=1pt,shorten >=1pt] (x\n) arc (\deg:\deg+35:1);
}
\foreach \deg in {110, 115, 120, 275, 280, 285} {
\node[cntdot] at (\deg:1) {};
}
\draw[shorten <=1pt,shorten >=1pt] (125:1) arc (125:270:1);
\draw[->,shorten <=1pt,shorten >=1pt] (290:1) arc (290:325:1);
\draw (180:1.2) -- (360:1.2);
\draw[->] (1.6,0) -- (1.9,0);
\node at (2.1,0) {$x$};
\node at (0,1.7) {$y$};
\draw[->] (270:1.2) -- (90:1.5);
\end{tikzpicture}
\caption{The $m$-cycle as the $m$\th roots of unity.
(Here $\xi=\ee^{2\pi\ii/m}$ is a primitive $m$\th root.)}
\label{fig:m-cycle-roots}
\end{marginfigure}
Any cyclic permutation is in particular a permutation
of the $m$-element set underlying the cycle.
This manifests itself as the projection map
$\prj : \Cyc_m \to \FinSet_m : ((X,t),!) \mapsto (X,!)$,\footnote{%
In the terminology of \cref{sec:stuff-struct-prop},
this map forgets the cycle structure on the underlying set.}
equivalently, using the notation introduced above, $\prj : \BCG_m \to \BSG_m$,
where the group $\SG_m\jdeq\Aut_\Set(\bn m)$ is that of
\emph{all} permutations of the set $\bn m$.
This projection map,
whose fiber at $X : \BSG_m$ can be identified with
the set $\sum_{t:X\to X}\Trunc{(X,t)\eqto(\bn m,\zs)}$,
captures $\CG_m$ as a ``subgroup'' of the permutations,
namely the cyclic ones, corresponding to the fact that the
shapes of $\CG_m$ (\ie the elements of $\BCG_m$)
are those of $\SG_m$ together with the extra structure of
the ``cyclic ordering'' determined by $t$.
But how do we capture the other aspect of $\CG_m$,
mentioned in~\cref{ex:cyclicgroups},
that all the cyclic permutations can be obtained by a single generating one?
When thinking of the $m$\th roots of unity as in~\cref{fig:m-cycle-roots},
we can take complex multiplication by $\xi$ to be the generating symmetry.
The key insight is provided by the function $R_m:S^1\to\FinSet_m$ from~\cref{def:RmtoS1},
with $R_m(\base)\defequi\bn m$ and
$R_m(\Sloop)\defis \zs$, picking out exactly the cyclic permutation
$\zs:\bn m\eqto \bn m$ (and its iterates) among all permutations.
Using our new notation, we can also write this as
\[
R_m : \B\ZZ \to \BSG_m.
\]
Set truncation (\cref{def:set-truncation}) provides us with a tool for capturing only the symmetries in $\FinSet_m$ hit by $R_m$:\marginnote{%
$\begin{tikzcd}[column sep=tiny,ampersand replacement=\&]
\& \B\ZZ\ar[dl]\ar[rr,equivr,"c"] \& \& \Cyc_0 \ar[dr] \& \\
\BCG'_m \ar[rrrr,dashed,"g"']\ar[drr,"\prj"'] \& \& \& \& \BCG_m\ar[dll,"\prj"] \\
\& \& \BSG_m\ar[from=uul,"R_m" near start,crossing over]
\ar[from=uur,"{\blank/m}"' near start,crossing over]\& \&
\end{tikzcd}$}
the (in language to come) subgroup of the permutation group generated by the cyclic permutation $\zs$ is the group
\[
\CG'_m\defequi\mkgroup(\BCG'_m,\sh_{\CG'_m}),
\]
where $\BCG'_m\defequi \sum_{X:\FinSet_m}\Trunc{\inv{R_m}(X)}_0$
and $\sh_{\CG'_m}\defequi (\bn m,\trunc{(\base,\refl{\bn m})}_0)$.
That is, $\BCG'_m$ is the $0$-image of $R_m$ in the sense
of~\cref{sec:higher-images},
and is in particular a pointed connected groupoid.
Since we have a factorization of $R_m$ as the equivalence $c:\Sc\equivto\Cyc_0$
followed by the map $\blank/m:\Cyc_0 \to \BSG_m$,
and since $\Cyc_m$ is the $0$-image of the latter by~\cref{thm:image-Z-to-Cm},
we get a uniquely induced pointed equivalence $g : \BCG'_m \ptdweto \BCG_m$.\footnote{%
More precisely, but using language not yet established: $\CG_m$ is both isomorphic to $\ZZ/m\ZZ$, the ``quotient group'' (\cf \cref{def:normalquotient}) of $\ZZ$ by the ``kernel'' (\cf \cref{def:kernel}) induced by $R_m$, and to $\CG'_m$, which is the corresponding ``image'' (\cf \cref{sec:image}). This pattern will later be captured in~\cref{thm:fund-thm-homs}.}
This identifies the set $\Trunc{\inv{R_m}(X)}_0$ with the set of
cycle structures on the $m$-element set $X$.
\end{example}
\begin{xca}\label{xca:CG2isSG2}
Show that the set truncation of $\inv R_2(\bn 2)$ is contractible.
This reflects that $\CG_2$ and $\SG_2$ can be identified.\footnote{%
We will later see that $\CG_2\eqto_\typegroup\SG_2$ is contractible.}
\end{xca}
\begin{xca}\label{xca:RmloopCGm}
Elaborate the symmetries of
$\sh_{\CG'_m}\jdeq (\bn m,\trunc{(\base,\refl{\bn m})}_0)$
in $\BCG'_m$ and show that they are indeed the permutations of $\bn m$
than can be generated by $R_m(\Sloop)$, that is, by $s$.
\end{xca}
\begin{example}\label{ex:productofgroups}
If you have two groups $G$ and $H$,
their \emph{product} $G\times H$ is given by taking
the product of their classifying types:\footnote{%
Note that $\B(G\times H)\jdeq \BG\times \BH$ is pointed at
$\shape_{G\times H}\jdeq(\shape_G,\shape_H)$.}
\[
G\times H\defequi \mkgroup(\BG\times\BH)
\]
For instance, $\SG_2\times\SG_2$ is called the
\emph{Klein four-group}\index{Klein four-group} or \emph{Vierergruppe}\index{Vierergruppe}, because
it has four symmetries.
\end{example}
\begin{xca}\label{xca:klein-not-cyclic}
Show that we cannot identify $\CG_4$ and $\SG_2\times\SG_2$,
\ie the Klein four-group is not a cyclic group.
\end{xca}
\begin{example}\label{ex:bigproductofgroups}
If $S$ is an $n$-element finite set, $n : \NN$,
and $G : S \to \Group$ is an $S$-indexed family of groups,
then we can likewise form the \emph{product} of the family,
by taking the product of the classifying types:
\[
\prod_{s:S}G(s) \defeq
\mkgroup\left(\prod_{s:S}\BG(s),s\mapsto \shape_{G(s)}\right)
\]
Function Extensionality,~\cref{def:funext}, says
that that the function $\ptw$ of~\cref{def:ptw}
gives an equivalence:
\[
\ptw : \USym\left(\prod_{s:S}G(s)\right)
\equivto
\prod_{s:S}\USymG(s)\qedhere
\]
\end{example}
\begin{xca}\label{xca:bigproductfunext}
\begin{enumerate}
\item\label{it:bigproductfunext-i}
Show that a finite product of connected groupoids
is again connected, so that the above definition makes sense.%
\footnote{For infinite products,
we can either use the Axiom of Choice, \cref{pri:ac},
or take the connected component of base point,
$s \mapsto \shape_{G(s)}$.}
\item
Show that when $S$ is identified with a standard $2$-element set
such as $\bool$, then the product of an $S$-indexed family
of groups reduces to the binary product of~\cref{ex:productofgroups}.\qedhere
\end{enumerate}
\end{xca}
\begin{remark}
In \cref{lem:idtypesgiveabstractgroups} we will see that the identity type
of a group satisfies a list of laws justifying the name ``group'' and
we will later show in \cref{lem:Groupsareidentitytypes} that groups
are uniquely characterized by these laws.
\end{remark}
Some groups have the property that the order you compose the
symmetries is immaterial. The prime example is the group of
integers $\ZZ\jdeq\mkgroup(\Sc,\base)$.
Any symmetry is of the form $\Sloop^n$ for some integer $n$,
and if $\Sloop^m$ is also a symmetry,
then $\Sloop^n\Sloop^m=\Sloop^{n+m}=\Sloop^{m+n}=\Sloop^m\Sloop^n$.
Such cases are important enough to have their own name:
\begin{definition}\label{def:abgp}
A group $G$ is \emph{abelian} if all symmetries commute, in the sense that
the proposition
\[
\isAb(G)\defequi\prod_{g,h: \USymG}gh=hg
\]
is true. In other words, the type of abelian groups is
\[
\AbGroup \defequi \sum_{G:\typegroup}\isAb(G).\qedhere
\]
\end{definition}
\begin{xca}\label{exer:first examples}
Show that symmetric group $\SG_2$ is abelian, but that $\SG_3$ is not.
Show that if $G$ and $H$ are abelian groups, then so is their product $G\times H$.
\end{xca}
We can visualize symmetries $g$ and $h$ commuting with each
other in a group $A \jdeq\mkgroup(A,a)$ by the picture\marginnote{%
\begin{tikzcd}[ampersand replacement=\&]
a \ar[r,eqr,"g"]\ar[d,eql,"h"'] \& a\ar[d,eqr,"h"] \\
a \ar[r,eql,"g"'] \& a
\end{tikzcd}}
in the margin;
going from (upper left hand corner) $a$ to (lower right hand corner)
$a$ by either composition gives the same result.
\begin{remark}
\label{rem:whatAREabeliangroups}
Abelian groups have the amazing property that their classifying types are themselves identity types (of certain $2$-types).
This can be used to give a very important characterization of what it means to be abelian.
We will return to this point in \cref{sec:abelian-groups}.
Alternatively, the reference to underlying symmetries in the definition of abelian groups is avoidable using the ``one point union'' of pointed types $X\vee Y$ of \cref{def:wedge} below. (It is the sum of $X$ and $Y$ where the base points are identified.). \cref{xca:whatAREabeliangroups}
\marginnote{%
\begin{tikzcd}[ampersand replacement=\&]
\BG\vee\BG\ar[r,"\text{fold}"]\ar[d,"\text{inclusion}"'] \& \BG \\
\BG\times\BG\ar[ur,dashed]
\end{tikzcd}}
offers the alternative definition that a group $G$ is abelian if and only if
the ``fold'' map $\BG\vee \BG\ptdto \BG$ (where both summands are mapped by
the identity) factors through the inclusion $\BG\vee\BG\ptdto\BG\times\BG$
(where $\inl{x}$ is mapped to $(x,\sh_G)$ and $\inr{x}$ to $(\sh_G,x)$).
The latter turns out to be a proposition equivalent to $\isAb(G)$.
\end{remark}
\begin{xca}
Let $\mkgroup(A,a):\typegroup$ and let $b$ be an arbitrary element of $A$.
Prove that the groups $\mkgroup(A,a)$ and $\mkgroup(A,b)$ are
merely identical, in the sense that the proposition
$\Trunc{\mkgroup(A,a)\eqto\mkgroup(A,b)}$ is true.
Similarly for \inftygps in \cref{sec:inftygps} when you get that far.
\end{xca}
\begin{xca}\label{xca:typegroupisgroupoid}
Given two groups $G$ and $H$. Prove that $G\eqto H$ is a set.
Prove that the type of groups is a groupoid.
This means that, given a group $G$, the component of $\typegroup$,
containing (and pointed at) $G$, is again a group, $\Aut_\Group(G)$,
which we will call more simply the \emph{group $\Aut(G)$ of automorphisms}%
\index{group!of automorphisms} of $G$,
or the \emph{automorphism group}\index{automorphism group} of $G$.
\end{xca}
\section{Abstract groups}
\label{sec:identity-type-as-abstract}
Studying the identity type leads one to the definition of what an
abstract group should be. We fix a type $A$ and an element $a:A$ for the rest
of the section, and we focus on the identity type $a\eqto a$.
We make the following observations about its elements and operations on them.
\begin{enumerate}
\item
There is an element $\refl a : a \eqto a$.
(See page \pageref{rules-for-equality}, rule \ref{E2}.)
We set $e \defeq \refl a$ as notation for the time being.
\item
For $g : a \eqto a$, the inverse $g^{-1} : a \eqto a$ was defined in \cref{def:eq-symm}.
Because it was defined by path induction, this inverse operation satisfies $e^{-1} \jdeq e$.
\item
For $g, h : a \eqto a$, the product $h \cdot g : a \eqto a$ was defined in \cref{def:eq-trans}.
Because it was defined by path induction, this product operation satisfies $e \cdot g \jdeq g$.
\end{enumerate}
For any elements $g,g_1,g_2,g_3:a\eqto a$, we consider the
following four identity types:
\begin{enumerate}
\item
\label{it:right-unit} \emph{the right unit law:} $g \eqto g\cdot e$,
\item
\label{it:left-unit} \emph{the left unit law:} $g \eqto e\cdot g$,
\item
\label{it:associativity} \emph{the associativity law:} $g_1\cdot(g_2\cdot g_3)
\eqto (g_1\cdot g_2)\cdot g_3$,
\item
\label{it:inverse} \emph{the law of inverses:} $g\cdot \inv g \eqto e$.
\end{enumerate}
In \cref{xca:path-groupoid-laws}, the reader has constructed explicit
elements of these identity types.
If $a\eqto a$ is a set, then the identity types
above are all propositions. Then, in line with the convention adopted
in \cref{sec:props-sets-grpds}, we could simply say that
\cref{xca:path-groupoid-laws} establishes that the equations hold.
That motivates the following definition,
in which we introduce a new set $S$ to play the role of $a\eqto a$.
We introduce a new element $e:S$ to play the role of $\refl a$,
a new multiplication operation, and a new inverse operation.
The original type $A$ and its element $a$ play no further role.\footnote{%
In \cref{sec:inftygps} we will come back to $A$ and $a$ and
consider the case in which $A$ is an arbitrary connected type
and $a:A$. Then $a\eqto a$ need not be a set.}
\begin{definition}\label{def:abstractgroup}
An \emph{abstract group}\index{abstract group}\index{group!abstract}
consists of the following data.
\begin{enumerate}
\item\label{struc:under-set} A set $S$, called the \emph{underlying set}.
\item\label{struc:unit} An element $e:S$, called the \emph{unit} or the \emph{neutral element}.\index{neutral element}
\item\label{struc:mult-op} A function $S\to S\to S$, called \emph{multiplication},
taking two elements $g_1,g_2:S$ to their \emph{product}, denoted by $g_1\cdot g_2:S$.
\par \noindent
Moreover, the following equations should hold, for all $g,g_1,g_2,g_3 : S$.
\begin{enumerate}[label=(\alph*),ref=\ref{struc:mult-op} (\alph*)]
\item\label{axiom:unit-laws} $g\cdot e=g$ and $e\cdot g=g$ (the \emph{unit laws})
\item\label{axiom:ass-law} $g_1\cdot(g_2\cdot g_3)=(g_1\cdot g_2)\cdot g_3$ (the \emph{associativity law})
\end{enumerate}
\item\label{struc:inv-op} A function $S\to S$, the \emph{inverse operation},
taking an element $g:S$ to its \emph{inverse} $g^{-1}$.
\par \noindent
Moreover, the following equation should hold, for all $g:S$.
\begin{enumerate}[label=(\alph*),ref=\ref{struc:inv-op} (\alph*),resume*]
\item\label{axiom:inv-law} $ g\cdot g^{-1} = e$ (the \emph{law of inverses})
\qedhere
\end{enumerate}
\end{enumerate}
\end{definition}
\begin{remark}
Strictly speaking, the proofs of the various equations are part of the data defining an abstract group, too. But, since the equations are
propositions, the proofs are unique, and by the convention introduced in \cref{rem:subtype-convention}, we can afford to omit them, when no confusion can occur. Moreover, one need not worry whether one gets a different group if the equations are given different proofs, because proofs of
propositions are unique.
\end{remark}
Taking into account the introductory comments we have made above, we may state the following lemma.
\begin{lemma}\label{lem:idtypesgiveabstractgroups}
If $G$ is a group, then the set $\USymG \jdeq (\sh_G\eqto\sh_G)$
of symmetries in $G$ (see \cref{def:group-symmetries}),
together with $e\defequi\refl{\shape_G}{}$,
$g^{-1}\defequi\symm_{\shape_G,\shape_G}g$
and $h \cdot g \defequi \trans_{\shape_G,\shape_G,\shape_G}(g)(h)$, define an abstract group.
\end{lemma}
\begin{proof}
The type $\USymG$ is a set, because $\BG$ is a groupoid.
\cref{xca:path-groupoid-laws} shows that all the relevant equations hold, as required.
\end{proof}
\begin{definition}\label{def:abstrG}
Given a group $G$, the abstract group of~\cref{lem:idtypesgiveabstractgroups},
$\abstr(G)$, is called the \emph{abstract group associated to $G$}.%
\glossary(absG){$\protect\abstr(G)$}{the abstract group of symmetries in a group $G$,
\cref{def:abstrG}}
\end{definition}
We leave the study of abstract groups for now;
in~\cref{ch:absgroup} we'll
show that the $G \mapsto \abstr(G)$ construction
furnishes an equivalence from the type of groups to the type of abstract groups,
and we'll correlate concepts and constructions on groups
to corresponding ones for abstract groups.
\section{Homomorphisms}
\label{sec:homomorphisms}
\begin{remark}\label{rem:homom-eqs}
Let $G$ and $H$ be groups, and suppose we have a pointed function $k : \BG \ptdto \BH$.
Suppose also, for simplicity (and without loss of generality),
that $\pt_\BH \jdeq k ( \pt_\BG ) $ and $k_\pt \jdeq \refl{\pt_\BH}$.
Applying \cref{def:ap} yields a function $f \defeq \ap k : \USymG \to \USymH$, which satisfies the following identities:
\begin{alignat*}2
f ( \refl {\pt_\BG} ) & = \refl{\pt_\BH}, &\qquad& \\
f (g ^ {-1}) & = (f (g))^{-1} && \text {for any $g : \USymG$}, \\
f (g' \cdot g) & = f (g') \cdot f (g) && \text {for any $g, g' : \USymG$}.
\end{alignat*}
The first one is true by definition, the others follow from~\cref{lem:apcomp}.
These three identities assert that the function $\ap k$ \emph{preserves}, in a certain sense, the operations provided by \cref{lem:idtypesgiveabstractgroups} that
make up the abstract groups $\abstr(G)$ and $\abstr(H)$.
In the traditional study of abstract groups, these three identities play an important role and entitle one to call the function $f$ a
\emph{homomorphism of abstract groups}.\index{homomorphism}
\end{remark}
A slight generalization of the discussion above will be to suppose that we have a general pointed map with an arbitrary pointing path
$k_\pt : \pt_\BH \eqto k ( \pt_\BG ) $,
not necessarily given by reflexivity. Indeed, that works out, thereby motivating the following definition.
\begin{definition}\label{def:grouphomomorphism}
The type of \emph{group homomorphisms}\index{homomorphism!of groups}
from $G:\typegroup$ to
$H:\typegroup$ is defined to be
\[
\Hom(G,H)\defequi\Copy_{\mkgroup}(\BG\ptdto\BH),
\]
\ie it is a wrapped copy of the type of pointed maps of classifying spaces
with constructor
$\mkhom : (\BG \ptdto \BH) \to \Hom(G,H)$.%
\glossary(924Omega__){$\protect\mkhom$}{homomorphism constructor, \cref{def:grouphomomorphism}}
We again write $\B : \Hom(G,H) \to (\BG \ptdto \BH)$ for the destructor,
and we call $\Bf$ the \emph{classifying map}\index{classifying map}
of the homomorphism $f$.\footnote{%
When it is clear from context that a homomorphism is intended,
we may write $f : G \to H$.}
\end{definition}
We would like to understand explicitly the effect of a general homomorphism $f$ from $G$ to $H$
on the underlying symmetries $\USymG$, $\USymH$,
again without assuming that pointing path of $\Bf$ is given by
reflexivity.
So we should first study how pointed maps affect loops:\marginnote{%
\noindent\normalsize\begin{tikzpicture}
\node (Y) at (0,-1.5) {$Y$};
\draw (0,-1)
.. controls ++(170:-1) and ++(180:1) .. (2,-1.5)
.. controls ++(180:-1) and ++(270:1.5) .. (3.5,0.8)
.. controls ++(270:-1.5) and ++(80:1.4) .. (-1,1)
.. controls ++(80:-1.4) and ++(170:1) .. (0,-1);
\node[dot,label=left:$\pt_Y$] (a) at (0,0) {};
\node[dot,label=below:$k(\pt_X)$] (b) at (1.5,-.5) {};
\node (ct) at (2.6,1.1) {$\ap{k_\div}(p)$};
\draw[->] (a) .. controls ++(-20:1) and ++(170:1) .. node[auto,swap] {$k_\pt$} (b);
\draw[->] (b) .. controls ++(20:1) and ++(-40:1) ..
(2,1) .. controls ++(-40:-1) and ++(-80:-1) .. (b);
\end{tikzpicture}}
\begin{definition}\label{def:loops-map}
Given pointed types $X$ and $Y$ and a pointed function $k : X\ptdto Y$ (as defined in \cref{def:pointedtypes}),
we define a function $\loops k : \loops X \to \loops Y$ by setting\footnote{%
Recall~\cref{def:ap} for $\ap{}$, and that we may abbreviate
$\ap{f}(p)$ by $f(p)$. Note also that $\loops k$ is pointed:
we can identify $\loops k(\refl{\pt_X})$ with $\refl{\pt_Y}$.}
\[
\loops k(p) \defeq k_\pt^{-1} \cdot \ap{k_\div}(p) \cdot k_\pt
\text{,\quad for all $p: \pt_X \eqto \pt_X$.}\qedhere
\]
\glossary(924Omega){$\protect\loops k$}%
{loop map of pointed map, \cref{def:loops-map}}
\end{definition}
\begin{remark}\label{rem:loops-map}
If $k : X \ptdto Y$ has the reflexivity path $\refl{Y_\pt}$ as its
pointing path, then we have an identification $\loops k \eqto \ap{k_\div}$.
\end{remark}
\begin{definition}\label{def:USym-hom}
Given groups $G$ and $H$ and a homomorphism $f$ from $G$ to $H$,
we define the function $\USymf : \USymG \to \USymH$
by setting $\USymf \defeq \loops \Bf$.
In other words, the homomorphism $\mkhom\Bf$
induces $\loops\Bf$ as the map on underlying symmetries.
\end{definition}
\begin{lemma}\label{lem:grouphomomaxioms}
Given groups $G$ and $H$ and a homomorphism $f : \Hom(G,H)$, the function $\USymf : \USymG \to \USymH$ defined above satisfies
the following identities:
\begin{alignat}2
\label{gp-homo-unit} (\USymf) ( \refl {\pt_{\BG}} )
&= \refl{\pt_{\BH}}, &\qquad& \\
\label{gp-homo-comp} (\USymf) (g ^ {-1})
&= ((\USymf) (g))^{-1} && \text{for any $g : \USymG$,} \\
\label{gp-homo-inv} (\USymf) (g' \cdot g)
&= (\USymf) (g') \cdot (\USymf) (g) && \text{for any $g, g' : \USymG$.}
\end{alignat}
\end{lemma}
\begin{proof}
We write $f \jdeq (f_\div,p)$, where $p : \pt_{\BH} \eqto f_\div (\pt_{\BG})$.
By induction on $p$, which is allowed since $\pt_{\BH}$ is arbitrary,
we reduce to the case where $\pt_{\BH} \jdeq f_\div (\pt_{\BG})$
and $p\jdeq \refl{\pt_{\BH}}$.
We finish by applying \cref{rem:homom-eqs} and \ref{rem:loops-map}.
\end{proof}