Book 2A

© 2026 NeckPinch · www.neckpinch.com · All rights reserved.

Course 2Book 2A: Numbers, Limits and the IntegralChapter 2

Sets, Functions and Equivalence

The language of sets and maps, and quotients: treating different things as the same.

32 min read · Updated Oct 2, 2026

Read with Tao, Analysis I, chapter "Set theory" (fundamentals, Russell's paradox, functions, images and inverse images, Cartesian products). Its last section, on cardinality, is the subject of [[2A.8]].

In this chapter · 6 sections
  1. 2.1Sets
  2. 2.1.1Which sets exist
  3. 2.1.2Operations on sets
  4. 2.2Functions
  5. 2.2.1Injective, surjective, bijective
  6. 2.3Images and preimages
  7. 2.4Cartesian products and relations
  8. 2.5Equivalence relations and quotients
  9. 2.5.1Functions on a quotient must be well defined
  10. 2.5.2Equivalence is a strong requirement
  11. 2.6Exercises

The previous chapter built the natural numbers and nothing else. Before building any other numbers we need a language for collections of things and for rules that turn one thing into another: sets and functions. Almost every definition from here to Perelman is written in this language. A Riemannian metric is a function, a manifold is a set with extra structure, and the space of all metrics is a set of functions.

This chapter also introduces the idea that does the most work in the next two chapters, and keeps doing work until the end of the route: equivalence relations and quotients. They are the precise way of saying "treat these different things as the same". The integers, the rationals and the real numbers are all built as quotients. So is the circle, the lens spaces of topology, and, at the very end, the space in which Ricci flow really lives: metrics up to a change of coordinates.

By the end of this chapter you will be able to:

  • work with sets, subsets and the operations on them, and prove set identities;
  • say exactly what a function is, and when two functions are equal;
  • decide whether a function is injective, surjective or bijective, and invert a bijection;
  • compute images and preimages, and explain why preimages behave better;
  • define an equivalence relation, describe its classes, form the quotient set, and check that a function on a quotient is well defined.

Sets

A set is a collection of objects, called its elements. We write x∈Ax \in A when xx is an element of AA, and x∉Ax \notin A when it isn't. A set is completely determined by its elements: two sets are equal exactly when they have the same elements. So {1,2,3}\{1, 2, 3\}, {3,2,1}\{3, 2, 1\} and {1,1,2,3}\{1, 1, 2, 3\} are the same set. Order and repetition don't matter, only membership.

Definition 2.1 Subsets

A set AA is a subset of a set BB, written A⊆BA \subseteq B, if every element of AA is also an element of BB. It is a proper subset, written A⊊BA \subsetneq B, if in addition A≠BA \neq B.

Equality of sets is then the same as inclusion both ways: A=BA = B if and only if A⊆BA \subseteq B and B⊆AB \subseteq A. This is how almost every set identity is proved. To show two sets are equal, take an arbitrary element of one, show it lies in the other, and then do the same in the other direction.

Which sets exist

To build sets we need some agreed ways of making them. Tao lists them as axioms, and the ones we use constantly are these.1 These are, in slightly informal form, the axioms of Zermelo–Fraenkel set theory, the standard foundation of modern mathematics. You don't need to memorise them; you need to know that every set used in this guidebook is built by them.

  • There is an empty set ∅\varnothing with no elements.
  • For any objects aa and bb there are the sets {a}\{a\} and {a,b}\{a, b\}.
  • For any sets AA and BB there is the union A∪BA \cup B, whose elements are those that lie in AA or in BB (or both).
  • Specification. For any set AA and any property P(x)P(x), there is a set {x∈A:P(x)}\{x \in A : P(x)\} of the elements of AA that have the property.
  • Replacement. For any set AA and any rule assigning an object f(x)f(x) to each x∈Ax \in A, there is a set {f(x):x∈A}\{f(x) : x \in A\}.
  • Infinity. The natural numbers N\mathbb{N} form a set.
  • Power set. For any set AA there is the set of all its subsets.

The specification axiom deserves attention because of what it does not allow. It lets you carve a subset out of a set you already have. It does not let you form "the set of all xx with property PP" with no ambient set, and the reason is one of the most famous arguments in mathematics.

History Russell's paradox

Suppose any property defined a set. Consider the property "xx is a set that is not an element of itself", and let RR be the set of all such xx. Is RR an element of itself? If R∈RR \in R, then RR has the defining property, so R∉RR \notin R. If R∉RR \notin R, then RR has the property, so R∈RR \in R. Either way, a contradiction.

Bertrand Russell found this in 1901 and wrote to Gottlob Frege in 1902, just as the second volume of Frege's Grundgesetze der Arithmetik was going to press. Frege's system, an attempt to found arithmetic on logic, allowed exactly this kind of unrestricted set formation, and the paradox showed it was inconsistent. He added an appendix acknowledging the problem. The modern response is the axioms above, which only ever build sets out of sets already in hand.

Operations on sets

Definition 2.2 Union, intersection, difference

Let AA and BB be sets.

  • The intersection A∩B={x∈A:x∈B}A \cap B = \{x \in A : x \in B\} consists of the elements in both.
  • The difference A∖B={x∈A:x∉B}A \setminus B = \{x \in A : x \notin B\} consists of the elements of AA not in BB.
  • AA and BB are disjoint if A∩B=∅A \cap B = \varnothing.

When all the sets in a discussion are subsets of one fixed set XX, the difference X∖AX \setminus A is called the complement of AA (in XX), written AcA^c.

Figure 2.1. The four basic operations. Venn diagrams are good for intuition, but they are not proofs: a proof works with elements.

These operations obey a long list of laws: union and intersection are commutative and associative, each distributes over the other, and so on. They are all proved the same way, element by element. Here is the most useful pair in full.

Proposition 2.3 De Morgan's laws

Let AA and BB be subsets of a set XX. Then

(A∪B)c=Ac∩Bcand(A∩B)c=Ac∪Bc.(A \cup B)^c = A^c \cap B^c \qquad\text{and}\qquad (A \cap B)^c = A^c \cup B^c.

More generally, for any family of subsets AαA_\alpha of XX, indexed by α\alpha in some set II,

(⋃α∈IAα)c=⋂α∈IAαcand(⋂α∈IAα)c=⋃α∈IAαc.\Big(\bigcup_{\alpha \in I} A_\alpha\Big)^c = \bigcap_{\alpha \in I} A_\alpha^c \qquad\text{and}\qquad \Big(\bigcap_{\alpha \in I} A_\alpha\Big)^c = \bigcup_{\alpha \in I} A_\alpha^c.

Proof. We prove the first law for a family; the others are the same argument. Let x∈Xx \in X. Then xx lies in the left-hand side exactly when xx is not in ⋃αAα\bigcup_\alpha A_\alpha, that is, when there is no α\alpha with x∈Aαx \in A_\alpha. That says x∉Aαx \notin A_\alpha for every α\alpha, which means x∈Aαcx \in A_\alpha^c for every α\alpha, which is membership of the right-hand side. Each step is an "if and only if", so the two sets have the same elements.

Notice the logic inside the proof: "not (there exists α\alpha with …)" became "for every α\alpha, not …". De Morgan's laws for sets are the rules for negating "there exists" and "for all". Chapter 2A.5 Quantifiers and the Shape of a Proof makes that rule a central skill.

Functions

Informally, a function from XX to YY is a rule that takes each element of XX and returns an element of YY. The precise definition makes three things part of the data: where inputs come from, where outputs land, and the rule.

Definition 2.4 Function

Let XX and YY be sets. A function f:X→Yf : X \to Y assigns to every x∈Xx \in X exactly one element f(x)∈Yf(x) \in Y. The set XX is the domain of ff, and YY is its codomain. Two functions f,g:X→Yf, g : X \to Y are equal if f(x)=g(x)f(x) = g(x) for every x∈Xx \in X.

Three consequences of the definition catch people out.

  • Every input gets an output. "f(x)=1/xf(x) = 1/x from R\mathbb{R} to R\mathbb{R}" is not a function, because 00 gets nothing. It becomes one if the domain is R∖{0}\mathbb{R} \setminus \{0\}.
  • Exactly one output. "$f(y) = $ the number whose square is yy" is not a function on the positive reals, because 44 has two square roots. Choosing one ("the positive square root") makes it a function.
  • Equality is about values, not formulas. f(x)=x2−1f(x) = x^2 - 1 and g(x)=(x−1)(x+1)g(x) = (x - 1)(x + 1) are the same function. On the other hand, x↦x2x \mapsto x^2 as a function R→R\mathbb{R} \to \mathbb{R} and as a function R→[0,∞)\mathbb{R} \to [0, \infty) are, strictly speaking, different functions, because their codomains differ. That distinction matters for surjectivity, below.

One way to make "a rule" precise, using only sets, is through the function's graph, the set of pairs {(x,f(x)):x∈X}\{(x, f(x)) : x \in X\}. A function is its graph: a set of pairs in which every x∈Xx \in X appears as a first entry exactly once. Pairs need one more construction, the Cartesian product, which comes later in this chapter.

Composition. If f:X→Yf : X \to Y and g:Y→Zg : Y \to Z, the composition g∘f:X→Zg \circ f : X \to Z is x↦g(f(x))x \mapsto g(f(x)). Composition is associative, h∘(g∘f)=(h∘g)∘fh \circ (g \circ f) = (h \circ g) \circ f, because both send xx to h(g(f(x)))h(g(f(x))). It is not commutative: putting on socks and then shoes is not the same as shoes then socks.

Injective, surjective, bijective

Definition 2.5 Injective, surjective, bijective

A function f:X→Yf : X \to Y is

  • injective (one-to-one) if different inputs give different outputs: x≠x′x \neq x' implies f(x)≠f(x′)f(x) \neq f(x');
  • surjective (onto) if every element of YY is an output: for every y∈Yy \in Y there is some x∈Xx \in X with f(x)=yf(x) = y;
  • bijective if it is both.

