Evanalysis
7.1Embedded interactionEstimated reading time: 17 min

7.1-7.2 Binary operations, monoids, and groups

Move from bare sets to sets with operations, then study monoids, identity elements, groups, inverses, the socks-shoes law, and cancellation.

Course contents

MATH1090: Set theory

Rigorous course notes on logic, sets, number construction, the real numbers, limits, cardinality, and the first algebraic structures, written in linked sections with careful proofs and examples.

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 5+dog5 + dog 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:

  1. start with a set;
  2. specify some operation, relation, function, or distinguished element on that set;
  3. state axioms that this extra data must satisfy;
  4. 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 XX be a set. A binary operation on XX is a function

:X×XX.*:X\times X\to X.

For a,bXa,b\in X, we usually write aba*b instead of (a,b)*(a,b).

There are two important parts to this definition.

First, the operation takes two inputs from XX. Second, the output must again belong to XX. That second requirement is often called closure, although in this course it is already built into the function type X×XXX\times X\to X.

Common mistake

A formula is not automatically a binary operation on every set

Subtraction is a binary operation on ZZ, because abZa-b\in Z whenever a,bZa,b\in Z. But subtraction is not a binary operation on NN if NN is required to stay closed under the operation, because 252-5 is not a natural number.

Boolean integers

Define

B={0,1}.B=\{0,1\}.

On this set, addition is given by

0+0=0,0+1=1,1+0=1,1+1=0,0+0=0,\qquad 0+1=1,\qquad 1+0=1,\qquad 1+1=0,

and multiplication is given by

00=0,01=0,10=0,11=1.0\cdot 0=0,\qquad 0\cdot 1=0,\qquad 1\cdot 0=0,\qquad 1\cdot 1=1.

Definition

Boolean integers

The Boolean integers are the triple

(B,+,),(B,+,\cdot),

where B={0,1}B=\{0,1\} and ++, \cdot 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 x+y=0x+y=0 in BB

A useful exercise is to prove

xB, yB (x+y=0).\forall x\in B,\ \exists y\in B\ (x+y=0).

Check the two possible values of x.

If x=0x=0, choose y=0y=0, since 0+0=00+0=0.

If x=1x=1, choose y=1y=1, since 1+1=01+1=0.

Thus every element of BB has an additive inverse with respect to this addition rule.

More examples of binary operations

The familiar examples are:

  • ++ and ×\times are binary operations on NN;
  • ++ and ×\times are binary operations on ZZ;
  • for any set XX, composition is a binary operation on the set XXX^X of all functions XXX\to X.

The last example is worth reading carefully. If f:XXf:X\to X and g:XXg:X\to X, then

gf:XX.g\circ f:X\to X.

So composition combines two elements of XXX^X and returns another element of XXX^X.

Worked example

Composition as a binary operation

Let X={a,b}X=\{a,b\}. An element of XXX^X is a function from XX to itself.

If f,gXXf,g\in X^X, then gfg\circ f is again a function from XX to itself. Hence composition defines

:XX×XXXX.\circ:X^X\times X^X\to X^X.

The elements being combined are functions, not elements of XX.

Monoids

The first structure studied in Chapter 7 is a monoid.

Definition

Monoid

A monoid (M,)(M,*) is a set MM together with a binary operation

:M×MM*:M\times M\to M

