Chapter 7 begins with a change in viewpoint.
Set theory lets us compare sets by functions, relations, and cardinalities. But many mathematical objects are not interesting merely because of which elements they contain. They are interesting because the set carries extra structure.
For example, from the point of view of bare cardinality, the set {5, dog} and
the set {0,1} both have two elements. But {0,1} also supports familiar
operations such as addition and multiplication modulo 2, while is
not meaningful unless extra structure has been specified.
The point of this chapter is to make that extra structure explicit.
Sets with structure
Many mathematical objects can be read as sets with additional data: natural numbers with addition and multiplication, the plane with vector addition, and permutations with composition.
The common pattern is:
- start with a set;
- specify some operation, relation, function, or distinguished element on that set;
- state axioms that this extra data must satisfy;
- prove theorems from those axioms.
This is one of the central habits of modern mathematics. Instead of proving the same fact separately for many examples, define a structure once and prove what all examples of that structure must satisfy.
Binary operations
Definition
Binary operation
Let be a set. A binary operation on is a function
For , we usually write instead of .
There are two important parts to this definition.
First, the operation takes two inputs from . Second, the output must again belong to . That second requirement is often called closure, although in this course it is already built into the function type .
Common mistake
A formula is not automatically a binary operation on every set
Subtraction is a binary operation on , because whenever . But subtraction is not a binary operation on if is required to stay closed under the operation, because is not a natural number.
Boolean integers
Define
On this set, addition is given by
and multiplication is given by
Definition
Boolean integers
The Boolean integers are the triple
where and , are the two binary operations displayed above.
The main point is not the name. The point is that a small set can carry nontrivial structure once operations are specified.
Worked example
Solving in
A useful exercise is to prove
Check the two possible values of x.
If , choose , since .
If , choose , since .
Thus every element of has an additive inverse with respect to this addition rule.
More examples of binary operations
The familiar examples are:
- and are binary operations on ;
- and are binary operations on ;
- for any set , composition is a binary operation on the set of all functions .
The last example is worth reading carefully. If and , then
So composition combines two elements of and returns another element of .
Worked example
Composition as a binary operation
Let . An element of is a function from to itself.
If , then is again a function from to itself. Hence composition defines
The elements being combined are functions, not elements of .
Monoids
The first structure studied in Chapter 7 is a monoid.
Definition
Monoid
A monoid is a set together with a binary operation
such that:
-
for all ,
(associativity);
-
there exists such that for all ,
(existence of an identity element).
Associativity tells us that parentheses do not matter when multiplying three elements in a row. The identity element tells us that there is an element that does nothing when combined on either side.
The standard examples are:
- is a monoid with identity
0; - is a monoid with identity
1; - is a monoid with identity
0; - is a monoid with identity
1; - for any set , under composition is a monoid with identity ;
- is a monoid;
- is a monoid.
Worked example
Checking that is a monoid
The operation is a binary operation on .
Associativity holds:
for all natural numbers a,b,c.
The identity is 0, because
Therefore is a monoid.
Worked example
Checking the composition monoid
Let be any set. The elements of are functions .
Composition is associative:
The identity function satisfies
Therefore under composition is a monoid.
Non-examples of monoids
It is just as important to see operations that fail the definition.
Worked example
is not a monoid
If denotes the positive integers, then addition is closed and associative. But there is no identity element inside .
The additive identity would have to be 0, because . But .
So is not a monoid.
Worked example
is not a monoid
Subtraction is a binary operation on , but it is not associative. For example,
while
Since these are not equal, associativity fails. Therefore is not a monoid.
Common mistake
Having an identity is not enough
An operation can have a plausible identity and still fail to be a monoid if it is not associative. Associativity and identity are separate requirements.
The identity element is unique
Theorem
Uniqueness of identity
A monoid has exactly one identity element.
Proof
Proof
The proof is short because the identity law works on both sides. Each identity must leave the other one unchanged, forcing them to be equal.
Groups
Monoids are useful but weak. A group adds the requirement that every element can be undone.
Definition
Group
A group is a set equipped with an element and a binary operation
such that:
-
for all ,
-
for all ,
-
for every , there exists an inverse element satisfying
Groups are a natural way to formalize symmetry. A symmetry operation should be composable, have a do-nothing operation, and be reversible.
Under this standard reading, every group is a monoid after forgetting the inverse axiom. What makes a group stronger is not a different identity or a different associativity law, but the existence of inverses.
Common mistake
A group is not just any set with a binary operation
The operation must be associative, there must be a two-sided identity, and every element must have an inverse. If any one of these fails, the structure is not a group.
Examples of groups
The basic examples are:
- ;
- ;
- , where denotes the positive rationals.
Worked example
Why is a group
The identity element is 0.
For every integer a, the inverse is , since
Addition is associative, so is a group.
Worked example
Why is a group
The identity element is 1.
For every positive rational q, the inverse is 1/q, which is again a positive
rational. Then
Multiplication is associative, so is a group.
Common mistake
is a monoid but not a group
The identity for multiplication on is 1, and multiplication is
associative. But most integers do not have multiplicative inverses in .
For example, there is no integer b such that .
Uniqueness of inverses
Theorem
Uniqueness of inverses
For each , the inverse is unique.
Proof
Proof
The proof shows why inverse notation is legitimate. If an inverse exists, there is only one such element, so writing is unambiguous.
Socks-shoes property
The inverse-of-a-product rule is often called the socks-shoes property: to undo two operations, undo the second one first.
Theorem
Socks-shoes property
For elements a,b in a group,
Proof
Proof
The order reversal is essential. In a non-commutative group, need not undo .
Cancellation laws
Theorem
Cancellation laws
In a group:
- if , then ;
- if , then .
Proof
Left cancellation
The proof of right cancellation is analogous, multiplying on the right by .
Check laws interactively
The checker below is a support tool for the definitions: use it to test closure, associativity, identity, and inverse behavior for small operation tables. The mathematics remains the axioms above.

Figure. The distinction between monoid and group is not a naming convention: it is controlled by identity and inverse laws in addition to associativity.
Read and try
Check monoid and group laws
The checker compares binary operations by the exact laws needed for monoids and groups.
This is a group.
Associative
Yes
(a+b)+c = a+(b+c).
Identity
Yes
0 is the identity.
Inverse
Yes
The inverse of a is -a.
Quick checks
Quick check
What must be true for a rule to be a binary operation on a set ?
State the input and output requirement.
Solution
Answer
Quick check
Why is not a monoid?
Name the failed axiom and give a concrete calculation.
Solution
Answer
Quick check
Why is not a group?
Focus on inverses.
Solution
Answer
Quick check
What is the inverse of in a group?
Pay attention to the order.
Solution
Answer
Exercises
Quick check
Show directly that is a monoid using the Boolean addition rule above.
Check associativity and identify the identity.
Solution
Guided solution
Quick check
Prove that the identity element in a monoid is unique.
Use two possible identities e and e'.
Solution
Guided solution
Quick check
Prove left cancellation in a group: if , then .
Use the inverse of a.
Solution
Guided solution
Related notes
Read this after 2.2 Functions and relations and 6.4-6.7 Intervals, Cantor set, density, and well-ordering. It also uses proof habits from 1.2 Quantifiers and negation and 3.4 Rationals and well-defined operations.