forked from UniMath/SymmetryBook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroup.tex
executable file
·2779 lines (2376 loc) · 182 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
\label{ch:groups}
%\section{Now it starts}
The identity type is not just any type: in the previous sections we have seen that the identity type $a=_Aa$ reflects the ``symmetries'' of an element $a$ in a type $A$.
Symmetries have special properties; for instance you can rotate a square by $90^o$, and you can rotate it by $-90^o$, undoing the first rotation.
Symmetries can also be composed, and this composition respects certain rules that holds in all examples. One way to study the concept of ``symmetries'', would be to isolate the common rules for all our examples, but also show, conversely, that anything satisfying these rules actually \emph{is} an example.
%As an instance of a property that holds in \emph{some} examples but not in others, we have seen that sometimes the order in which we use our symmetries matters, and sometimes it does not, see \cref{ch:intro}. Hence, the concept of a group should not have a rule allowing you to change the order arbitrarily.
With inspiration of geometric and algebraic origins, it became clear to mathematicians at the end of the 19'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 the identity type was ``reflexive, symmetric and transitive'' -- and an abstract group is just a set with such operations satisfying certain rules.
%This is the purpose of the mathematical term ``group''.
We attack the issue more concretely; instead of focusing on the abstract properties we promote the type exhibiting the symmetries, and the axioms for an abstract group follow from the rules for identity types without needing us to worry about them. However, we \emph{will} show that the two approaches give the same end result.
In this chapter we lay the foundations and provide some basic examples of groups.
\subsection{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 spell out the details, expanding on the properties of the identity type of a group and comparing these properties with those of an abstract group. We then return in \cref {sec:identity-type-as-abstract} to groups more generally, explaining how these map to each others through ``homomorphisms'' (which to us are simply pointed maps) and what this entails for the identity types: all the abstract group properties are preserved.
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.
Classically, groups have appeared because they ``act'' on a set (or more general objects), that is to say, they collect some of the symmetries of the set. This is a point of view that we will return to many times and we give the basic theory in \cref{sec:gsets}.
This section should remind the reader very much of what happened in \cref{cha:circle}, where we did much of the same considerations for the special case of the integers.
More generally, connected \coverings now reappear in the guise of ``transitive $G$-sets'', laying the groundwork for our later discussion of the set of subgroups.
Another important thing which is discussed in \cref{sec:gsets} is the type of ``$G$-torsors'', which at first glance can appear frightening.
However, a $G$-torsor correspond to \emph{a} universal \covering and the important step is to consider the \emph{type} of these: this idea is used in \cref{sec:Gsetforabstract} to build the equivalence between our definition of a group and the abstract version taught in most algebra classes. This is followed up for homomorphisms in \cref{sec:homabsisconcr} and for $G$-sets in \cref{sec:Gsetsabstrconcr}.
With all this in place, the structure of the type of groups is in the large in many aspects similar to the universe in the sense that many of the constructions we're used to from the universe have their analog for groups. The functions replaced by the homomorphisms.
Products stay ``the same'' as we will see already in \cref{ex:productofgroups} (and more generally, $\Pi$-types over sets).
The sum of two groups is simple enough: it is 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 out of a sum correspond to pairs of homomorphisms (just as for sum and functions in types).
\footnote{((THEN SUBGROUPS TAKE CENTRAL STAGE, BUT I POSTPONE DISCUSSING THESE IN CASE THIS CHAPTER IS ALREADY OVERLY LONG AND WE WANT TO PUT THEM IN A SEPARATE CHAPTER))}
\section{The type of groups}
\label{sec:typegroup}
\begin{example}\label{ex:base=base}
We defined the circle $S^1$ in \cref{def:circle} by declaring that it has a point $\base$ and an identification (``symmetry'') $\Sloop:\base=_{S^1}\base$, and we proved in \cref{cor:S1groupoid} that $\base=_{S^1}\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$: we have one ``generating symmetry'' $\Sloop$, and this can be applied any number of times, giving a new symmetry for each new number.
Here, composition of loops corresponds to usual addition of integers.
Hence, the circle is a very cheap packaging of the ``{group}'' of integers, the declaration of $\base$ and $\Sloop$ not only gives the \emph{set} $\zet$ of integers, but at the same time the addition.
\end{example}
\begin{example}
Recall the finite set $\bn{2}:\fin_2$ from \cref{def:finiteset}, containing two elements.
According to \cref{xca:C2}, $\bn{2} =\bn{2} $ has exactly two distinct elements, $\refl{\mathrm 2}$ and $\twist$, and doing $\twist$ twice gives you back $\refl{\bn{2} }$.
We see that this is exactly all the symmetries you'd expect to have in a two point set: you can let everything be ($\refl{\bn{2} }$) or you could swap the two elements ($\twist$); and if you swap twice everything is let be.
The type $\fin_2$ (of ``finite sets with two elements'') is our embodyment of these symmetries.
Observe that (by the definition of $S^1$) there is an interesting function $S^1\to\fin_2$, sending $\base:S^1$ to $\bn{2} :\fin_2$ and $\Sloop$ to $\twist$.
\end{example}
The examples Klein and Lie were interested in were of a type making it admissible to say that a group is the identity type $a=_Aa$ for \emph{some} type $A$ and \emph{some} element $a:A$.
However, in elementary texts it is customary to restrict the notion of a group to the case when $a=_Aa$ is a \emph{set} as we will do, starting in \cref{sec:identity-type-as-abstract}. This makes some proofs easier, since if are we given two elements $g,h:a=_Aa$, then the identity type $g=h$ is a proposition, \ie $g$ can be equal to $h$ in at most one way. Hence questions relating to uniqueness will never be a problem.
See \cref{sec:grouphistory} for a brief summary of the early history of groups.
\begin{remark}
The reader may wonder about the status of the identity type $a=_Aa'$ where $a,a':A$ are different elements. One problem is of course that if $p,q:(a=_Aa')$ there is no obvious way of composing $p$ and $q$, and another is that $a=_Aa'$ does not have a distinguished element such as $\mathrm{refl{}_a}:a=_Aa$.
Given $f:a=_Aa'$ we can use transport along $f$ to compare $a=_Aa'$ with $a=_Aa$ (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=_Aa'$ and $a=_Aa$ are different animals.
We will return to this example when we've defined torsors.
\end{remark}
\begin{remark}
\label{rem:whypointedconngpoid}
% In \cref{xca:component-same-loops} you were asked to show that if $A$ is a type and $a:A$, then
As a consequence of \cref{lem:subtype-eq-=},
the inclusion of the component $A_{(a)}\defequi\sum_{x:A}\Trunc{a=x}$ into $A$ (\ie the first projection) induces an equivalence of identity types
from $(a,!)=_{A_{(a)}}(a,!)$ to $a=_Aa$.
This means that, when considering the identity type $a=_Aa$, ``only the elements $x:A$ with $x$ equal to $a$ are relevant'', and we to avoid artificial extra copies of our object of interest we should consider only \emph{connected} $A$ (c.f.~\cref{def:connected}).
Also, our preference for $a=_Aa$ to be a \emph{set} indicates that we should consider only the connected types $A$ that are \emph{groupoids}.
\end{remark}
With this established, we let the \emph{type} of groups be defined as follows:
\begin{definition}\label{def:typegroup}
%\footnote{we must define $\isset$ and propositional truncation. Alternatively we must define $\isonetype$ and $\conn$}
A \emph{group} is a pointed connected groupoid; the \emph{type of groups} is the type
%$$\typegroup=\sum_{A:\UU}A\times\isonetype(A)\times \conn_0A.$$
$$\typegroup\defequi\sum_{A:\UU}\sum_{a:A}\isset(a=_Aa)\times\prod_{x:A}\Trunc{x=_Aa}$$
of pointed connected groupoids.\footnote{how do we want to deal with the fact that in many of our examples $A$ is not in the chosen universe?}
%We refer to an element of $\typegroup$ as a \emph{group}.
A group $G=(A,a,p,q):\typegroup$ will be referred to simply as $$\aut_A(a).$$ The underlying pointed type $$BG\defequi(A,a)$$ is referred to as the \emph{classifying type of $G$}. The element $\pt_G\defequi a$ will be referred to as the \emph{base point}.
Informally, we may also refer to the type $BG_\div\defequi A$ as the classifying type of $G$.
\end{definition}
The following exercise reconciles the words of the above definition with the type.
\begin{xca}\label{xca:defgroup}
Show that $A$ is a groupoid for any group $\aut_A(a)$.
\end{xca}
\begin{remark}\label{rem:aut}
There is no ambiguity in writing $\aut_A(a)$ instead of $(A,a,p,q)$: being a connected groupoid is asserted by
$$\isset(a=_Aa)\times\prod_{x:A}\Trunc{x=_Aa}$$ which is a proposition (\cref{lem:prop-utils} and \cref{lem:isX-is-prop}) and so the witness $(p,q)$ is unique. In this sense, once you know that the classifying type is a connected groupoid, $BG$ carries all the information about $G$: $$G\oldequiv\aut_{BG_\div}(pt_{G}).$$
\end{remark}
\end{definition}
\begin{remark}
\label{rem:symmetriesofnonconnectedgroupoids}
It is not infrequent that we want to consider the symmetries of some element $a$ in some type $A$ which unfortunately is not connected, but where the component $A_{(a)}$ of $a$ is a groupoid. It will notationally be convenient to define ``$\aut_A(a)$'' to be shorthand for $\aut_{A_{(a)}}(a,!)$.
\end{remark}
\subsection{First examples}
\label{sec:firstgroupexamples}
\begin{example}\label{excirclegroup}
The circle $S^1$, 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=_{S^1}\base$ is equivalent to to the set of integers $\zet$ and composition corresponds to addition. This justifies our definition of the \emph{group of integers} as
$$\ZZ \defeq \aut_{S^1}(\base).$$
It is noteworthy that along the way we gave several versions of the circle, each of which has its own merits, the version in \cref{def:S1toC}
$$C=(\sum_{X:\UU}\sum_{f:X=X}\Trunc{(\zet,s)=(X,f)}, (\zet,s))$$
being a very convenient one.
\end{example}
\begin{example}\label{ex:groups}
% Since any pointed connected groupoid is a group, there is no shortage of examples, but perhaps i
Apart from the circle, there are some important groups that come almost for free: namely the symmetries in the type of sets.
%It is worthwhile to consider some specially designed examples.
\begin{enumerate}
\item Recall that the set $\bn{1} =\true$ has the single element which we can call $*$. Then $\aut_{\bn{1} }(*)$ is a group called the \emph{trivial group}.
\item If $n:\NN$, then the \emph{permutation group of $n$ letters} is
$$\Sigma_n\defequi\aut_{\fin_n}(\bn{n} ),$$
where $\fin_n$ is the groupoid of sets of cardinality $n$ (c.f.~\ref{def:finiteset}).
The classifying type is thus $B\Sigma_n\defequi (\fin_n,\bn{n})$.
With our convention of \cref{rem:symmetriesofnonconnectedgroupoids} we can tolerate $\aut_{\fin}(\bn n)$, $\aut_{\Set}(\bn n)$ or even $\aut_{\UU}(\bn n)$ as synonyms for the group $\Sigma_n$ (where $\fin$ and $\Set$ are the subtypes of $\UU$ of finite sets and sets).
If the reader starts worrying about size issues, that is quite legitimate; see \cref{rem:groupsarebig}.
% DELETE Note that even though the sets $\bn{n} =_{\fin}\bn{n} $ and $\bn{n} =_{\fin_n}\bn{n} $ are equal, we must use the component $\fin_n$ rather than the entire groupoid $\fin$ of finite sets to keep the underlying pointed groupoid $B\Sigma_n=(\fin_n,\bn{n} )$ connected.
\item More generally, if $S$ is a set, is there a pointed connected groupoid $(A,a)$ so that $a=_Aa$ models all the ``permutations'' $S=_{\Set}S$ of $S$? Again, the only thing wrong with the groupoid $\Set$ of set (apart from $\Set$ being large) is that $\Set$ is not connected.
%}!\footnote{it's so simple -- so very simple -- that only a child can do it!} To be precise, the component of $S$ is
%$$A\defequi\sum_{X\in\Set}\Trunc{S=X}.$$
%The connected groupoid $\sum_{X\in\Set}\Trunc{S=X}$ is pointed at $S$ (and the fact that $S=S$ is nonempty since $\refl S:S=S$).
% Then
% $$(S=_AS)=(S=_{\Set}S)$$
% (in the identity type of a $\Sigma$-type both the first and the second projections must be equal, but for $A\oldequiv\sum_{X:\Set}\Trunc{S=X}$ the second projection is a proposition).
%
The \emph{group of permutations of $S$} is defined to be
$$\Sigma_{S}\defequi\aut_{\Set}(S),$$
with classifying type $B\Sigma_S\defequi(\Set_{(S)},S)$.
% DELETE SINCE WERE NOT TALKING ABT INFTYGPS Likewise, if $X$ is any type, the \emph{group of automorphism} or \emph{permutations} of $X$ is defined to be
% $$\Sigma_X=\aut_{\UU_{(X)}}X,$$
% where $U_{(X)}$ is the component of $\UU$ containing $X$.
\end{enumerate}
\end{example}
\begin{remark}
\label{rem:groupsarebig}
This is only for those who worry about size issues - a theme we systematically ignore in our exposition. If we start with a base universe $\UU_0$, the groupoid of sets of cardinality $n$, $\fin_n$ is a $\Sigma$-type $\sum_{A:\UU_0}\Trunc{A=\bn{n}}$ over $\UU_0$ and so without any massage will lie in a bigger universe $\UU_1$. In order to accomodate for the finite permutation groups, the universe ``$\UU$'' appearing as a subscript for the first $\Sigma$ in the definition of groups needs to be at least as big as $\UU_1$. If so, the type $\typegroup$ will not be in $\UU_1$, but in some bigger universe $\UU_2$, so if I choose some group $G$ and look at \emph{its} group of automorphisms, this will will be a group only if the universe is at least as big as $\UU_2$. Luckily, our convention is that the universes are nested, and so at any point we'll just be somewhere big enough for our purposes, see \cref{sec:univax}. This is not to say that these questions are trivial or unimportant; they are nontrivial and important, but not what this text is about.
\end{remark}
\begin{example}\label{ex:cyclicgroups}
In \cref{thm:coveringsofS1} we studied the symmetries of the ``$m$-fold \covering''
of the circle for $m$ a positive integer, and showed that there were $m$ different
such symmetries. Moreover we showed that these symmetries were the powers $f^n$ (for $n=0,1,\dots,m-1$)
of one (nonunique) symmery $f$ and that $f^{m+k}=f^k$ for any integer $k$.
This very important phenomenon pops up in many situations,
and is called the \emph{cyclic group of order $m$}.
In other words, the cyclic group of order $m$ is the (pointed) component of the type $\SetBundle(\Sc)$ of \coverings of the circle containing the $m$-fold \covering.
We analyzed this in \cref{thm:coveringsofS1} and found that this (pointed) component was equivalent to the connected groupoid
$$B\ZZ/m_\div\defequi\conncomp{(\sum_{X:\Set}X=X)}{\zet/m}$$
pointed in $\zet/m = (\bn{m},s_n),$
where
$$s_n :\bn{m}=\bn{m}$$ is (the identity corresponding to the equivalence given by)
the cyclic permutation of $\bn{m}$, sending $m-1$ to $0$ and,
for $0\leq i<m-1$, sending $i:\bn m$ to $i+1$ (strictly speaking, $\zet/m$ when first presented in Definition~\ref{def:Zetmodm} represented a symmetry of $\bn m\times\bn 1$, but we trust we'll be forgiven for retaining the names of the symmetry under identification provided by univalence and the projection from $\bn m\times \bn1$ to $\bn m$). The role
the successor function plays in $C$ is played by the successor modulo $m$ in $\ZZ/m$.
It is this modular behavior which inspires the ``$\ZZ/m$'' in the expression above: we are talking about the ``integers modulo $m$''.
We make this our (first) definition of the cyclic group of order $m$:
\end{example}
\begin{definition}\label{def:Z/mgroup}
If $m$ is a positive integer, the cyclic group of order $m$ is the group
$$\ZZ/m\defequi\aut_{B\ZZ/m}(\zet/m).$$
\end{definition}
\begin{example}
There are other (beside the symmetries of the $m$-fold \covering and Definition~\ref{def:Z/mgroup}) ways of obtaining the cyclic group of order $m$, which occasionally are more convenient. The prime other interpretation is as the group of ``cyclic permutations of $m$ points on a circle''; \ie as the ``set of $m$th roots of unity in the complex plane'' equipped with complex multiplication.
We know the group $\Sigma_m\defequi\aut_{\fin_m}(\bn m)$ of {\bf all} permutations of the set $\bn m$ with $m$ elements, but how do we select the ``subgroup'' of cyclic permutations?
The key insight is the provided by function
$$cy_m:S^1\to\fin_m$$
with $cy_m(\base)\defequi\bn n$ and
$cy_m(\Sloop)\defis s_m$, picking out exactly the cyclic permutation $s_m\colon\bn m=\bn m$ (and its iterates) among all permutations. Set truncation of \cref{def:set-truncation} provides us with a tool for capturing only the symmetries of $\fin_m$ hit by $f$: the (in language to come) subgroup of the permutation group of cyclic permutations is the group
$$C_m\defequi\aut_{BC_m}(\pt_{C_m}),$$
where $(BC_m)_\div\defequi \sum_{S:\fin_m}\Trunc{cy_m^{-1}(S)}_0$ and $\pt_{C_m}\defequi (\bn m,\trunc{(\base,\refl{\bn m})}_0))$. We must prove that $BC_m$ is a pointed connected groupoid for it to earn the name ``group'', but since we will provide a pointed equivalence beween $B\ZZ/m$ and $BC_m$, this will follow automatically.
More precisely, but using language not yet established, this is shown in ???\footnote{find reference} as applied to the map $cy_m\colon S^1\to\fin_m$ (interpreted as a ``group homomorphism'' $cy_m\colon \ZZ\to\Sigma_n$): $\ZZ/m$ is equivalent to the ``quotient group'' (c.f.~\cref{def:normalquotient}) of $\ZZ$ by the ``kernel'' (c.f.~\cref{def:kernel}) of $cy_m$, whereas $C_m$ is exactly the ``image'' (c.f.~\cref{def:image}) of $cy_m$.
However, in our special case we can give a proof using only language we know.
If $z\colon S^1$, $\alpha\colon\base=\base$ and $a\colon\base =z$, let $t_a\alpha\defequi a\alpha a^{-1}\colon z=z$. If $b\colon\base=z$ is another identification, then $t_a\alpha= t_b\alpha$ simply because $\alpha=(b\alpha^{-1})^{-1}\alpha(b\alpha^{-1})^{-1}$. Since the trasnported loop $t_a\Sloop\colon z=z$ does not depend on $a$, we rechristen it $\Sloop_z$.\footnote{what is the reference to where this has been used before (via circle induction)? I repeat here because I need this behavior}
\begin{lemma}
Given $S\colon\fin_m$, the function
\begin{align*}
f_S\colon\Sigma_{z\colon\Sc^1}(S=cy_m(z))&\to \Sigma_{q\colon S=S}\Trunc{(S,q)=(\bn m,s_m)},\\
f_S(z,v)&\defequi (v^{-1}cy_m(\Sloop_z)v,!)
\end{align*}
is an equivalence.
\end{lemma}
\begin{proof}
First and foremost, $f_S$ is actually well defined in the sense that $(S,v^{-1}cy_m(\Sloop_z)v)=(\bn m,s_m)$ is inhabited: if $a\colon z=\base$, then $cy_m(a)v^{-1}$ {\color{red}I'LL BE BACK}
\end{proof}
THE REST IS TO BE DELETED WHEN THE ABOVE IS FINISHED.
Staying close to the type $C$ above is perhaps the simplest: %\cref{def:S1toC}
$$BC_m\defequi(\sum_{X:\Set}\sum_{p:X=X}\Trunc{(\bn{n},s_m)=(X,p)},(\bn{n},s_m)),$$
For yet another way of obtaining $C_m$, consider the function
$$cy_m:S^1\to\fin_m$$
with $cy_m(\base)\defequi\bn n$ and
$cy_m(\Sloop)\defis s_m$.
Note that the symmetry $cy_m(\Sloop)$ is cyclic in the sense that
the $n$-fold iterate $cy_m(\Sloop)^n$ is $\refl{\bn n}$.
Then the $n$-fold \covering can be seen as the first projection
$$\sum_{z:S^1}cy_m(z)\to S^1$$
(you are asked to write this out in \cref{xca:somedetailsonfinitegroupstocheck}).
Consider the pointed type
\[
B_m\defequi(\sum_{S:\fin_m}\Trunc{cy_m^{-1}(S)}_0 ~,~
(\bn n,\trunc{(\base,\refl{\bn n})}_0))
\]
where the type can be viewed as the ``image'' of $cy_m$,
except that the truncation is one level higher than we have considered before.
Since $\fin_m$ is a groupoid, $B_m$ is a groupoid.
If we focus on the point $\pt_{B_m}\defequi(\bn n,\trunc{(\base,\refl{\bn n})}_0)$ and
write out the identity type $\pt_{B_m}=\pt_{B_m}$ of the $\Sigma$-type $B_m$,
we see that it consists of those $p:\bn n=\bn n$ such that there is
a $q:\base=\base$ with $p=cy_m(q)$:
the ``permutations that come from rotating $n$ points on the circle'' --
exactly what the cyclic group of order $n$ should be!
We DOUBLY define {\em cyclic group of order $n$} to be the group (DELETE?)
$$C_m\defequi\aut_{B_m}(\pt_{B_m}).$$
It is good to know that $B_m$ is connected, so that $(B_m,\pt_{B_m})$ is actually
AAAthe classifying type [DELETE $BC_m$. NOT YET PROVED: ISOMORPHIC ABSTRACT
GROUPS HAVE EQUIVALENT CLASSIFYING TYPES] Remember that
$cy_m^{-1}(S)\defequi\sum_{z:S^1}(S=cy_m(z))$, and notice that the map
$$e:\sum_{S:\fin_m}cy_m^{-1}(S)\to S^1,\qquad e(S,z,p)=z$$
is an equivalence fitting in a commuting diagram [CHECK LOOP?]
$$\xymatrix{
\sum_{S:\fin_m}cy_m^{-1}(S)\ar[d]^e_\simeq\ar[rr]^-{\text{set truncation}}&&
\sum_{S:\fin_m}\Trunc{cy_m^{-1}(S)}_0\ar[d]^{\text{first projection}}&\oldequiv B_m\\
S^1\ar[rr]^{cy_m}&&\,\fin_m.}$$
All preimages of of the top map are all inhabited, and since $S^1$ is connected,
the source is connected.
Hence \cref{lem:whenisbasespaceconnected} tells us that $B_m$ is connected too.
% . Let $(S,z,p):B_m$ be any element; we want to show that $(S,z,p)=_{B_m}(\bn n, \base, \refl\base)$ is not empty, so that $B_m$ is connected. Since $S^1$ is connected there is a $q:z=_{S^1}\base$ so $(cy_m(q)\,p,q,!):(S,z,p)=(\bn n,\base,\refl\base)$ (using that $cy_m(\base)\defequi\bn n$ to compose $p:S=cy_m(z)$ and $cy_m:cy_m(z)=cy_m\base$), $B_m$ is connected.
% DELETE Pointing $B_m$ in $\pt_{C_m}$ we have a pointed connected groupoid, \ie a group, which we call the {\em cyclic group $C_m$ of order $n$} (and in hindsight $B_m=(BC_m)_\div$).
Note that the cyclic group of order $1$ is the trivial group, the cyclic group of order $2$ is equivalent to the permutation group $\Sigma_2$: there are 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 $\Sigma_m$ has $m!=1\cdot 2\cdot\dots\cdot m$ symmetries.
\end{example}
\begin{example}\label{ex:productofgroups}
If you have two groups $G$ and $H$, their {\em product} $G\times H$ is given by taking the product of their classifying types:
$$G\times H\defequi\aut_{BG_\div\times BH_\div}((\pt_G,\pt_H))$$
(note that $B(G\times H)\oldequiv BG\times BH$ is pointed at $\pt_{G\times H}\oldequiv(\pt_G,\pt_H)$).
For instance, $\Sigma_2\times\Sigma_2$ is called the {\em Klein group}.
\end{example}
\footnote{We might tone down exercises like ``prove that $\typegroup$ is a groupoid'', even though we will want to use these results. They take the geometry/fun out of the exposition.}
\begin{xca}
\label{xca:somedetailsonfinitegroupstocheck}
\begin{enumerate}
\item Compare the definitions of \cref{def:finiteset} and show that if $n:\NN$, then $\Sigma_n=\Sigma_{\bn{n} }$ %is equal to the permutation group on $n$ letters
and (since $\fin_0=\fin_1=\bn 1$) that $\Sigma_{1}=\aut_{\bn{1} }(\triv)$.
%\item Display an element in $\bn{2} =_{\fin_2}\bn{2} $ different from $\refl{\bn{2} }$ in the group $\Sigma_{2}$ of permutations of two letters.
\item Prove that the set $\bn{n} =_{\fin_n}\bn{n} $ is finite of cardinality $n!$.
\item Give an identification of the $n$-fold \covering of $S^1$ of \cref{exa:mfoldS1cover} with the first projection $\sum_{z:S^1}cy_n^{-1}(z)\to S^1$ of \cref{ex:cyclicgroups}.
%, where $cy_n:S^1\to\fin_n$ is given by $cy_n(\base)\defequi\bn n$ and $cy_n(\Sloop):\bn n=\bn n$ is cyclic permutation (sending $n-1$ to $0$ and, for $0\leq i<n-1$, sending $i:\bn n$ to $i+1$).
Hint: for every $z:S^1$, $cy_n(z):\fin_n$ is a finite set of cardinality $n$.
Decidability is not an issue, so you can appeal to our classification of the \coverings of the circle.
\item Show that, given a type $X$, the type of functions $BC_n\to X$ is equivalent to the type
$$\sum_{f:S^1\to X}\prod_{z:S^1}f(z)=f(z^n)$$ of functions $f:S^1\to X$ such that the two ways around
$$\xymatrix{S^1\ar[d]_{(-)^n}\ar[dr]^f&\\S^1\ar[r]^f&X}$$
agree. Hint: define the function $F_1:(BC_n\to X)\to (S^1\to X)$ by precomposition:
$F_1(g)(z)=g(cy_n(z),!)$ and observe that since $cy_n(z)=cy_n(z^n)$ we have a
function $F:(BC_n\to X)\to \sum_{f:S^1\to X}\prod_{z:S^1}f(z)=f(z^n)$.
\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''
%we may associate an abstract group $(a=_Aa,e,{-}^{-1},\cdot)$
and we will later show that groups are uniquely characterized by these laws.
\end{remark}
Some groups have the property that the order you perform the symmetries is immaterial. The prime example is the group of integers $\ZZ\oldequiv \aut_{S^1}(\base)$ Any symmetry is of the form $\Sloop^n$ for some integer $n$, and if $\Sloop^m$, 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
$$\mathbf{isAb}(G)\defequi\prod_{g,h:\pt_G=\pt_G}gh=hg$$
is true. In other words, the type of abelian groups is
$$\mathbf{Ab}\defequi \sum_{G:\typegroup}\mathbf{isAb}(G).$$
\end{definition}
\begin{xca}\label{exer:first examples}
Show that permutation group $\Sigma_2$ is abelian, but that $\Sigma_3$ is not. Show that if $G$ and $H$ are abelian groups, then so is their product $G\times H$.
\end{xca}
We can envision $g$ commuting with $h$ by the picture
$$\xymatrix{a\ar@{=}[r]^g_\to\ar@{=}[d]^\downarrow_h&a\ar@{=}[d]^\downarrow_h\\
a\ar@{=}[r]^g_\to&a}$$
and saying that going from (upper left hand corner) $a$ to (lower right hand corner) $a$ by either composition gives the same result.
Abelian groups have the amazing property that the 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\footnote{hopefully} return to this point later.
\begin{remark}
\label{rem:whatAREabeliangroups}
The reference to $\mathbf{isAb}$ in the definition of abelian groups is avoidable using the ``one point union'' of pointed types $X\vee Y$ of \cref{def:wedge} (it is the sum of $X$ and $Y$ where the base points are identified); \cref{xca:whatAREabeliangroups} offers the alternative definition that a group $G$ is abelian if and only if the ``fold'' map $BG\vee BG\to BG$ factors over the inclusion $BG\vee BG\to BG\times BG$.
\end{remark}
\begin{remark}
The condition $\isset(a=_Aa)$ in the definition of the type of groups is sometimes more of a nuisance, and deleting it gives the simpler concept of \aninftygp, see \cref{sec:inftygps}.
\end{remark}
\begin{xca}
Let $\aut_A(a):\typegroup$ and let $b$ be an arbitrary element of $A$. Prove that the groups $\aut_A(a)$ and $\aut_A(b)$ are identical, in the sense that $\Trunc{\aut_A(a)=\aut_A(b)}$ is true. Similarly for \inftygps when you get that far.
\end{xca}
\begin{remark}\label{rem:monoidandabsgplarge}
In \cref{def:typegroup} the first $\sum$ in the definition of the type $\typegroup$ ranges over the entire universe $\UU$. Hence, $\typegroup$ does not belong to $\UU$, but rather to the next universe as discussed briefly in \cref{sec:univax}. This tendency that the ``type of all the types we are interested in'' is a ``large type'' is a regular feature of the theory and since it will not cause any trouble for us, we will not be consistent in pointing it out.
\end{remark}
\begin{xca}\label{xca:typegroupisgroupoid}
Given two groups $G$ and $H$. Prove that $G=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, which we will call the \emph{group $\aut(G)$ of automorphisms} of $G$.
\end{xca}
\section{The identity type as an abstract group }
\label{sec:identity-type-as-abstract}
Studying the identity type leads one to the definition of what a group should be:
Let $A$ be a type, and let $a=b$ be shorthand for $a=_Ab$ when $a,b:A$. In \cref{sec:identity-types} we saw that
\begin{enumerate}
\item[R] {\bf Reflexivity.} For any $a:A$ there is an element
$$\refl a{}:a=a$$
%(by definition)
\item[S] {\bf Symmetry.} For any $a,b:A$ there is a an element $$\symm{}_{a,b}:(a=b)\to (b=a)$$ defined by $\symm{}_{a,a}(\refl a{})\defequi\refl a{}$
\item[T] {\bf Transitivity.} For any $a,b,c:A$ there is an element $$\trans{}_{a,b,c}:(a=b)\to((b=c)\to(a=c))$$ defined by $\trans{}_{a,a,a}(\refl a{})(\refl a{})\defequi \refl a{}$.
\end{enumerate}
%\footnote{\em\bf I have swapped the order of the input in trans so that it can fit. I know you hate it and will force me to recant}
To emulate classical notation, for fixed $a:A$, %for the moment
let's write
\begin{enumerate}
% \item $G$ instead of $a=_Aa$,
\item $e$ instead of $\refl a{}$
\item $g^{-1}$ instead of $\symm_{a,a}(g)$, when $g:a=a$
\item $h\cdot g$ instead of $\trans_{a,a,a}(g)(h)$ when $g,h:a=a$.
\end{enumerate}
What properties can we show about this without knowing anything about $A$ and $a$? For convenience, here is a list of the results we are aiming for: for all $g,g_1,g_2,g_3:a=a$ we will construct elements in all the following propositions
\begin{enumerate}
\item $g=g\cdot e$ \qquad(``right unit law'')\footnote{redundant (keep). If you still want to reinsert the other redundant $g\cdot g^{-1}=e$ and $(g^{-1})^{-1}=g$ we have to do some renumbering.
%Forgot which way you prefereed the equalities: from simple to complicated or the other way around?
}
\item $g=e\cdot g$ \qquad(``left unit law'')
\item $g_1\cdot(g_2\cdot g_3)=(g_1\cdot g_2)\cdot g_3$ \qquad(``associativity'')
\item $e=g^{-1}\cdot g$ \qquad(``inverse'').
%\item $g\cdot g^{-1}=e$ redundant (remove)
% \item $(g^{-1})^{-1}=g$ redundant (remove)
\end{enumerate}
We do $g=e\cdot g$ in some detail (remember that ``$e$'' is shorthand for $\refl a{}$)
\begin{definition}\label{def:p1}
Let $A$ be a type and $a, b:A$ and $g:a=b$ be elements. Then $p_1(a,b,g):g=_{a=b}g\cdot e$ is the element defined by induction by saying that $p_1(a,a,e)$ is $\refl e:e=e\cdot e$.
\end{definition}
\begin{remark}
This makes sense since we \emph{defined} $e\cdot e\defequi e$ (or, as it was originally formulated, $\trans_{a,a,a}(\refl a{})(\refl a{})\defequi \refl a{}$). We'll say that we produce $p_1(a,b,g)$ by ``induction on $b$'', the case where $b$ is $a$ (and $g$ is $e$) is the start of the induction; the induction principle for the identity type $a=b$ then finishes the construction.
As constructed, $p_1$ is actually an element in the type
$$\prod_{a:A}\prod_{b:A}\prod_{g:a=b}(g=g\cdot e)$$ -- it is constructed ``uniformly'' or ``naturally'' for all $a,b,g$: think of it as a function with $(a,b,g)$ as input and $p_1(a,b,g):g=g\cdot e$ as output.
We may add a little meat to the definition of $p_1$: in the definition of the identity type, for each $a:A$ let $P$ be the type family given by $P(b,g)\defequi (g=g\cdot e)$ for each $b:A$ and $g:a=b$.
According to the definition of the identity type, in order to produce elements in $P(b,g)$ for arbitrary $b$ and $g$ it suffices to give an element in $P(a,e)\oldequiv (e=e\cdot e)$, but $e\cdot e\defequi e$ and so $\refl e:e=e$ will do.
\end{remark}
\begin{definition}\label{def:p3}
Let $A$ be a type and $a,b,c,d:A$ and $g_3:a=b$, $g_2:b=c$ and $g_1:c=d$ elements. Then $p_3(a,b,c,d,g_1,g_2,g_3):g_1\cdot(g_2\cdot g_3)=_{a=_Ad}(g_1\cdot g_2)\cdot g_3$ is the element defined by induction by saying that $p_3(a,a,a,a,e,e,e,e)$ is $\refl e:e\cdot(e\cdot e)=(e\cdot e)\cdot e$ [which makes sense since $e\cdot e\defequi e$].
\end{definition}
\begin{remark}
This definition is somewhat more complicated than the first, in the sense that in order to unravel the induction to exactly the form accepted in the definition of the identity type, we need to apply the rule three times. %((write out))
\end{remark}
\begin{definition}\label{def:p4}
Let $A$ be a type and let $a,b:A$ and $g:a=b$ be elements. Then $p_4(a,b,g):g^{-1}\cdot g=_{a=_Aa} e$ is the element defined by induction by saying that $p_4(a,a,e)$ is $\refl e:e=e\cdot e$ [which makes sense since $e^{-1}\defequi e$ and $e\cdot e\defequi e$].
\end{definition}
\begin{xca}\label{xca:p2}
Define $p_2(a,b,g)$ %and $p_3(a,b,g)$
by exactly the same procedure, completing the list.
\end{xca}
\begin{remark}
One may worry about many things when one sees the list ``right unit law, left unit law, associativity, inverse''. For instance, for the particular case of $g$ being $e$, are the elements in $e=e\cdot e$ given in the left and right unit laws equal? Since $a=a$ is a set, such worries become irrelevant: $e=e\cdot e$ is then a proposition, so any two elements are equal.
\end{remark}
These properties of the identity type are bundled together in the concept of an abstract group, under the additional hypothesis that we are dealing with a set.
\begin{definition}\label{def:abstractgroup}
%% local redefinition of \ref to nested item
\makeatletter %
\renewcommand\p@enumii{}%
\makeatother%
An \emph{abstract group} consists of the following data:
\begin{enumerate}
\item a set $S$ called the \emph{underlying set} of the abstract group;
\item an element $e:S$ called the \emph{unit} or the \emph{neutral element};
\item\label{struc:mult-op} a function ${\cdot}: S\to S\to S$ called the \emph{multiplication},
taking two elements $g_1,g_2:S$ to their \emph{product} denoted by $g_1\cdot g_2:S$;
\footnote{The types $S\to S\to S$ and $(S\times S)\to S$ are equivalent
and will be used interchangeably.}
\noindent The above data should satisfy the following properties, for all $g,g_1,g_2,g_3:S$ :
\begin{enumerate}
\item\label{axiom:unit-laws} %$e$ is a ``neutral element'':
$g\cdot e=e\cdot g=g$ called the \emph{unit laws};
\item\label{axiom:ass-law} %satisfying ``associativity'':
$g_1\cdot(g_2\cdot g_3)=(g_1\cdot g_2)\cdot g_3$ called the \emph{associativity law};
\end{enumerate}
\item\label{struc:inv-op} a function ${}^{-1}: S\to S$ called the \emph{inverse operation},
taking an element $g:S$ to its \emph{inverse} denoted by $g^{-1}$.
\noindent Moreover, the inverse operation should satisfy the
following property, for all $g:S$ :
\begin{enumerate}\setcounter{enumii}{2}
\item\label{axiom:inv-law} %inverse
$ e = g\cdot g^{-1}$ called the \emph{law of inverses}.
\end{enumerate}
% \item %inverses:
% for every $g:S$, there merely exist an element $h:S$ such that $e=h\cdot g$.
\end{enumerate}
\end{definition}
\begin{remark}\label{rem:inverses-as-property}
%% local redefinition of \ref to nested item
\makeatletter %
\renewcommand\p@enumii{}%
\makeatother%
Instead of including the inverse operation as part
(\ref{struc:inv-op}) of the structure and assuming the property
(\ref{axiom:inv-law}), some authors assume the existence of inverses
as a property:
\begin{enumerate}
\item[]\begin{enumerate}\setcounter{enumii}{3}%
\item\label{axiom:mere-inverse} for all $g:S$ there exists an
$h:S$ such that $e = g \cdot h$.
\end{enumerate}
\end{enumerate}
Using the properties (\ref{axiom:unit-laws}) and
(\ref{axiom:ass-law}) one easily proves that such inverses are
unique. We will now compare (\ref{axiom:mere-inverse}) to (\ref{struc:inv-op}) plus
(\ref{axiom:inv-law}).
First, \cref{def:abstractgroup} requires that $S$ is a set.
Consequently, the properties
(\ref{axiom:unit-laws})--(\ref{axiom:inv-law}) are propositions.
Property (\ref{axiom:mere-inverse}) instead of (\ref{struc:inv-op}) plus
(\ref{axiom:inv-law}) does not require the inverse operation to be a
function.
Property (\ref{axiom:mere-inverse}) contains the quantification
``there exists''. The faithful translation of
(\ref{axiom:mere-inverse}) into type theory would be with $\exists$,
``there merely exists'', see \cref{sec:prop-trunc}. Under this
translation, contrary to groups in ordinary mathematics, it makes no
sense, a priori, to talk about ``the inverse of $g$'' and about the
law of inverses. Indeed, ``the inverse of $g$'' could only be
mentioned when targeting a propositional goal.
However, the following lemma proves that we can define an inverse
operation as in (\ref{struc:inv-op}) satisfying
(\ref{axiom:inv-law}) from a witness of (\ref{axiom:mere-inverse}).
This means that, a posteriori, we \emph{can} talk about ``the
inverse of $g$'' also if the goal is not a proposition. We choose
to include the inverse operation in the structure right from the
start.
\end{remark}
\begin{lemma}%
\label{lem:group-inv-operation}%
Given a set $S$ together with $e$ and $\cdot$ as in
\cref{def:abstractgroup} satifying the unit laws, the associativity
law, and property (\ref{axiom:mere-inverse}), there is a function
$\inv{\blank}: S \to S$ having property (\ref{axiom:inv-law}) of an
abstract group.
\end{lemma}
\begin{proof}
Consider the function $\mu: S \to (S \to S)$ defined as
$g\mapsto (h \mapsto g\cdot h)$. We claim that the fiber
$\inv{\mu(g)}(e)$ is contractible. This is a proposition, hence to
prove it from (\ref{axiom:mere-inverse}), one can as well assume the
actual existence of $h$ such that $g\cdot h = e$. Then $(h,!)$ is an
element of the fiber $\inv{\mu(g)}(e)$. We will now prove that it is
a center of contraction. For any other element $(h',!)$, we want to
prove $(h,!) = (h',!)$ which is equivalent to the type $h=h'$. In
order to prove the latter, we show that $h$ is also an inverse on
the left of $g$, meaning that $h\cdot g=e$: this is again a
proposition so we can assume from (\ref{axiom:mere-inverse}) an
actual element $k:S$ such that $h\cdot k = e$, and by multiplying by
$g$ on the left, one obtains
\begin{displaymath}
k = (g\cdot h)\cdot k = g\cdot (h\cdot k) = g\cdot e = g.
\end{displaymath}
From there it follows that
\begin{displaymath}
h = h \cdot e = h \cdot (g\cdot h') = (h \cdot g) \cdot h' = e\cdot
h' = h'
\end{displaymath}
as required. Hence $\inv{\mu(g)}(e)$ is contractible with center
$c_g \defequi (h,!)$. This argument works for an arbitrary $g:S$,
hence we can craft the function $\inv\blank : g \mapsto c_g$. By
definition it satisfies the law of inverses (\ref{axiom:inv-law}).
\end{proof}
Now we can refer to $\inv g$ as {\em the inverse of $g$}, and to the
equations $g\cdot g^{-1}= g^{-1}\cdot g=e$ as the \emph{law of
inverses}. From now on, we might refer to an abstract group
$(S,e,\cdot,!)$ as a element of the form $(S,e,\cdot,\inv\blank,!)$
where $\inv\blank$ is constructed as above.
\begin{remark}
It is sometimes handy to break up the rather long
\cref{def:abstractgroup} by saying that the right and left unit law
together with associativity define a \emph{monoid}, and if we, in
addition, have inverses satisfying the law of inverses, then we have
an abstract group.%
\label{rem:typemonoidabstrgp}
Summing up in language a machine (and the occasional mad scientist)
can handle, the \emph{type of monoids} is
$$\typemonoid\defequi \sum_{M:\UU}\sum_{e:M}\sum_{\mu{}:M\to M\to M}
\isset{(M)}\times\mathrm{Monoidlaws}(M,e,\mu)
$$
where
$$\mathrm{Monoidlaws}(M,e,\mu)\defequi\mathrm{Unitlaws}(M,e,\mu)\times\mathrm{Assoclaw}(M,\mu{})$$
and
\begin{align*}
\mathrm{Unitlaws}(M,e,\mu)\defequi\prod_{g:M}
& (g=\mu{}(g)(e))\times(g=\mu{}(e)(g)),
\\
\mathrm{Assoclaw}(M,\mu{})\defequi\prod_{g_1,g_2,g_3:M}
& \mu{}(g_1)(\mu{}(g_2)(g_3))=\mu{}(\mu{}(g_1)(g_2))(g_3).
\end{align*}
In the human language we used above, with $\mu(g)(h)=g\cdot h$,
$\mathrm{Unitlaws}$ and $\mathrm{Assoclaw}$ spell out to the machine
that the unit behaves like a unit and that the multiplication is
associative.
In other words, the \emph{type $\typegroup^\abstr$ of abstract
groups} is equivalent to
\begin{displaymath}
\sum_{(M,e,\mu,!):\typemonoid} \sum_{\iota\colon M\to M} \prod_{g:M}(e=\mu(g)(\iota(g))).
\end{displaymath}
We will typically refer to a monoid as a triple $(M,e,\mu)$,
omitting the names for the (true) $\isset$ and unit and
associativity laws, and likewise, an abstract group will be referred
to as a quadruple $(M,e,\mu,\iota)$. With this notation, the set
$M$ is referred to as \emph{underlying set}.
\end{remark}
In conclusion, in that section we have proved that groups give rise to
abstract groups:
\begin{lemma}\label{lem:idtypesgiveabstractgroups}
If $G$ is a group, then $\pt_G=\pt_G$ together with $e\defequi\refl{\pt_G}{}$, $g^{-1}\defequi\symm_{\pt_G,\pt_G}g$ and $h\cdot h\defequi\trans_{\pt_G,\pt_G,\pt_G}(g)(h)$
%$A$ is a groupoid %(alternatively called a ``$1$-type'') and $a:A$ is an element, then $a=_Aa$, together with $e\defequi\refl a{}$, $g^{-1}\defequi\symm_{a,a}g$ and $g\cdot h\defequi\trans_{a,a,a}(g)(h)$
define an abstract group
$$\abstr(G)\defequi (\pt_G=\pt_G,e,\cdot,{-}^{-1}).$$
\end{lemma}
\begin{proof}
The elements $p_1,\dots, p_4$ of \cref{def:p1,def:p4,def:p3,xca:p2} show that all the relevant identity types (which are propositions since $A$ is a groupoid) are nonempty, as required.
\end{proof}
\begin{definition}\label{def:abstrG}
Given a group $G$, the abstract group $\abstr(G)$ of \cref{lem:idtypesgiveabstractgroups} is called the \emph{abstract group associated to $G$}.
\end{definition}
\begin{remark}
That the concept of an abstract group synthesizes the idea of symmetries will be justified in \cref{sec:Gsetforabstract} where we prove that
$$\abstr:\typegroup\to\typegroup^\abstr$$
is an equivalence.
\end{remark}
\begin{remark}
If $\mathcal G=(S,e,\mu,\iota)$ and $\mathcal G'=(S',e',\mu',\iota')$ are abstract groups, an element of the identity type $\mathcal G=\mathcal G'$ consists of quite a lot of information. First and foremost, we need an identity $p:S=S'$ of sets, but from there on the information is a list of elements in propositions (this is more interesting for \inftygps). An analysis shows that this list can be shortened to ``$e'=p(e)$ and $\mu'(p(s),p(t))=p(\mu(s,t))$''. The most convenient way of obtaining such an identity is to dream up a function $f:S\to S'$ that preserves the group structure (\ie what will shortly be called an abstract homomorphism) and then show that $f$ is an equivalence and under univalence gives rise to an identity.
\end{remark}
\begin{xca}
\label{xca:conj}
Let $\mathcal G=(S,e,\mu,\iota)$ be an abstract group and let $g:S$. If $s:S$, let $c^g(s)\defequi g\cdot s\cdot g^{-1}$. Show that the resulting function $c^g:S\to S$ preserves the group structure (for instance $g\cdot(s\cdot s')\cdot g^{-1}=(g\cdot s\cdot g^{-1} )\cdot(g\cdot s\cdot g^{-1})$) and is an equivalence. The resulting identity $c^g:\mathcal G=\mathcal G$ is called \emph{conjugation} by $g$\index{conjugation}.
\end{xca}
\begin{remark}
Without the demand that the underlying type of an abstract group or monoid is a set, life would be more complicated. For instance, for the case when $g$ is $e$, the unit law of \cref{def:abstractgroup} (or alternatively $\mathrm{Unitlaws}(S,\mu{},e)(e)$ in \cref{rem:typemonoidabstrgp}) would provide \emph{two} (potentially different) proofs that $e=e\cdot e$ and we would have to separately insist that they agree. This problem vanishes in the setup we adopt below for \inftygps.
\end{remark}
\begin{xca}
For an element $g$ in an abstract group, prove that
$e=\inv g\cdot g$ and $g=(g^{-1})^{-1}$. In other words (for the
machines among us), given an abstract group $(S,e,\mu,\iota)$,
give an element in the proposition
\begin{displaymath}
\prod_{g:S} (e=\mu(\iota(g))(g))\times
(g=\iota(\iota(g))).
\end{displaymath}
\end{xca}
\begin{xca}\label{xca:typemonoidisgroupoid}
Prove that the types of monoids and abstract groups are groupoids.
\end{xca}
\begin{xca}
\label{xca:cheapgroup}
There is a leaner way of characterizing what an abstract group is: define a \emph{sheargroup} to be a set $S$ together with an element $e:S$, a function $S\times S\to S$ sending $(a,b):S\times S$ to $a*b:S$ and the following propositions where we use the shorthand $\bar a\defequi a*e$:
\begin{enumerate}
\item $e*a=a$,
\item $a*a=e$ and
\item $c*(b*a)=\overline{(c*\bar b)}*a$,
\end{enumerate}
for all $a,b,c:S$.
Show that the type of abstract groups is equivalent to the type of sheargroups.
Hint: setting $a\cdot b\defequi \bar b*a$ gives you an abstract group from a sheargroup and conversely, letting $a*b=b\cdot a^{-1}$ takes you back. On your way you may need at some point to show that $\overline{\bar a}=a$: setting $c=\bar a$ and $b=a$ in the third formula will do the trick (after you have established that $\bar e=e$). This exercise may be good to look back to in the many instances where the inverse inserted when ``multiplying from the right by $a$'' is forced by transport considerations.
\end{xca}
\section{Homomorphisms}
\label{sec:homomorphisms}
The notion of a group homomorphism from $G=\aut_A(a)$ to $H=\aut_B(b)$
is simple: it is a pointed function $A\ptdto B$, that is a function
$f:A\to B$ that ``sends $a$ to $b$'', \ie together with an element
$p:b=_Bf(a)$:
\begin{definition}\label{def:grouphomomorphism}
The type of \emph{group homomorphisms} from $G:\typegroup$ to
$H:\typegroup$ is defined to be
$$\Hom(G,H)\defequi(\clf G\ptdto \clf H),
%\footnote{would you be unhappy if I used $f:G\to_{\typegroup}H$ when it fits better with the typography?}%\sum_{f:A\to B}f(a)=_Bb.
$$
in other words, a homomorphism $f:\Hom(G,H)$ is a pair $({\clf f}_\div,p_f)$ where ${\clf f}_\div:{\clf G}_\div\to {\clf H}_\div$ and $p_f:\pt_H={\clf f}_\div(\pt_G)$.
\end{definition}
When there is little danger of confusion we may drop the subscript
$\div$ even when talking about the unpointed structure.
\begin{example}%
\label{ex:groups-morphisms}%
~%
\begin{enumerate}
\item Consider two sets $S$ and $T$. Recall from \cref{ex:groups}
that $\Set_{(S)}\defequi\sum_{X:\Set}\Trunc{S=X}$ is the component
of the groupoid $\Set$ containing $S$, and when pointed at $S$
represents the permutation group $\Sigma_S$. The map
$\blank\coprod T:\Set_{(S)}\to\Set_{(S\coprod T)}$ sending $X$ to $X\coprod T$
induces a group homomorphism $\Sigma_S\to\Sigma_{S\coprod T}$,
pointed by the path $\refl {S\coprod T}:S\coprod T = (\blank\coprod T)(S)$.
Thought of as symmetries, this says that if you have a symmetry of
$S$, then we get a symmetry on $S\coprod T$ (which doesn't do
anything to $T$).
Likewise, we get a map
$\blank\times T:\Set_{(S)}\to\Set_{(S\times T)}$ sending $X$ to
$X\times T$ induces a group homomorphism
$\Sigma_S\to\Sigma_{S\times T}$, pointed by the path
$\refl {S\times T}: {S\times T} = (\blank \times T)(S)$.
In particular, we get homomorphisms $\Sigma_m\to\Sigma_{m+n}$ and $\Sigma_m\to\Sigma_{mn}$. \footnote{find a good description of the sign $\Sigma_n\to\Sigma_2$}
\item Let $G$ be a group. Since there is a unique map from $BG$ to
$\bn{1} $ (obviously pointed by the reflexivity path of the unique
element of $\bn 1$), we get a unique homomorphism from $G$ to the
trivial group. Likewise, there is a unique morphism from the
trivial group to $G$, sending the unique element of $\bn 1$ to
$\pt_G$, and pointed by $\refl {\pt_G}$.
\item If $G$ and $H$ are groups, the inclusions and projections between $B(G\times H)\oldequiv BG\times BH$ and $BG$ and $BH$ give rise to group homomorphisms between $G\times H$ and $G$ and $H$. \footnote{Elaborate}
\end{enumerate}
\end{example}
\begin{remark}
In the last examples, we insisted on the path pointing a group
homomorphism even when this path was a reflexivity path. We now take
the convention to not specify the path in this case. Thus, given a
map $f:A \to B$ between connected groupoids and $a:A$, the group
homomorphism $\Aut_A(a) \to \Aut_B(f(a))$ defined by
$(f,\refl{f(a)})$ will simply be referred to as $f$.
However, it is important to understand that different homomorphisms
can have the same underlying unpointed function. Consider, for
example, the group $\permgrp 3$, whose classifying space is
$\clf \permgrp 3\defequi (\fin_3,\bn 3)$, and the path
$\tau:\pt_{\permgrp 3}=\pt_{\permgrp 3}$ that is defined (through
univalence) as
\begin{displaymath}
0\mapsto 1,\quad 1\mapsto 0,\quad 2 \mapsto 2
\end{displaymath}
Then the function $\id: \fin_3 \to \fin_3$ gives rise to two
elements of $\Hom(\permgrp 3,\permgrp 3)$: the first one is
$(\id,\refl{\bn 3})$, which is simply denoted $\id_{\permgrp 3}$;
the second one is $(\id,\tau)$, that we will denote $\tilde\tau$
temporarily. Let us prove $\id_{\permgrp 3} \neq \tilde \tau$, that
is suppose a path $\id_{\permgrp 3}= \tilde \tau$ and derive a
contradiction. Such a path is the data of a path $p:\id = \id$ such
that $\pathover {\refl{\bn 3}} {T} {p} \tau$ where the type family
$T:(\fin_3\to\fin_3) \to \UU$ is given by
$f\mapsto (\pt_{\permgrp 3} = f(\pt_{\permgrp 3}))$. It is easy to
determine the transport in that type family $T$ and we find that
$(\pathover {\refl{\bn 3}} {T} {p} \tau) \weq (p(\pt_{\permgrp
3})=\tau)$. Now, by induction on $q:\id=f$ for
$f:\permgrp 3 \to \permgrp 3$, one shows that
\begin{displaymath}
\ap f : (\pt_{\permgrp 3} = \pt_{\permgrp 3}) \to
(f(\pt_{\permgrp 3}) = f(\pt_{\permgrp 3}))
\end{displaymath}
is equal to
$q(\pt_{\permgrp 3})\cdot {\blank}\cdot \inv{q(\pt_{\permgrp
3})}$. In particular, when $f\jdeq \id$ and $q\jdeq p$, it means
that conjugating by $p(\pt_{\permgrp 3})$ is trivial. But by
hypothesis $p(\pt_{\permgrp 3}) = \tau$, so it means that $\tau$
commutes with every other element of
$\pt_{\permgrp 3} = \pt_{\permgrp 3}$. One can check that it
actually fails to be the case for the element $\theta$ defined by
\begin{displaymath}
0\mapsto 0,\quad 1\mapsto 2,\quad 2\mapsto 1 .
\end{displaymath}
Indeed, $\theta\tau(0) = 2$ while $\tau\theta(0) = 1$. (See also
\cref{exer:first examples}.)
\end{remark}
\begin{example}
\label{ex:Zinitial}
\cref{cha:circle} was all about the circle $S^1$ and its role as a
``universal symmetry'' and how it related to the integers. In our
current language, $\ZZ\defequi\aut_{S^1}(\base)$ and large parts of
the universality is found in the following observation. If $G$ is a
group then the evaluation equivalence
$\ev_{BG_\div}:(S^1\to BG_\div)\we \sum_{y:BG_\div}(y=y)$ of
\cref{lem:freeloopspace} yields an equivalence
$$\ev_{BG}:\left((S^1,\base)\ptdto BG\right)\we (\pt_G=\pt_G).$$
The domain of this equivalence $\ev_{BG}$ is nothing else that the
definition of $\Hom(\ZZ,G)$. Hence, $\ev_{BG}$ provides a way to
identify $\Hom(\ZZ,G)$ with the abstract group $\pt_G=\pt_G$.
% Show that ((wedges of circle vs multiplication))
\end{example}
\begin{example}
We will later show that if $G$ and $H$ are groups, then $\Hom(G,H)$
is equivalent to the {\bf set} of ``abstract group homomorphisms''
from $\abstr(G)$ to $\abstr(H)$ (cf.\ \cref{lem:homomabstrconcr}),
but it is instructive to prove that
$$\Hom(G,H)\defequi(BG\ptdto BH)\defequi\sum_{F:BG_\div\to BH_\div}(\pt_H=F(\pt_G))$$
is a set directly from the definition. Recall our notation: a
homomorphism $f:\Hom(G,H)$ is recorded as the pair
\begin{displaymath}
(Bf_\div,p_f):\sum_{F:BG_\div\to BH_\div}(\pt_H=F(\pt_G)).
\end{displaymath}
Let us spell out the data needed to give an identity between two
group homomorphisms $f,f':\Hom(G,H)$. We clearly must have a
$$J:Bf_\div=Bf_\div',$$
which by function extensionality \cref{def:funext} is equivalently
uniquely given by its image given by the element (with the same
name) in the $\Pi$-type
$$J:\prod_{z:BG_\div}Bf_\div(z)=Bf'_\div(z).$$
Transport over $J$ of $p_f:\pt_H=Bf_\div(\pt_G)$ shows that in
addition we must have a path $!:J(\pt_G)\cdot p_f=p_{f'}$ in the
type ${\pt_H=Bf'_\div(\pt_G)}$:
\begin{displaymath}
\xymatrix{&\pt_H\ar@{=}[dl]_{p_f}^{\rotatebox{35}{\footnotesize$\gets$}}
\ar@{=}[dr]^{p_{f'}}_{\rotatebox{-35}{\footnotesize$\to$}}&\\
Bf_\div(\pt_G)\ar@{=}[rr]^{J(\pt_G)}_\to&&\,Bf'_\div(\pt_G).}
\end{displaymath}
In other words, we have an equivalence
$$(f=f')\simeq \sum_{J:Bf_\div=Bf'_\div}J(\pt_G)p_f=p_{f'}.$$
Now, take $(J,!)$ and $(K,!)$ of the latter type. Then
$(J,!) = (K,!)$ is equivalent to $J=K$, that is in turn equivalent
to $\prod_{z:BG_\div}J(z)=K(z)$. Because $Bf_\div(z)=Bf'_\div(z)$ is
a set for every $z$ ($BH_\div$ being a groupoid), the type
$J(z)=K(z)$ is a proposition. One can now use the connectedness of
$BG_\div$, and only check the equality on a given point, say
$\pt_G$. However, from the previous diagram, it follows that
\begin{displaymath}
J(\pt_G) = p_{f'}\inv{p_f} = K(\pt_G).
\end{displaymath}
This concludes the proof that $f=f'$ is a proposition, or in other
words that $\Hom(G,H)$ is a set.
%% ---------------------------------------------------------------
%% P.Cagne (Feb. 20th 2020)
%%
%% We can roll back to this end of the proof but it uses loose
%% vocabulary ('is determined by') and it does not provide clear
%% propositional targets that would allow to use actual paths as
%% gamma instead of mere ones.
%%
%% (Unless I miss something of course, just tell me then.)
%% ---------------------------------------------------------------
%%
% Now, $J$ being member of a $\prod$-type implies that if $z:BG$ and
% $\gamma:\pt_G=z$, then $!:J(z)Bf_\div(\gamma)=Bf'_\div(\gamma) J(\pt_G)$
% $$\xymatrix{
% Bf_\div(\pt_G)\ar@{=}[r]^{J(\pt_G)}_\to\ar@{=}[d]^\downarrow_{Bf_\div(\gamma)}&
% Bf'_\div(\pt_G)\ar@{=}[d]^\downarrow_{Bf'_\div(\gamma)}\\
% Bf_\div(z)\ar@{=}[r]^{J(z)}_\to&Bf'_\div(z)},
% $$
% so that -- since $BG$ is connected and $Bf_\div(z)=Bf'_\div(z)$ is a
% set -- $J(z)$ is determined by $J(\pt_G)$ which again is determined
% by $p_f$ and $p_{f'}$. This shows that $f=f'$ is a proposition and
% that $\Hom(G,H)$ is a set.
% We want to show that $f=f'$ is a proposition. If $(J,!)$ and $(J',!)$ are elements in $\sum_{J:Bf_\div=Bf'_\div}J(\pt_G)\,p_f=p_{f'}$, then $!:J(\pt_G)=p_{f'}p_f^{-1}=J'(\pt_G)$. Since $J(z)=J'(z)$ is a proposition for each $z:BG$ it suffices to display a map $(\pt_G=z)\to(J(z)=J'(z))$.
\end{example}
\begin{xca}\label{xca:BGtotype}
Let $G$ be a group and $A$ a groupoid. Use the definitions and
\cref{xca:freemaps} to show that the types
\begin{enumerate}
\item $BG_\div\to A$,
\item $\sum_{a:A}\sum_{f:BG_\div \to A}(f(\pt_G)=a)$,
\item $\sum_{a:A}(BG\to_*(A,a))$ and
\item $\sum_{a:A}\Hom(G,\aut_A(a))$
\end{enumerate}
are all equivalent.
\end{xca}
The definition of group homomorphisms in \cref{def:grouphomomorphism} should be contrasted with the usual -- and somewhat more cumbersome -- notion of a group homomorphism $f\colon \mathcal G\to \mathcal H$ of abstract groups where we must specify that in addition to preserving the neutral element ``$f(e_G)=e_H$'' it must preserve multiplication: ``$f(g)\cdot_{\mathcal H} f(g')=f(g\cdot_{\mathcal G} g')$ (where we have set the name of the abstract group as a subscript to $e$ and $\cdot$). In our setup this is simply true:
\begin{remark}\label{def:grouphomomaxioms}
Let $G$ and $H$ be groups and assume given a group homomorphism
$f:G\to H$. We now define something that we will later call an
``abstract group homomorphism
${\abstr}(f):\abstr(G)\to \abstr(H)$'', \ie a function of sets from
$(\pt_G=\pt_G)$ to $(\pt_H=\pt_H)$ ``preserving'' the abstract group
structure, cf.\ \cref{def:abstrG} for the definition of $\abstr(G)$
and \cref{def:abstrisfunctor} for a condensation of what the
discussion below end up with concluding that ``preserves'' means.
Recall that such a $f:\Hom(G,H)$ is recorded as a pair
\begin{displaymath}
(Bf_\div,p_f):\sum_{F:BG_\div\to BH_\div}(\pt_H=F(\pt_G)),
\end{displaymath}
and define the function
\begin{displaymath}
f^\abstr : (\pt_G=\pt_G) \xrightarrow{\ap {Bf_\div}}
(f(\pt_G)=f(\pt_G)) \xrightarrow{\trp {\inv{p_f}}} (\pt_H=pt_H)
\end{displaymath}
We take the time to develop from first principles the properties
that $f^\abstr$ satisfies.
% As in \cref{def:apd}%\footnote{I use $f(p)$ rather than the $\mathrm{ap}_f$-formalism which I think is alienating when compared with the classical setup}
% , for $z:BG$ this gives rise to a map
% $$\ap{Bf_\div}:(\pt_G=z)\to (Bf_\div(\pt_G)=Bf_\div(z)),$$
% defined by induction by declaring that $\ap{Bf_\div}(\refl{\pt_G})\defequi \refl{Bf_\div(\pt_G)}$.
% If $g:\pt_G=\pt_G$, then $\ap{Bf_\div}(g)$ is an element of $Bf_\div(\pt_G)=Bf_\div(\pt_G)$, while we want something in $\pt_H=\pt_H$. However, this is not an obstacle since conjugation by $p_f: Bf_\div(\pt_G)=\pt_H$ gives rise to
% $$\mathrm{ad}_{p_f}:(Bf_\div(\pt_G)=Bf_\div(\pt_G))\weq(\pt_H=\pt_H)$$ (with $\mathrm{ad}_{p_f}(\refl{Bf_\div(\pt_G)})=\refl{\pt_H}$, as discussed in \cref{sec:heavy-transport}) and so
% $$\mathrm{ad}_{p_f}(\ap{Bf_\div}(g)):\pt_H=\pt_H.$$
% This defines a function
% $$f^\abstr\defequi \mathrm{ad}_{p_f}\ap{Bf_\div}:(\pt_G=\pt_G)\to(\pt_H=\pt_H)$$
One proves easily (by induction) that
$\trp {\inv{p_f}} = \inv{p_f} \cdot \blank \cdot p_f$. It means that
the element $f^\abstr(g)$ is the ``up, over and down'' identity of
$\pt_H$ depicted in the following diagram:
\begin{displaymath}
\xymatrix{%
Bf_\div(\pt_G)\ar@{=}[r]^{\ap{Bf_\div}(g)}_\to \ar@{=}[d]^\uparrow_{p_f} &
Bf_\div(\pt_G)\ar@{=}[d]^\uparrow_{p_f}
\\
\pt_H\ar@{:}[r]^{f^\abstr(g)}_\to & \pt_H.%
}
\end{displaymath}
% Since type-checking removes the ambiguity, we trust it will not lead to any confusion that we simplify the notation and use the symbol $f$ simultaneously for $Bf_\div$, writing $f\colon BG_\div\to BH_\div$ and for $\ap{Bf_\div}$, writing $f:(\pt_G=\pt_G)\to (f(\pt_G)=f(\pt_G))$, while we write
% $$f^\abstr\defequi \mathrm{ad}_p\ap{Bf_\div}:(\pt_G=\pt_G)\to(\pt_H=\pt_H), \qquad g\mapsto p\,f(g)\,p^{-1}$$
% and depicting it as the ``up, over and down'' identity of $\pt_H$:
% $$\xymatrix{f(\pt_G)\ar@{=}[r]^{f(g)}_\to\ar@{=}[d]^\downarrow_p&f(\pt_G)\ar@{=}[d]^\downarrow_p\\
% \pt_H&\pt_H}.$$
% When time comes, even the superscript $\abstr$ will vanish.
% % (which is defensible, given that $p$ is part of the homomorphism $f$).
With the shorthand $$e_G\defequi\refl{\pt_G}:(\pt_G=\pt_G)$$ and writing (to remind us where things happen)
$$g\cdot_Gg':(\pt_G=\pt_G)$$
for the composite $g\,g'$ of $g$ and $g'$ (note that we use functional notation, so that composition is ``first $g'$ and then $g$'' as in the picture
$\xymatrix{\pt_G\ar@{=}[r]^{g'}_\to&\pt_G\ar@{=}[r]^{g}_\to&\pt_G}$) %$\trans_{\pt_G,\pt_G\pt_G}(g,g'):$
and likewise with a subscript $H$, we have the following:
\begin{enumerate}
\item the proposition $f^\abstr(e_G)= e_H$ holds through the
composite:
\begin{displaymath}
f^\abstr(e_G)\defequi\trp {\inv{p_f}}\ap{Bf_\div}(\refl{\pt_G})
= \inv{p_f} \cdot \refl{\pt_H} \cdot p_f = e_H
\end{displaymath}
% Since $\ap{Bf}(e_G)\oldequiv \ap{Bf}f(\refl{\pt_G})\oldequiv\refl{f(\pt_G)}$ and $e_H\oldequiv\refl{\pt_H}$,
% $$f(e_G)\oldequiv\mathrm{ad}_p(\ap{Bf}(e_G))\oldequiv\mathrm{ad}_p(\refl{f(\pt_G)})\oldequiv \refl{\pt_H}\oldequiv e_H$$
\item the proposition
$f^\abstr(g\cdot_Gg')=f^\abstr(g)\cdot_Hf^\abstr(g')$ contains an
element given by the composite:
\begin{align*}
f^\abstr(g\cdot_Gg')
&\defequi \trp{\inv{p_f}}\left(\ap{Bf_\div}(g\, g')\right)
\\
&=\trp{\inv{p_f}}(\ap{Bf_\div}(g)\,\ap{Bf_\div}(g)')
\\
&=\inv{p_f}\ap{Bf_\div}(g)\ap{Bf_\div}(g'){p_f}
\\
&=\inv{p_f}\ap{Bf_\div}(g)p_f\inv{p_f}\ap{Bf_\div}(g'){p_f}
\\
&=\trp{\inv{p_f}}\left(\ap{Bf_\div}(g)\right)
\cdot_H\trp{\inv{p_f}}\left(\ap{Bf_\div}(g')\right)
\\
&\jdeq f^\abstr(g)\cdot_Hf^\abstr(g'),
\end{align*}
where we have used that $\ap{Bf_\div}$ takes composites of
identities to composites of identities.
If you find it useful, you may consider the following picture:
\begin{displaymath}
\xymatrix{
Bf_\div(\pt_G)\ar@{=}[rr]^{\ap{Bf_\div}(g\, g')}_\to\ar@{=}[dr]^{\ap{Bf_\div}(g')}_{\rotatebox{-35}{\footnotesize$\to$}} \ar@{=}[dd]_{p_f}^\uparrow
&&Bf_\div(\pt_G)\ar@{=}[dd]_{p_f}^\uparrow\\
&Bf_\div(\pt_G)\ar@{=}[d]_{p_f}^\uparrow
\ar@{=}[ur]^{\ap{Bf_\div}(g)}_{\rotatebox{35}{\footnotesize$\to$}}
&\\
\pt_H&\pt_H&\pt_H},
\end{displaymath}
where $f^\abstr(g\cdot_Gg')$ is simply ``up, over and down'' while $f^\abstr(g)\cdot_Hf^\abstr(g')$ takes the detour via the $\pt_H$ in the middle.
\end{enumerate}
\end{remark}
\begin{definition}\label{def:abstrisfunctor}
If $\mathcal G\defequi(S,e_{\mathcal G},\cdot_{\mathcal G},\iota_{\mathcal G})$ and $\mathcal H\defequi(T,e_{\mathcal H},\cdot_{\mathcal H},\iota_{\mathcal H})$ are two abstract groups, then the set of homomorphisms from $\mathcal G$ to $\mathcal H$ is
$$\Hom^\abstr(\mathcal G,\mathcal H)
\defequi\sum_{f:S\to T}(e_{\mathcal H}=_Tf(e_{\mathcal G}))\times
\prod_{s,s':S}f(s\cdot_{\mathcal G}s')=_Tf(s)\cdot_{\mathcal H}f(s').
$$
Since $(e_{\mathcal H}=f(e_{\mathcal G}))$ and
$f(s\cdot_{\mathcal G}s')=_Tf(s)\cdot_{\mathcal H}f(s')$ for $s:S$ are
propositions, a homomorphism of abstract group is uniquely determined
by its underlying function of sets, and unless there is danger of
confusion we may write $f$ instead of $(f,!)$.
If $G$ and $H$ are groups, the function
$$\abstr:\Hom(G,H)\to\Hom^\abstr(\abstr(G),\abstr(H))$$
is defined as the function $f\mapsto \abstr(f)\defequi(f^\abstr,!)$
made explicit in \cref{def:grouphomomaxioms}.
\end{definition}
\begin{xca}
Note that the inverses play no r\^ole in the definition of a homomorphism of abstract groups. Prove that if $(f,!):\Hom^\abstr(\mathcal G,\mathcal H)$
%(G_{\Set},e_G,\mu_G,\iota_G),(H_{\Set},e_H,\mu_H,\iota_H))$
then the proposition $f(g^{-1})=(f(g))^{-1}$ for all $g:\mathcal
G$, so that we don't have to require it separately.
\end{xca}
\begin{example}
\label{ex:conjhomo}
Let $\mathcal G=(S,e,\mu,\iota)$ be an abstract group and let $g:S$. In \cref{xca:conj} we defined $c^g:S\to S$ by setting $c^g(s)\defequi g\cdot s\cdot g^{-1}$ for $s:S$ and asked you to show that it ``preserves the group structure'', \ie represents a homomorphism
$$c^g:\Hom^\abstr(\mathcal G,\mathcal G)$$
called \emph{conjugation} by $g$\index{conjugation}.
Actually, we asked more: namely that conjugation represents an identity (for which we used the same symbol) $c^g:\mathcal G=\mathcal G$.
If $\mathcal H$ is some other abstract group, transport along $c^g$ gives an identity
$c^g_*:\Hom(\mathcal H,\mathcal G)=\Hom(\mathcal H,\mathcal G)$ which should be viewed as ``postcomposing with conjugation''. (Naturally, similar considerations goes for elements in $\mathcal H$, giving rise to ``precomposition with conjugation''.)
\end{example}
\begin{xca}
Prove that composition of the functions on the underlying sets gives a composition of homomorphisms of abstract groups.
Prove that if $f_0:\Hom(G_0,G_1)$ and $f_1:\Hom(G_1,G_2)$ then
$$\abstr(f_1f_0)=\abstr(f_1)\abstr(f_0)$$ and that $\abstr(\id_G)=\id_{\abstr(G)}$.
\end{xca}
\section{\texorpdfstring{\inftygps}{∞-groups}}
\label{sec:inftygps}
Disregarding the set-condition we get the simpler notion of \inftygps:
\begin{definition}The type of $\infty$-groups is
$$\typeinftygp\defequi \sum_{A:\UU}\sum_{a:A}\prod_{x:A}\Trunc{x=_Aa}.$$
\end{definition}
\begin{remark}\label{rem:pointedtypes}
Just as ``group'' is a synonym for ``pointed, connected groupoid'', ``$\infty$-group'' is synonym for ``pointed, connected type''. As for groups, we suppress the propositional information from the notation and write $\aut_A(a)$ instead of $(A,a,!)$ for an $\infty$-group.
% ; the type of \emph{pointed types} being
% $$\pttype\defequi\sum_{A:\UU}A,$$
% and given two pointed types $(A,a)$ and $(B,b)$, the type of \emph{pointed maps} from $(A,a)$ to $(B,b)$ is
% $$((A,a)\to_*(B,b))\defequi\sum_{f\colon A\to B}f(a)=b.$$
\end{remark}
\footnote{Let $\typeset\defequi \sum_{A:\UU}\isset(A)$.}
\begin{definition}\label{def:classifyingspace}
If $G\oldequiv\Aut_A(a):\typeinftygp$, then the underlying pointed type $BG\defequi (A,a)\colon\pttype$ is called the \emph{classifying type} and $\pt_G\defequi a$ is the \emph{base point}.
%We retain the same language also for ordinary groups in which case the classifying type is a groupoid (\ie a $1$-type). %For \inftygps the definition is identical.
\end{definition}
\begin{definition}
A homomorphism of $\infty$ groups is a pointed function of classifying types, \ie