You met injectivity already: 2A.1 The Natural Numbers's Axiom 1.4 says exactly that the successor map n↦n++n \mapsto n{+}{+} is injective. Together with Axiom 1.3 (00 is not a successor), it says that the successor map from N\mathbb{N} to N\mathbb{N} is injective but not surjective.

Figure 2.2. The four possibilities. Injective: no two arrows land on the same point. Surjective: every point of YY is hit. Bijective: both, so the arrows pair XX and YY off exactly.
Proposition 2.6 Inverses

A function f:X→Yf : X \to Y is bijective if and only if there is a function g:Y→Xg : Y \to X with g(f(x))=xg(f(x)) = x for every x∈Xx \in X and f(g(y))=yf(g(y)) = y for every y∈Yy \in Y. Such a gg is unique; it is the inverse of ff, written f−1f^{-1}.

Proof. If ff is bijective, then for each y∈Yy \in Y there is some xx with f(x)=yf(x) = y (surjectivity), and only one (injectivity). Define g(y)g(y) to be that xx. Then f(g(y))=yf(g(y)) = y by construction, and g(f(x))=xg(f(x)) = x because xx is the unique input sent to f(x)f(x).

Conversely, suppose such a gg exists. If f(x)=f(x′)f(x) = f(x'), apply gg: x=g(f(x))=g(f(x′))=x′x = g(f(x)) = g(f(x')) = x', so ff is injective. Given y∈Yy \in Y, the element x=g(y)x = g(y) satisfies f(x)=yf(x) = y, so ff is surjective.

