© 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.
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 Infinite Sets.
In this chapter · 9 sections
- 2.1Sets
- 2.1.1Which sets exist
- 2.1.2Operations on sets
- 2.2Proving set identities
- 2.2.1The method: chase an element
- 2.2.2Disproving an identity
- 2.3Functions
- 2.3.1Injective, surjective, bijective
- 2.4Working with injections and surjections
- 2.5Images and preimages
- 2.6Cartesian products and relations
- 2.7Equivalence relations and quotients
- 2.7.1Functions on a quotient must be well defined
- 2.7.2Equivalence is a strong requirement
- 2.8Working with quotients
- 2.8.1Every function defines an equivalence relation
- 2.8.2Every function factors through a quotient
- 2.8.3Operations on a quotient
- 2.9Exercises
- ↗Free resources
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 or disprove set identities by chasing elements;
- 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;
- factor any function through a quotient, and define arithmetic on a quotient such as clock arithmetic.
Sets
A set is a collection of objects, called its elements. We write when is an element of , and when it isn't. A set is completely determined by its elements: two sets are equal exactly when they have the same elements. So , and are the same set. Order and repetition don't matter, only membership.
A set is a subset of a set , written , if every element of is also an element of . It is a proper subset, written , if in addition .
Equality of sets is then the same as inclusion both ways: if and only if and . 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 with no elements.
- For any objects and there are the sets and .
- For any sets and there is the union , whose elements are those that lie in or in (or both).
- Specification. For any set and any property , there is a set of the elements of that have the property.
- Replacement. For any set and any rule assigning an object to each , there is a set .
- Infinity. The natural numbers form a set.
- Power set. For any set 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 with property " with no ambient set, and the reason is one of the most famous arguments in mathematics.
Suppose any property defined a set. Consider the property " is a set that is not an element of itself", and let be the set of all such . Is an element of itself? If , then has the defining property, so . If , then has the property, so . 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
Let and be sets.
- The intersection consists of the elements in both.
- The difference consists of the elements of not in .
- and are disjoint if .
When all the sets in a discussion are subsets of one fixed set , the difference is called the complement of (in ), written .
Often we need the union or intersection of many sets at once, perhaps infinitely many: the intervals for , say. A family of sets indexed by a set is an assignment of a set to each index .
Let be a family of sets.
- The union is the set of that lie in for at least one .
- If is nonempty, the intersection is the set of that lie in for every .
So "union" is "there exists an index" and "intersection" is "for every index". For example, : every with lies in some interval (take with ), but lies in none of them. And : is in every interval, and any falls outside the interval with . (These two computations use the Archimedean property of the reals from 2A.4 The Real Numbers; for now take them on trust.) Notice that an infinite union of closed intervals need not be closed, and an infinite intersection of open intervals need not be open. That is the first sign of a theme in 2B.1 Metric Spaces.2 The intersection of an empty family is left undefined: "every that lies in every " would then be every object whatsoever, which is not a set. Inside a fixed one sometimes sets it equal to by convention.
The power set of , written or , is the set of all subsets of . For it is , with four elements. Its elements are sets, so a power set is a set of sets; that is normal, and families of subsets of a fixed set are exactly what topology and measure theory are built from (2B.1 Metric Spaces, 3A.2 Lebesgue Measure).
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.
Let and be subsets of a set . Then
More generally, for any family of subsets of , indexed by in some set ,
Proof. We prove the first law for a family; the others are the same argument. Let . Then lies in the left-hand side exactly when is not in , that is, when there is no with . That says for every , which means for every , 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 with …)" became "for every , 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.
Proving set identities
If you have only ever seen set identities illustrated with Venn diagrams, proving them can feel strange at first: what is there to prove? This section is about the method, which is completely mechanical once you see it, and which you will use for every set identity from here on.
The method: chase an element
To prove for two sets built from others:
- Let be an arbitrary element of .
- Unfold the definitions: write out what "" means in words, using "and", "or", "not".
- Reason with those words until you reach what "" means. This proves .
- Do the same starting from , or, if every step in 3 was an "if and only if", note that the argument runs backwards too. This proves .
The translation table is short. means " and ". means " or " (inclusive or). means " and not ". And means "not " (with understood).
For subsets , , of a set :
- and ;
- and ;
- and ;
- , , , , ;
- .
Proof (Two of the laws, as models). The second distributive law. Let . Then , or is in both and . If , then and . If and , then again and . Either way .
Conversely, let , so and . If , then . If , then forces , and forces ; so . Either way .
Part 5. means and , which means and , which is . Every step is an "if and only if", so the sets are equal.
The other laws are proved the same way. Part 4's is the logical law "not not " is .
Notice the "If " move in the converse half. When you know " or " and want to use it, split into cases: either holds, or fails and then must hold. Case splits are the commonest step in element-chasing.
Claim: if and only if .
Suppose . We show . Always : an element of both is an element of . Conversely, if then (because ), so .
Suppose . If , then , so . Hence .
An "if and only if" claim needs two proofs, one for each direction, and it is good practice to label them as above.
Disproving an identity
To show that a proposed identity is false, you need one counterexample: specific sets for which the two sides differ. Small finite sets are best, because you can compute everything.
Is for all sets and ? Try and . Then and . So the identity is false.
What is true? Element-chasing gives : an element of the left side is in or in ; and an element of is either in , or in but not in . So the identity holds exactly when , that is, when (by the dual of Example 2.6). Finding the correct version of a false statement is often more useful than the counterexample itself.
A Venn diagram of two or three circles shows every combination of "in" and "out", so it really can check identities involving two or three sets. With four or more sets, circles can't show all combinations, and a picture can make a false identity look true. Use pictures to guess, and element-chasing to prove.
Functions
Informally, a function from to is a rule that takes each element of and returns an element of . The precise definition makes three things part of the data: where inputs come from, where outputs land, and the rule.
Let and be sets. A function assigns to every exactly one element . The set is the domain of , and is its codomain. Two functions are equal if for every .
Three consequences of the definition catch people out.
- Every input gets an output. " from to " is not a function, because gets nothing. It becomes one if the domain is .
- Exactly one output. " is the number whose square is " is not a function on the positive reals, because has two square roots. Choosing one ("the positive square root") makes it a function.
- Equality is about values, not formulas. and are the same function. On the other hand, as a function and as a function 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 . A function is its graph: a set of pairs in which every appears as a first entry exactly once. Pairs need one more construction, the Cartesian product, which comes later in this chapter.
Composition. If and , the composition is . Composition is associative, , because both send to . It is not commutative: putting on socks and then shoes is not the same as shoes then socks.
Injective, surjective, bijective
A function is
- injective (one-to-one) if different inputs give different outputs: implies ;
- surjective (onto) if every element of is an output: for every there is some with ;
- bijective if it is both.
You met injectivity already: 2A.1 The Natural Numbers's Axiom 1.4 says exactly that the successor map is injective. Together with Axiom 1.3 ( is not a successor), it says that the successor map from to is injective but not surjective.
A function is bijective if and only if there is a function with for every and for every . Such a is unique; it is the inverse of , written .
Proof. If is bijective, then for each there is some with (surjectivity), and only one (injectivity). Define to be that . Then by construction, and because is the unique input sent to .
Conversely, suppose such a exists. If , apply : , so is injective. Given , the element satisfies , so is surjective.
For uniqueness, if and both work, then for every , , using and then with .
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 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.
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, with letters numbered to and wrapping round after (exactly the clock arithmetic of 2A.1 The Natural Numbers). Its inverse is . Modern block ciphers such as AES are, for each key, bijections on the set of 128-bit blocks. Decryption is the inverse function.
Working with injections and surjections
Deciding whether a given function is injective or surjective is a skill you will use constantly, and, like induction, it has a standard shape.
- To prove injective: take with and deduce . (This is the contrapositive of the definition, and is almost always easier to use.)
- To prove not injective: find two specific different inputs with the same output.
- To prove surjective: take an arbitrary in the codomain and find an with . Usually you solve for in scratch work, and then check in the proof that your lies in the domain and really works.
- To prove not surjective: find one specific in the codomain that no input reaches, and prove that none does.
Let , .
Injective. Suppose . Subtract and divide by : .
Surjective. Given , scratch work: means . Now the proof: let , which is a real number, and compute .
So is a bijection, and the scratch work found its inverse: . Check against Proposition 2.10: and .
Now consider the same formula as a map . It is still injective (the same proof works), but no longer surjective: would need , which is not an integer. Changing the domain and codomain changes the answer, which is why they are part of the function.
Let .
- As a map : not injective, since ; not surjective, since for every , so is never reached.
- As a map : surjective (every has a square root, ), not injective.
- As a map : bijective. Injective: if with , then , so or , and the second forces . Surjective: as before. The inverse is .
- As a map on the non-negative rationals: injective (same proof), but not surjective, because is not the square of any rational (2A.3 Integers and Rationals).
The step "every has a square root" is a genuine theorem about the real numbers, not a triviality. It is proved in 2A.4 The Real Numbers, and it fails for the rationals. Much of real analysis consists of proving that some equation has a solution, that is, that some map is surjective.
If and are bijections, then is a bijection, and .
Proof. Let . Then , and similarly . So is an inverse for , which is therefore a bijection by Proposition 2.10, and is its inverse by the uniqueness part of Proposition 2.10.
The order reverses, as with socks and shoes: to undo "socks, then shoes", take off the shoes first.
Injectivity and surjectivity each correspond to half of an inverse.
Let , with nonempty.
- is injective if and only if there is with (a left inverse).
- is surjective if and only if there is with (a right inverse).
Here is the identity map on .
Proof. (1) If and , then . Conversely, suppose injective, and fix some . For , let be the unique with ; for , let . Then for every .
(2) If , then each equals , so is surjective. Conversely, if is surjective, each has at least one with ; let be one of them. Then .
The last sentence of the proof hides something. "Let be one of them" makes a choice for every at once, and when is infinite and there is no rule to pick out a particular preimage, that is not something the axioms listed so far allow. It needs the axiom of choice, discussed in 2A.8 Infinite Sets. When there is a rule (as for on , where we can choose "the non-negative root"), no extra axiom is needed.
Images and preimages
A function moves sets as well as points. There are two directions, and they behave very differently.
Let .
- For , the image of is , the set of outputs of inputs from .
- For , the preimage (or inverse image) of is , the set of inputs whose outputs land in .
The notation does not require to have an inverse. It makes sense for every function. If on , then , , and .
Preimages respect every set operation. Images don't.
Let , and let and (for ) be subsets of . Then
Proof. For the union: means for some , which means for some , which is membership of the right-hand side. The intersection is the same with "some" replaced by "every". For the complement: means , which means .
For images, only the union rule survives: always, but in general can happen.
Let and . Then and . If then .
Proof. means for some in or in ; that is, for some , or for some ; that is, . For the intersection: if with , then gives and gives . The last claim is immediate from the definition.
The proof of the intersection rule only goes one way, and the example below shows why it can't go the other way. When you try to reverse it, you know with and with , but nothing says .
Let on , and . Then , so . But , so . Points from and points from are sent to the same place, so after applying you can no longer tell them apart. If is injective this can't happen, and then (Exercise 2.35).
Theorem 2.16 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.
A greyscale photograph is a function from the set of pixels to brightness values . "Select every pixel brighter than ", the first step in many image-segmentation tools and in counting stars, cells or defects in a picture, is the preimage . Theorem 2.16 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
An ordered pair consists of a first entry and a second entry ; two pairs are equal exactly when their first entries are equal and their second entries are equal. The Cartesian product of sets and is the set of all ordered pairs . Products of more sets, , consist of ordered -tuples.
So is the plane, and a function can be identified with its graph, a subset of . If has elements and has , then has , which is where the word "product" comes from.
A relation on a set is a subset . We write for .
"Less than" on is a relation: the set of pairs with . So is "has the same birthday as" on the set of people.
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.19, 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 " is one: it treats , and as the same as far as a clock is concerned. Three properties capture what "behaves like equality" means.
A relation on a set is an equivalence relation if it is
- reflexive: for every ;
- symmetric: if then ;
- transitive: if and then .
The equivalence class of is , everything equivalent to .
Fix a positive natural number . For integers and , say if is a multiple of . (We use the integers informally here; they are built properly in 2A.3 Integers and Rationals.) This is an equivalence relation: ; if then ; and if and then . There are exactly classes, , one for each possible remainder, by Euclidean division (2A.1 The Natural Numbers).
The key fact about equivalence classes is that they cut into non-overlapping pieces.
Let be an equivalence relation on . Then every element of lies in exactly one equivalence class. In particular, two classes and are either equal (when ) or disjoint (when ).
Conversely, any way of cutting into non-empty, pairwise disjoint pieces whose union is (a partition) comes from exactly one equivalence relation: " when and are in the same piece".
Proof. Each lies in its own class, by reflexivity. Suppose and share an element , so and . By symmetry , and with transitivity . Now if , then and give , so ; thus , and by the same argument . So two classes that meet are equal, which is the first claim. The converse is a direct check of the three properties (Exercise 2.37).
Now the central construction.
Let be an equivalence relation on . The quotient set is the set of equivalence classes, . The map , , 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 is plain equality. It forgets exactly the differences that declares unimportant.
Longitude is an angle: and name the same meridian, and so do and . Mathematically, longitude is a point of the quotient , a circle, not a point of the interval . Software that forgets this breaks at the antimeridian, the line of through the Pacific. A rectangle that runs from E across to W (that is, to ) is only wide. Stored naively as "from to ", it is drawn as a band 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.
Functions on a quotient must be well defined
To define a function on a quotient set , it is natural to give a formula in terms of a representative: " is something computed from ". 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.
Let be an equivalence relation on , and let be a function that is constant on each class: implies . Then there is exactly one function with for every , that is, with .
Proof. Define on a class by choosing any and setting . Any other choice satisfies , so : the value doesn't depend on the choice, and is a function. It satisfies by construction, and any function with that property must agree with on every class.
On the clock , "" is not a function into the integers, because but . On the other hand, "" is a well-defined function ("five hours later"): if then .
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.
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.7 Covering Spaces), and the 3-manifolds left behind by Ricci flow with surgery are quotients 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.4 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.
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.
Working with quotients
Quotients are the most abstract idea in this chapter, and the next two chapters lean on them hard. This section collects the three facts you will use: every function defines an equivalence relation, every function factors through its quotient, and operations with two inputs can be passed to a quotient when they respect the equivalence.
Every function defines an equivalence relation
Let . The relation when is an equivalence relation on . The class of is the fibre , the set of inputs with the same output as .
Proof. Reflexive, symmetric and transitive because equality is: ; if then ; if and then . The class of is , which is the preimage of the one-point set .
For example, "same remainder on division by " is for the function that sends to its remainder. "Same birthday" is for the function sending a person to their birthday. In fact every equivalence relation arises this way: is the same as for its own quotient map , since means , which means by Theorem 2.23.
Every function factors through a quotient
Let , and let be the relation of Proposition 2.27. Then
is a well-defined bijection, and , where is the quotient map and is the inclusion .
Proof. Well defined: is constant on each class by definition of , so Proposition 2.25 applies. Injective: if , then , so and . Surjective: every element of is for some . Finally, for every .
Theorem 2.28 says that a function is always "a quotient, followed by a relabelling, followed by an inclusion". In words: the quotient of by "same output" is a perfect copy of the set of outputs. So a quotient is not as abstract as it looks. Whenever you have a function that is constant exactly on the classes, the quotient can be identified with that function's image. Three examples:
- can be identified with , through "remainder on division by 12".
- Longitudes can be identified with the points of a circle, through "the direction at angle degrees". (Making that map precise needs and , built in 2B.6 Power Series, Exponentials and Bump Functions.)
- The rationals of 2A.3 Integers and Rationals, defined as a quotient of pairs of integers, can be identified with lowest-terms fractions, through "reduce to lowest terms".
So why define quotients at all, if they can be identified with images? Because often there is no convenient function to start from. The real numbers in 2A.4 The Real Numbers are defined as a quotient precisely because there is no set of "real numbers" yet to map to. The quotient creates the new set.
Operations on a quotient
The integers and rationals of 2A.3 Integers and Rationals need addition and multiplication on a quotient, which are functions of two inputs. The single-input rule Proposition 2.25 extends directly.
Let be an equivalence relation on , and a function with the property
Then defines a function .
Proof. We must check that the value doesn't depend on the representatives chosen. If and , then and , so , so .
The condition is often summarised as " respects ". To check it, take representatives, change them to equivalent ones, and show the answer changes only to an equivalent one.
Fix , and on the integers let as in Example 2.22. Define and on .
Addition respects . If and , then , so .
Multiplication respects . With the same :
so .
So has a well-defined addition and multiplication. In : (seven hours after eight o'clock is three o'clock) and .
Since , we have in . Because multiplication is well defined, for every . So for a number with decimal digits ,
A number and the sum of its digits have the same remainder mod . This gives an old check on hand multiplication. For : the digit sums are and , whose product is ; and . They agree, as they must. (A wrong answer can pass the check, if the error is a multiple of , but an answer that fails it is certainly wrong.)
Try to define powers on by . Take . Since , the definition would need . But and , so . The exponent does not respect congruence mod , and the formula defines nothing. (Powers with an ordinary natural number are fine: that is repeated multiplication, which is well defined.)
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. Every function factors as a quotient followed by a bijection onto its image, and operations that respect an equivalence pass to the quotient. Chapter 2A.3 Integers and Rationals uses all of it to build the integers and the rationals from the natural numbers.
Exercises
Prove that for any sets , , , by showing each side is a subset of the other.
Solution
If then , and or . In the first case , in the second ; either way is in the right-hand side. Conversely, if then and , so is in the left-hand side; the case is the same.
Let and . Prove: (a) if and are injective, so is ; (b) if and are surjective, so is ; (c) if is injective, then is injective, but need not be.
Hint
For (c), a counterexample: let have one element, and let send two different points of to the same point.
Solution
(a) If , then because is injective, and then because is injective. (b) Given , choose with , then with ; so . (c) If , then , so because is injective. For the counterexample, let , , , and . Then has a one-element domain, so it is injective, but is not. (Similarly, if is surjective then is surjective, but need not be.)
Show that if is injective then for all . Then find the exact place in your proof where injectivity is used, and check that Example 2.18 fails at that place.
Solution
The inclusion always holds (Proposition 2.17). For the reverse, let , so for some and for some . Then , and injectivity gives , which lies in ; so . In Example 2.18, has and with but : exactly the step that fails.
Let , and . Prove that and . Show that the first inclusion is an equality for every exactly when is injective, and the second for every exactly when is surjective.
Solution
If then , so . If , then for some with , so .
Injective case. If is injective and , then for some , so . Conversely, if is not injective, pick with and let : then but .
Surjective case. If is surjective and , pick with ; then and . Conversely, if some is not an output, let : then , so .
Complete the proof of Theorem 2.23: given a partition of , show that " if and lie in the same piece" is an equivalence relation whose classes are exactly the pieces.
Solution
Reflexive: the pieces cover , so each lies in some piece, together with itself. Symmetric: "in the same piece" doesn't depend on the order. Transitive: if lie in a piece and in a piece , then ; distinct pieces are disjoint, so , and lie in the same piece. Classes: is the set of in the same piece as , which is the piece containing . Only one relation: any equivalence relation whose classes are the pieces satisfies exactly when , that is, when is in the piece of .
Prove that and . Then decide, with proof or counterexample, whether .
Solution
means and not ( or ), that is, , and , which is . The second identity is the same with "not (and)" becoming "or not". The third is false: with and , the left side is and the right side is . What is true is .
List the elements of the power set of . Explain why adding one new element to a finite set doubles the number of its subsets, and deduce that a set with elements has subsets.
Solution
, , , , , , , : eight. If with , each subset of either omits (and is a subset of ) or contains (and is for exactly one subset of ). So has twice as many subsets as , and induction on gives , starting from the one subset of . This is why is a common notation for the power set. Counting finite sets properly is the business of 2A.8 Infinite Sets.
For , , describe the classes of (Proposition 2.27), and the bijection of Theorem 2.28. Then do the same for , .
Solution
For , the class of is (just when ), and sends the class to . The quotient "identifies with ", and says this quotient is a copy of , the half-line. For , the classes are the circles centred at the origin (and the origin itself), and sends each circle to the square of its radius, again identifying the quotient with . The second example is a first glimpse of how quotients by symmetries are used: functions on the plane that are unchanged by rotation are the same thing as functions of the radius alone.
(a) Use Example 2.31 to show without dividing that is a multiple of . (b) Show that in , and deduce that a number has the same remainder mod as the alternating sum of its digits . Check it on .
Solution
(a) The digit sum is , so the number is . (b) , so and , which is for even and for odd . So the number is congruent to . For : , and , since and . They agree.
For each relation, decide whether it is reflexive, symmetric and transitive: (a) on ; (b) " is an even integer" on ; (c) "" on ; (d) "lives within 10 km of" on the set of people; (e) " and have the same last digit" on .
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 ( but ): the real-number version of "similar enough". (d) Same as (c). (e) An equivalence relation with ten classes; it is congruence modulo .
On (clock arithmetic), decide which of these formulas define functions: (a) into ; (b) into ; (c) into ; (d) the remainder of on division by , into .
Solution
(a) Yes: gives . (b) Yes: a multiple of is a multiple of , so congruent mod implies congruent mod . (c) No: in , but . (d) Yes, and it is a bijection: it chooses one canonical representative for each class.
Longitudes live in . Show that is well defined, that is, independent of the representatives and , and compute . 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.7 Covering Spaces, 9A.1 Riemannian Metrics and Model Spaces).
Solution
Replacing by changes the set only by renaming to , so the minimum is unchanged; the same holds for . For , : , and is the smallest value, so the distance is , as the map in Figure 2.6 says it should be.
Free resources for this chapter
Chosen for what this chapter covers, and all free to read or watch. Where a lecture covers more than this chapter, the minutes to watch are given, and the link starts there when it can. Links checked Nov 6, 2026.
Read
- Book Chapter 11: RelationsRichard Hammack, Book of Proof (free textbook)Equivalence relations, equivalence classes and partitions, and the integers modulo n.
- Book Chapter 12: FunctionsRichard Hammack, Book of Proof (free textbook)Injective and surjective functions, composition, inverses, images and preimages.
- Book §0.3 Basic set theoryJiří Lebl, Basic Analysis I & II (free textbook)Sets, functions and cardinality in the notation used for the rest of real analysis.
Watch 3 lectures and talks
- Video Lecture 1: Sets, Set Operations and Mathematical InductionMIT OpenCourseWare 18.100A Real Analysis (Fall 2020), Casey Rodriguez · 0:00–37:35 (sets)Sets and set operations, with De Morgan’s laws proved.
- Video Lecture 11: Relations, Partial Orders, and SchedulingMIT OpenCourseWare 6.042J Mathematics for Computer Science (Fall 2010), Tom Leighton · 16:45–26:45 (equivalence relations)Equivalence relations and the partition into equivalence classes.
- Video Lecture 2: Cantor’s Theory of Cardinality (Size)MIT OpenCourseWare 18.100A Real Analysis (Fall 2020), Casey Rodriguez · 4:44–21:04 (functions)Functions, injections, surjections and bijections, the language the cardinality theory is built on.
© 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.