such that:

  • for all a,b,cMa,b,c\in M,

    (ab)c=a(bc)(a*b)*c=a*(b*c)

    (associativity);

  • there exists eMe\in M such that for all aMa\in M,

    ae=ea=aa*e=e*a=a

    (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:

  • (N,+)(N,+) is a monoid with identity 0;
  • (N,×)(N,\times) is a monoid with identity 1;
  • (Z,+)(Z,+) is a monoid with identity 0;
  • (Z,×)(Z,\times) is a monoid with identity 1;
  • for any set XX, XXX^X under composition is a monoid with identity idXid_X;
  • (B,+)(B,+) is a monoid;
  • (B,)(B,\cdot) is a monoid.

Worked example

Checking that (N,+)(N,+) is a monoid

The operation ++ is a binary operation on NN.

Associativity holds:

(a+b)+c=a+(b+c)(a+b)+c=a+(b+c)

for all natural numbers a,b,c.

The identity is 0, because

a+0=0+a=a.a+0=0+a=a.

Therefore (N,+)(N,+) is a monoid.

Worked example

Checking the composition monoid

Let XX be any set. The elements of XXX^X are functions XXX\to X.

Composition is associative:

(hg)f=h(gf).(h\circ g)\circ f=h\circ(g\circ f).

The identity function idXid_X satisfies

fidX=f,idXf=f.f\circ id_X=f,\qquad id_X\circ f=f.

Therefore XXX^X under composition is a monoid.

Non-examples of monoids

It is just as important to see operations that fail the definition.

Worked example

(Z+,+)(Z^+,+) is not a monoid

If Z+Z^+ denotes the positive integers, then addition is closed and associative. But there is no identity element inside Z+Z^+.

The additive identity would have to be 0, because a+0=aa+0=a. But 0Z+0\notin Z^+. So (Z+,+)(Z^+,+) is not a monoid.

Worked example

(Z,)(Z,-) is not a monoid

Subtraction is a binary operation on ZZ, but it is not associative. For example,

(53)1=1,(5-3)-1=1,

while

5(31)=3.5-(3-1)=3.

Since these are not equal, associativity fails. Therefore (Z,)(Z,-) 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 GG equipped with an element eGe\in G and a binary operation

(a,b)ab(a,b)\longmapsto a\cdot b

such that:

  • for all aGa\in G,

    ea=a=ae;e\cdot a=a=a\cdot e;
  • for all a,b,cGa,b,c\in G,

    (ab)c=a(bc);(a\cdot b)\cdot c=a\cdot(b\cdot c);
  • for every aGa\in G, there exists an inverse element a1Ga^{-1}\in G satisfying

    aa1=eanda1a=e.a\cdot a^{-1}=e \qquad\text{and}\qquad a^{-1}\cdot a=e.

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:

  • (Z,+)(Z,+);
  • (Q,+)(Q,+);
  • (Q+,)(Q^+,\cdot), where Q+Q^+ denotes the positive rationals.

Worked example

Why (Z,+)(Z,+) is a group

The identity element is 0.

For every integer a, the inverse is a-a, since

a+(a)=0=(a)+a.a+(-a)=0=(-a)+a.

Addition is associative, so (Z,+)(Z,+) is a group.

Worked example

Why (Q+,)(Q^+,\cdot) 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

q1q=1=1qq.q\cdot \frac1q=1=\frac1q\cdot q.

Multiplication is associative, so (Q+,)(Q^+,\cdot) is a group.

Common mistake

(Z,×)(Z,\times) is a monoid but not a group

The identity for multiplication on ZZ is 1, and multiplication is associative. But most integers do not have multiplicative inverses in ZZ. For example, there is no integer b such that 2b=12b=1.

Uniqueness of inverses

Theorem

Uniqueness of inverses

For each aGa\in G, the inverse a1a^{-1} is unique.

Proof

Proof

The proof shows why inverse notation is legitimate. If an inverse exists, there is only one such element, so writing a1a^{-1} 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,

(ab)1=b1a1.(a*b)^{-1}=b^{-1}*a^{-1}.

Proof

Proof

The order reversal is essential. In a non-commutative group, a1b1a^{-1}*b^{-1} need not undo aba*b.

Cancellation laws

Theorem

Cancellation laws

In a group:

  • if ab=aca*b=a*c, then b=cb=c;
  • if ba=cab*a=c*a, then b=cb=c.

Proof

Left cancellation

The proof of right cancellation is analogous, multiplying on the right by a1a^{-1}.

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.

A law table comparing monoids and groups

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 XX?

State the input and output requirement.

Solution

Answer

Quick check

Why is (Z,)(Z,-) not a monoid?

Name the failed axiom and give a concrete calculation.

Solution

Answer

Quick check

Why is (Z,×)(Z,\times) not a group?

Focus on inverses.

Solution

Answer

Quick check

What is the inverse of aba*b in a group?

Pay attention to the order.

Solution

Answer

Exercises

Quick check

Show directly that (B,+)(B,+) 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 ab=aca*b=a*c, then b=cb=c.

Use the inverse of a.

Solution

Guided solution

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.