For uniqueness, if gg and hh both work, then for every yy, g(y)=g(f(h(y)))=h(y)g(y) = g(f(h(y))) = h(y), using f(h(y))=yf(h(y)) = y and then g(f(x))=xg(f(x)) = x with x=h(y)x = h(y).

In the world In use Hashing: a function that can't be injective

A hash function turns any file, of any length, into a short fixed-length string. SHA-256, for example, outputs 256 bits, and it is used to check downloads, sign software and chain blocks together in cryptocurrencies. There are infinitely many possible inputs and only 22562^{256} possible outputs, so SHA-256 cannot be injective: some pair of different files must have the same hash (a collision). This is the pigeonhole principle: a function from a larger set into a smaller one can't be injective.

The security of a hash function rests not on injectivity, which is impossible, but on collisions being infeasible to find. When that fails, the function is retired. In 2017 a team from CWI Amsterdam and Google published the first practical collision for the older SHA-1, two different PDF files with the same SHA-1 hash, and SHA-1 has since been phased out of security-critical uses.

In the world In use Ciphers are bijections

An encryption scheme must be decryptable, so encryption with a fixed key must be injective. The simplest example is the Caesar shift on the alphabet, x↦x+3x \mapsto x + 3 with letters numbered 00 to 2525 and wrapping round after 2525 (exactly the clock arithmetic of 2A.1 The Natural Numbers). Its inverse is x↦x−3x \mapsto x - 3. Modern block ciphers such as AES are, for each key, bijections on the set of 128-bit blocks. Decryption is the inverse function.

