6.11 Algebra
In addition to constructing higher-dimensional objects such as spheres and cell complexes, higher inductive types are also very useful even when working only with sets. We have seen one example already in Lemma 6.9.3 (http://planetmath.org/69truncations#Thmprelem3): they allow us to construct the colimit of any diagram of sets, which is not possible in the base type theory of http://planetmath.org/node/87533Chapter 1. Higher inductive types are also very useful when we study sets with algebraic structure.
As a running example in this section, we consider groups, which are familiar to most mathematicians and exhibit the essential phenomena (and will be needed in later chapters). However, most of what we say applies equally well to any sort of algebraic structure.
Definition 6.11.1.
A monoid is a set together with
-
•
a multiplication function , written infix as ; and
-
•
a unit element ; such that
-
•
for any , we have and ; and
-
•
for any , we have .
A group is a monoid together with
-
•
an inversion function , written ; such that
-
•
for any we have and .
Remark 6.11.2.
Note that we require a group to be a set. We could consider a more general notion of “-group” which is not a set, but this would take us further afield than is appropriate at the moment. With our current definition, we may expect the resulting “group theory” to behave similarly to the way it does in set-theoretic mathematics (with the caveat that, unless we assume , it will be “constructive” group theory).
Example 6.11.3.
The natural numbers are a monoid under addition, with unit , and also under multiplication, with unit . If we define the arithmetical operations on the integers in the obvious way, then as usual they are a group under addition and a monoid under multiplication (and, of course, a ring). For instance, if are represented by and , respectively, then is represented by , is represented by , and is represented by .
Example 6.11.4.
We essentially observed in §2.1 (http://planetmath.org/21typesarehighergroupoids) that if is a pointed type, then its loop space has all the structure of a group, except that it is not in general a set. It should be an “-group” in the sense mentioned in Remark 6.11.2 (http://planetmath.org/611algebra#Thmprermk1), but we can also make it a group by truncation. Specifically, we define the fundamental group of based at to be
This inherits a group structure; for instance, the multiplication is defined by double induction on truncation from the concatenation of paths.
More generally, the homotopy group of is . Then for , so it is also a group. (When , we have , which is not a group.) Moreover, the Eckmann–Hilton argument (Remark 1 (http://planetmath.org/21typesarehighergroupoids#Thmrmk1)) implies that if , then is an abelian group, i.e. we have for all . http://planetmath.org/node/87582Chapter 8 will be largely the study of these groups.
One important notion in group theory is that of the free group generated by a set, or more generally of a group presented by generators and relations. It is well-known in type theory that some free algebraic objects can be defined using ordinary inductive types. For instance, the free monoid on a set can be identified with the type of finite lists of elements of , which is inductively generated by
-
•
a constructor , and
-
•
for each and , an element .
We have an obvious inclusion defined by . The monoid operation on is concatenation, defined recursively by
It is straightforward to prove, using the induction principle for , that is a set and that concatenation of lists is associative and has as a unit. Thus, is a monoid.
Lemma 6.11.5.
For any set , the type is the free monoid on . In other words, for any monoid , composition with is an equivalence
where denotes the set of monoid homomorphisms (functions which preserve the multiplication and unit).
Proof.
Given , we define by recursion:
It is straightforward to prove by induction that is a monoid homomorphism, and that is a quasi-inverse of ; see http://planetmath.org/node/87876Exercise 6.8. ∎
This construction of the free monoid is possible essentially because elements of the free monoid have computable canonical forms (namely, finite lists). However, elements of other free (and presented) algebraic structures — such as groups — do not in general have computable canonical forms. For instance, equality of words in group presentations is algorithmically undecidable. However, we can still describe free algebraic objects as higher inductive types, by simply asserting all the axiomatic equations as path constructors.
For example, let be a set, and define a higher inductive type with the following generators.
-
•
A function .
-
•
A function .
-
•
An element .
-
•
A function .
-
•
For each , an equality .
-
•
For each , equalities and .
-
•
For each , equalities and .
-
•
The -truncation constructor: for any and , we have .
The first constructor says that maps to . The next three give the operations of a group: multiplication, an identity element, and inversion. The three constructors after that assert the axioms of a group: associativity, unitality, and inverses. Finally, the last constructor asserts that is a set.
Therefore, is a group. It is also straightforward to prove:
Theorem 6.11.6.
is the free group on . In other words, for any (set) group , composition with determines an equivalence
where denotes the set of group homomorphisms between two groups.
Proof.
The recursion principle of the higher inductive type says precisely that if is a group and we have , then we have . Its computation rules say that , and that is a group homomorphism. Thus, has a right inverse. It is straightforward to use the induction principle of to show that this is also a left inverse. ∎
It is worth taking a step back to consider what we have just done. We have proven that the free group on any set exists without giving an explicit construction of it. Essentially all we had to do was write down the universal property that it should satisfy. In set theory, we could achieve a similar result by appealing to black boxes such as the adjoint functor theorem; type theory builds such constructions into the foundations of mathematics.
Of course, it is sometimes also useful to have a concrete description of free algebraic structures. In the case of free groups, we can provide one, using quotients. Consider , where in we write as , and as (intended to stand for the formal inverse of ). The elements of are words for the free group on .
Theorem 6.11.7.
Let be a set, and let be the set-quotient of by the following relations.
Then is also the free group on the set .
Proof.
First we show that is a group. We have seen that is a monoid; we claim that the monoid structure descends to the quotient. We define by double quotient recursion; it suffices to check that the equivalence relation generated by the given relations is preserved by concatenation of lists. Similarly, we prove the associativity and unit laws by quotient induction.
In order to define inverses in , we first define by recursion on lists:
Now we define by quotient recursion, acting on a list by switching the two copies of and reversing the list. This preserves the relations, hence descends to the quotient. And we can prove that for by induction. First, quotient induction allows us to assume comes from , and then we can do list induction:
(by the inductive hypothesis) |
(We have omitted a number of fairly evident lemmas about the behavior of concatenation of lists, etc.)
This completes the proof that is a group. Now if is any group with a function , we can define to be on the first copy of and composed with the inversion map of on the second copy. Now the fact that is a monoid yields a monoid homomorphism . And since is a group, this map respects the relations, hence descends to a map . It is straightforward to prove that this is a group homomorphism, and the unique one which restricts to on . ∎
If has decidable equality (such as if we assume excluded middle), then the quotient defining can be obtained from an idempotent as in Lemma 6.10.8 (http://planetmath.org/610quotients#Thmprelem3). We define a word, which we recall is just an element of , to be reduced if it contains no adjacent pairs of the form or . When has decidable equality, it is straightforward to define the reduction of a word, which is an idempotent generating the appropriate quotient; we leave the details to the reader.
If , which has decidable equality, a reduced word must consist either entirely of ’s or entirely of ’s. Thus, the free group on is equivalent to the integers , with corresponding to , the positive integer corresponding to a reduced word of ’s, and the negative integer corresponding to a reduced word of ’s. One could also, of course, show directly that has the universal property of .
Remark 6.11.8.
Nowhere in the construction of and , and the proof of their universal properties, did we use the assumption that is a set. Thus, we can actually construct the free group on an arbitrary type. Comparing universal properties, we conclude that .
We can also use higher inductive types to construct colimits of algebraic objects. For instance, suppose and are group homomorphisms. Their pushout in the category of groups, called the amalgamated free product , can be constructed as the higher inductive type generated by
-
•
Functions and .
-
•
The operations and axioms of a group, as in the definition of .
-
•
Axioms asserting that and are group homomorphisms.
-
•
For , we have .
-
•
The -truncation constructor.
On the other hand, it can also be constructed explicitly, as the set-quotient of by the following relations:
for | ||||
for | ||||
for . |
We leave the proofs to the reader. In the special case that is the trivial group, the last relation is unnecessary, and we obtain the free product , the coproduct in the category of groups. (This notation unfortunately clashes with that for the join of types, as in §6.8 (http://planetmath.org/68pushouts), but context generally disambiguates.)
Note that groups defined by presentations can be regarded as a special case of colimits. Suppose given a set (or more generally a type) , and a pair of functions . We regard as the type of “relations”, with the two functions assigning to each relation the two words that it sets equal. For instance, in the presentation we would have and , with the two morphisms picking out the list and the empty list , respectively. Then by the universal property of free groups, we obtain a pair of group homomorphisms . Their coequalizer in the category of groups, which can be built just like the pushout, is the group presented by this presentation.
Note that all these sorts of construction only apply to algebraic theories, which are theories whose axioms are (universally quantified) equations referring to variables, constants, and operations from a given signature. They can be modified to apply also to what are called essentially algebraic theories: those whose operations are partially defined on a domain specified by equalities between previous operations. They do not apply, for instance, to the theory of fields, in which the “inversion” operation is partially defined on a domain specified by an apartness between previous operations, see Theorem 11.2.4 (http://planetmath.org/1122dedekindrealsarecauchycomplete#Thmprethm1). And indeed, it is well-known that the category of fields has no initial object.
On the other hand, these constructions do apply just as well to infinitary algebraic theories, whose “operations” can take infinitely many inputs. In such cases, there may not be any presentation of free algebras or colimits of algebras as a simple quotient, unless we assume the axiom of choice. This means that higher inductive types represent a significant strengthening of constructive type theory (not necessarily in terms of proof-theoretic strength, but in terms of practical power), and indeed are stronger in some ways than Zermelo–Fraenkel set theory (without choice).
Title | 6.11 Algebra |
---|---|
\metatable |