Images and preimages

A function moves sets as well as points. There are two directions, and they behave very differently.

Definition 2.7 Image and preimage

Let f:X→Yf : X \to Y.

  • For S⊆XS \subseteq X, the image of SS is f(S)={f(x):x∈S}f(S) = \{f(x) : x \in S\}, the set of outputs of inputs from SS.
  • For U⊆YU \subseteq Y, the preimage (or inverse image) of UU is f−1(U)={x∈X:f(x)∈U}f^{-1}(U) = \{x \in X : f(x) \in U\}, the set of inputs whose outputs land in UU.

The notation f−1(U)f^{-1}(U) does not require ff to have an inverse. It makes sense for every function. If f(x)=x2f(x) = x^2 on R\mathbb{R}, then f−1({4})={−2,2}f^{-1}(\{4\}) = \{-2, 2\}, f−1({−1})=∅f^{-1}(\{-1\}) = \varnothing, and f−1([1,4])=[−2,−1]∪[1,2]f^{-1}([1, 4]) = [-2, -1] \cup [1, 2].

Preimages respect every set operation. Images don't.

Theorem 2.8 Preimages commute with set operations

Let f:X→Yf : X \to Y, and let U,VU, V and UαU_\alpha (for α∈I\alpha \in I) be subsets of YY. Then

f−1(⋃αUα)=⋃αf−1(Uα),f−1(⋂αUα)=⋂αf−1(Uα),f−1(Y∖U)=X∖f−1(U).f^{-1}\Big(\bigcup_\alpha U_\alpha\Big) = \bigcup_\alpha f^{-1}(U_\alpha), \qquad f^{-1}\Big(\bigcap_\alpha U_\alpha\Big) = \bigcap_\alpha f^{-1}(U_\alpha), \qquad f^{-1}(Y \setminus U) = X \setminus f^{-1}(U).

Proof. For the union: x∈f−1(⋃αUα)x \in f^{-1}(\bigcup_\alpha U_\alpha) means f(x)∈Uαf(x) \in U_\alpha for some α\alpha, which means x∈f−1(Uα)x \in f^{-1}(U_\alpha) for some α\alpha, which is membership of the right-hand side. The intersection is the same with "some" replaced by "every". For the complement: x∈f−1(Y∖U)x \in f^{-1}(Y \setminus U) means f(x)∉Uf(x) \notin U, which means x∉f−1(U)x \notin f^{-1}(U).

For images, only the union rule survives: f(S∪T)=f(S)∪f(T)f(S \cup T) = f(S) \cup f(T) always, but in general f(S∩T)⊊f(S)∩f(T)f(S \cap T) \subsetneq f(S) \cap f(T) can happen.

Example 2.9 Images lose information

Let f(x)=x2f(x) = x^2 on R\mathbb{R}, S=[−2,−1]S = [-2, -1] and T=[1,2]T = [1, 2]. Then S∩T=∅S \cap T = \varnothing, so f(S∩T)=∅f(S \cap T) = \varnothing. But f(S)=f(T)=[1,4]f(S) = f(T) = [1, 4], so f(S)∩f(T)=[1,4]f(S) \cap f(T) = [1, 4]. Points from SS and points from TT are sent to the same place, so after applying ff you can no longer tell them apart. If ff is injective this can't happen, and then f(S∩T)=f(S)∩f(T)f(S \cap T) = f(S) \cap f(T) (Exercise 2.20).

Figure 2.3. For f(x)=x2f(x) = x^2, the disjoint sets [−2,−1][-2,-1] and [1,2][1,2] have the same image [1,4][1,4], so the image of their intersection (∅\varnothing) is smaller than the intersection of their images. Read the figure backwards and you see the preimage: f−1([1,4])=[−2,−1]∪[1,2]f^{-1}([1,4]) = [-2,-1] \cup [1,2].
Where this goes Why the guidebook keeps using preimages

Theorem 2.8 looks like a technicality, but it decides how two of the central definitions in analysis are written. A function is continuous when the preimage of every open set is open (7A.1 Topological Spaces and Quotients), and measurable when the preimage of every measurable set is measurable (3A.3 The Lebesgue Integral). Both definitions use preimages because preimages respect unions, intersections and complements, which are the operations that define "open set" and "measurable set" in the first place. Images would not work.

In the world In use Thresholding an image is a preimage

A greyscale photograph is a function bb from the set of pixels to brightness values {0,1,…,255}\{0, 1, \dots, 255\}. "Select every pixel brighter than 200200", the first step in many image-segmentation tools and in counting stars, cells or defects in a picture, is the preimage b−1({201,…,255})b^{-1}(\{201, \dots, 255\}). Theorem 2.8 is why combining selections is easy: "bright or red" is the union of two preimages, "bright and red" is the intersection, and "not bright" is the complement.

Cartesian products and relations

Definition 2.10 Cartesian product

An ordered pair (x,y)(x, y) consists of a first entry xx and a second entry yy; two pairs are equal exactly when their first entries are equal and their second entries are equal. The Cartesian product of sets XX and YY is the set of all ordered pairs X×Y={(x,y):x∈X,y∈Y}X \times Y = \{(x, y) : x \in X, y \in Y\}. Products of more sets, X1×⋯×XnX_1 \times \dots \times X_n, consist of ordered nn-tuples.

So R2=R×R\mathbb{R}^2 = \mathbb{R} \times \mathbb{R} is the plane, and a function f:X→Yf : X \to Y can be identified with its graph, a subset of X×YX \times Y. If XX has mm elements and YY has nn, then X×YX \times Y has m×nm \times n, which is where the word "product" comes from.

Definition 2.11 Relation

A relation on a set XX is a subset R⊆X×XR \subseteq X \times X. We write x∼yx \sim y for (x,y)∈R(x, y) \in R.

"Less than" on N\mathbb{N} is a relation: the set of pairs (m,n)(m, n) with m<nm < n. So is "has the same birthday as" on the set of people.

In the world In use Relational databases store relations

Most of the world's business data sits in relational databases, a design proposed by Edgar F. Codd in 1970. A database table is literally a relation in the sense of Definition 2.10, generalised to more columns: a set of tuples. A CROSS JOIN of two tables is their Cartesian product, and an ordinary join is a subset of that product picked out by a condition, which is the specification axiom in action. Codd built his model directly on this set-theoretic language, which is why queries can be reasoned about mathematically and optimised automatically.

Equivalence relations and quotients

Some relations behave like equality. "Has the same remainder after division by 1212" is one: it treats 33, 1515 and 2727 as the same as far as a clock is concerned. Three properties capture what "behaves like equality" means.

Definition 2.12 Equivalence relation

A relation ∼\sim on a set XX is an equivalence relation if it is

  • reflexive: x∼xx \sim x for every xx;
  • symmetric: if x∼yx \sim y then y∼xy \sim x;
  • transitive: if x∼yx \sim y and y∼zy \sim z then x∼zx \sim z.

The equivalence class of xx is [x]={y∈X:y∼x}[x] = \{y \in X : y \sim x\}, everything equivalent to xx.

Example 2.13 Congruence modulo nn

Fix a positive natural number nn. For integers aa and bb, say a≡b(modn)a \equiv b \pmod n if a−ba - b is a multiple of nn. (We use the integers informally here; they are built properly in 2A.3 Integers and Rationals.) This is an equivalence relation: a−a=0=0⋅na - a = 0 = 0 \cdot n; if a−b=kna - b = kn then b−a=(−k)nb - a = (-k)n; and if a−b=kna - b = kn and b−c=lnb - c = ln then a−c=(k+l)na - c = (k + l)n. There are exactly nn classes, [0],[1],…,[n−1][0], [1], \dots, [n-1], one for each possible remainder, by Euclidean division (2A.1 The Natural Numbers).

The key fact about equivalence classes is that they cut XX into non-overlapping pieces.

Theorem 2.14 Equivalence classes partition the set

Let ∼\sim be an equivalence relation on XX. Then every element of XX lies in exactly one equivalence class. In particular, two classes [x][x] and [y][y] are either equal (when x∼yx \sim y) or disjoint (when x≁yx \not\sim y).

Conversely, any way of cutting XX into non-empty, pairwise disjoint pieces whose union is XX (a partition) comes from exactly one equivalence relation: "x∼yx \sim y when xx and yy are in the same piece".

Proof. Each xx lies in its own class, by reflexivity. Suppose [x][x] and [y][y] share an element zz, so z∼xz \sim x and z∼yz \sim y. By symmetry x∼zx \sim z, and with transitivity x∼yx \sim y. Now if w∈[x]w \in [x], then w∼xw \sim x and x∼yx \sim y give w∼yw \sim y, so w∈[y]w \in [y]; thus [x]⊆[y][x] \subseteq [y], and by the same argument [y]⊆[x][y] \subseteq [x]. So two classes that meet are equal, which is the first claim. The converse is a direct check of the three properties (Exercise 2.22).

Figure 2.4. Congruence modulo 33 on {0,…,11}\{0, \dots, 11\}. Its three equivalence classes are the three remainders, and they partition the set: every number lies in exactly one class.

Now the central construction.

Definition 2.15 Quotient set

Let ∼\sim be an equivalence relation on XX. The quotient set X/∼X/{\sim} is the set of equivalence classes, {[x]:x∈X}\{[x] : x \in X\}. The map π:X→X/∼\pi : X \to X/{\sim}, π(x)=[x]\pi(x) = [x], is the quotient map.

The quotient is a new set whose elements are whole classes. Each class is treated as a single object. The quotient map is always surjective, and it is injective only when ∼\sim is plain equality. It forgets exactly the differences that ∼\sim declares unimportant.

Figure 2.5. The quotient R/Z\mathbb{R}/\mathbb{Z}, where x∼yx \sim y when x−yx - y is an integer. Each class, such as {…,0.25,1.25,2.25,… }\{\dots, 0.25, 1.25, 2.25, \dots\}, becomes one point, and the quotient is naturally pictured as a circle: going once round it means moving one unit along the line.
In the world In use The antimeridian: a quotient that breaks software

Longitude is an angle: −180°-180° and +180°+180° name the same meridian, and so do 10°10° and 370°370°. Mathematically, longitude is a point of the quotient R/360Z\mathbb{R}/360\mathbb{Z}, a circle, not a point of the interval [−180,180][-180, 180]. Software that forgets this breaks at the antimeridian, the line of ±180°\pm 180° through the Pacific. A rectangle that runs from 170°170° E across to 170°170° W (that is, to −170°-170°) is only 20°20° wide. Stored naively as "from 170170 to −170-170", it is drawn as a band 340°340° wide stretching the wrong way round the whole globe. The GeoJSON format, a standard for exchanging map data (IETF RFC 7946, 2016), addresses this explicitly. Its section 3.1.9, Antimeridian Cutting, says that a geometry crossing the antimeridian should be cut in two, so that no piece's coordinates cross it.

Figure 2.6. The same 20°-wide region near the antimeridian, stored naively (top) and cut in two as RFC 7946 recommends (bottom). The underlying mistake is treating a quotient (a circle of longitudes) as if it were an interval.

Functions on a quotient must be well defined

To define a function on a quotient set X/∼X/{\sim}, it is natural to give a formula in terms of a representative: "$F([x]) = $ something computed from xx". That defines a function only if the answer doesn't depend on which representative of the class you used. This condition is called being well defined.

Proposition 2.16 Defining functions on quotients

Let ∼\sim be an equivalence relation on XX, and let f:X→Yf : X \to Y be a function that is constant on each class: x∼x′x \sim x' implies f(x)=f(x′)f(x) = f(x'). Then there is exactly one function F:X/∼→YF : X/{\sim} \to Y with F([x])=f(x)F([x]) = f(x) for every xx, that is, with F∘π=fF \circ \pi = f.

Proof. Define FF on a class CC by choosing any x∈Cx \in C and setting F(C)=f(x)F(C) = f(x). Any other choice x′∈Cx' \in C satisfies x′∼xx' \sim x, so f(x′)=f(x)f(x') = f(x): the value doesn't depend on the choice, and FF is a function. It satisfies F([x])=f(x)F([x]) = f(x) by construction, and any function with that property must agree with FF on every class.

Example 2.17 A formula that isn't a function

On the clock Z/12\mathbb{Z}/12, "F([a])=aF([a]) = a" is not a function into the integers, because [3]=[15][3] = [15] but 3≠153 \neq 15. On the other hand, "G([a])=[a+5]G([a]) = [a + 5]" is a well-defined function Z/12→Z/12\mathbb{Z}/12 \to \mathbb{Z}/12 ("five hours later"): if a≡a′(mod12)a \equiv a' \pmod{12} then a+5≡a′+5(mod12)a + 5 \equiv a' + 5 \pmod{12}.

This is exactly why a clock can tell you what time it will be in five hours, but not how many hours have passed since a given moment. That last quantity isn't a function of the clock reading, which was the recursion problem of 2A.1 The Natural Numbers seen from a new angle.

Where this goes Quotients from here to Ricci flow

The pattern "build a set of representatives, declare an equivalence, check that operations are well defined" is how the next two chapters build numbers. The integers are pairs of naturals modulo an equivalence, and so are the rationals (2A.3 Integers and Rationals); the reals are Cauchy sequences modulo another (2A.4 The Real Numbers). Much later, the circle, tori and lens spaces are quotients of familiar spaces (7A.1 Topological Spaces and Quotients, 7A.6 Covering Spaces), and the 3-manifolds left behind by Ricci flow with surgery are quotients S3/ΓS^3/\Gamma of the sphere. Most striking of all, Ricci flow itself is diffeomorphism-invariant: changing coordinates turns a solution into a solution. So the flow really acts on the quotient set "metrics modulo diffeomorphisms", and much of its theory (DeTurck's trick, 11A.3 Short-Time Existence and Uniqueness; solitons, 11B.1 Ricci Solitons) is about working in that quotient.

Equivalence is a strong requirement

Transitivity is the property most often violated by relations that "feel like" sameness.

In the world In use "Similar enough" is not an equivalence relation

Merging duplicate records, such as customers entered twice under slightly different spellings, is a routine and expensive data-cleaning task. A natural rule is "two names are duplicates if they differ by at most one letter". This relation is reflexive and symmetric but not transitive. "cat" and "cot" differ in one letter, "cot" and "dot" in one, "dot" and "dog" in one, but "cat" and "dog" differ in all three. Merge along the rule and the chain cat–cot–dot–dog collapses into one record, though its two ends have nothing in common. Practical deduplication systems therefore either cluster with a careful threshold or make a final decision for each cluster. Either way, they must turn a non-transitive similarity into a genuine equivalence relation before they can form classes.

Figure 2.7. Each adjacent pair differs in one letter, but the ends differ in three. "Differs in at most one letter" is reflexive and symmetric, not transitive, so it can't be used to form classes. Chapter 2B.1 Metric Spaces studies such distances properly: the edit distance is a metric, and the issue here is that "distance at most 1" isn't transitive.
Recall Where we stand

We have the language of sets and functions, the four kinds of maps (injective, surjective, bijective, neither), images and preimages and why preimages behave better, products and relations, and the central tool of the next two chapters: equivalence relations, quotients and well-definedness. Chapter 2A.3 Integers and Rationals uses all of it to build the integers and the rationals from the natural numbers.

Exercises

Exercise 2.18 A distributive law

Prove that A∩(B∪C)=(A∩B)∪(A∩C)A \cap (B \cup C) = (A \cap B) \cup (A \cap C) for any sets AA, BB, CC, by showing each side is a subset of the other.

Solution

If x∈A∩(B∪C)x \in A \cap (B \cup C) then x∈Ax \in A, and x∈Bx \in B or x∈Cx \in C. In the first case x∈A∩Bx \in A \cap B, in the second x∈A∩Cx \in A \cap C; either way xx is in the right-hand side. Conversely, if x∈A∩Bx \in A \cap B then x∈Ax \in A and x∈B⊆B∪Cx \in B \subseteq B \cup C, so xx is in the left-hand side; the case x∈A∩Cx \in A \cap C is the same.

Exercise 2.19 Composition and the kinds of maps

Let f:X→Yf : X \to Y and g:Y→Zg : Y \to Z. Prove: (a) if ff and gg are injective, so is g∘fg \circ f; (b) if ff and gg are surjective, so is g∘fg \circ f; (c) if g∘fg \circ f is injective, then ff is injective, but gg need not be.

Hint

For (c), a counterexample: let XX have one element, and let gg send two different points of YY to the same point.

Exercise 2.20 When images behave

Show that if ff is injective then f(S∩T)=f(S)∩f(T)f(S \cap T) = f(S) \cap f(T) for all S,T⊆XS, T \subseteq X. Then find the exact place in your proof where injectivity is used, and check that Example 2.9 fails at that place.

Exercise 2.21 Going there and back

Let f:X→Yf : X \to Y, S⊆XS \subseteq X and U⊆YU \subseteq Y. Prove that S⊆f−1(f(S))S \subseteq f^{-1}(f(S)) and f(f−1(U))⊆Uf(f^{-1}(U)) \subseteq U. Show that the first inclusion is an equality for every SS exactly when ff is injective, and the second for every UU exactly when ff is surjective.

Exercise 2.22 Partitions give equivalence relations

Complete the proof of Theorem 2.14: given a partition of XX, show that "x∼yx \sim y if xx and yy lie in the same piece" is an equivalence relation whose classes are exactly the pieces.

Exercise 2.23 Which are equivalence relations?

For each relation, decide whether it is reflexive, symmetric and transitive: (a) m≤nm \leq n on N\mathbb{N}; (b) "x−yx - y is an even integer" on Z\mathbb{Z}; (c) "∣x−y∣<1|x - y| < 1" on R\mathbb{R}; (d) "lives within 10 km of" on the set of people; (e) "xx and yy have the same last digit" on N\mathbb{N}.

Solution

(a) Reflexive and transitive, not symmetric. (b) An equivalence relation, with two classes, the even and odd integers. (c) Reflexive and symmetric, not transitive (0∼0.6∼1.20 \sim 0.6 \sim 1.2 but ∣0−1.2∣>1|0 - 1.2| > 1): the real-number version of "similar enough". (d) Same as (c). (e) An equivalence relation with ten classes; it is congruence modulo 1010.

Exercise 2.24 Well defined or not?

On Z/12\mathbb{Z}/12 (clock arithmetic), decide which of these formulas define functions: (a) [a]↦[2a][a] \mapsto [2a] into Z/12\mathbb{Z}/12; (b) [a]↦[a][a] \mapsto [a] into Z/6\mathbb{Z}/6; (c) [a]↦[a][a] \mapsto [a] into Z/5\mathbb{Z}/5; (d) [a]↦[a] \mapsto the remainder of aa on division by 1212, into {0,…,11}\{0, \dots, 11\}.

Solution

(a) Yes: a≡a′(mod12)a \equiv a' \pmod{12} gives 2a≡2a′(mod12)2a \equiv 2a' \pmod{12}. (b) Yes: a multiple of 1212 is a multiple of 66, so congruent mod 1212 implies congruent mod 66. (c) No: [0]=[12][0] = [12] in Z/12\mathbb{Z}/12, but 0≢12(mod5)0 \not\equiv 12 \pmod 5. (d) Yes, and it is a bijection: it chooses one canonical representative for each class.

Exercise 2.25 Rehearsal: a distance on a circle

Longitudes live in R/360Z\mathbb{R}/360\mathbb{Z}. Show that d([a],[b])=min⁡{∣a−b−360k∣:k∈Z}d([a], [b]) = \min\{|a - b - 360k| : k \in \mathbb{Z}\} is well defined, that is, independent of the representatives aa and bb, and compute d([170],[−170])d([170], [-170]). This is the first appearance of a recurring idea: a quotient often inherits a distance from the space above it, by taking the shortest distance between classes. Riemannian quotients such as lens spaces get their geometry the same way (7A.6 Covering Spaces, 9A.1 Riemannian Metrics and Model Spaces).

Solution

Replacing aa by a+360ja + 360j changes the set {∣a−b−360k∣:k∈Z}\{|a - b - 360k| : k \in \mathbb{Z}\} only by renaming kk to k−jk - j, so the minimum is unchanged; the same holds for bb. For a=170a = 170, b=−170b = -170: a−b=340a - b = 340, and ∣340−360∣=20|340 - 360| = 20 is the smallest value, so the distance is 20°20°, as the map in Figure 2.6 says it should be.

© 2026 NeckPinch (www.neckpinch.com). All content in the guidebook (text, mathematics, figures and exercises) is protected by copyright. All rights reserved. No part may be copied, republished or redistributed without written permission.