A function pairs each input with exactly one output, but "divides", "has the same birthday as" and "leaves the same remainder on division by as" pair things far more freely, and they need a language of their own.
The previous lesson closed on the observation that many useful relations are not functions at all. This lesson defines relations, picks out the ones that say two things are "the same for present purposes", and shows that each of them cuts its set into pieces, which is how modular arithmetic and the fractions are built. It assumes sets, the Cartesian product of all ordered pairs with and , functions with their images and preimages, the quantifiers, and divisibility: when for some integer . It also uses the division algorithm from the lesson on direct proof: for integers and with there are unique integers and with and .
Relations as sets of pairs
A relation from a set to a set is a subset of , and a relation on is a relation from to , a subset of . When the pair belongs to we say is related to and write , or when the relation has a symbol of its own. A relation is exactly the set of pairs it holds between, so two relations are equal when they contain the same pairs, however differently they were described.
Take and let mean . As a set of pairs this is
eight of the sixteen pairs in . Order matters, since is in the set and is not. A relation on can be any subset of , and a set of elements has ordered pairs, so it carries relations: for , .
A small relation on a finite set can be drawn. Put a dot for each element and an arrow from to whenever , with a loop at when . The drawing, a directed graph, carries exactly the information of the set of pairs, and each property defined below becomes a visible feature of it: a loop at every dot, arrows that always come in opposite pairs, a short cut for every path of two arrows.
A function from to fits the same mould. Its graph, , is a relation from to in which every appears as a first coordinate exactly once, so functions are the relations with that property, as the previous lesson defined them. On , when is a function. The relation when is not, and it fails both ways: is related to and to , and is related to nothing. Divisibility above is not one either, since is related to four elements.
Every relation from to has an inverse (or converse) relation from to , obtained by reversing every pair. The inverse of "divides" is "is a multiple of". The inverse of the graph of a function is again a relation, and it is the graph of a function exactly when the function is a bijection, which is the theorem on inverses from the previous lesson in this language.
Reflexive, symmetric and transitive
Three properties of a relation on matter here, each a universal statement:
Definition. A relation on that is reflexive, symmetric and transitive is an equivalence relation on .
Equality is the model, and "has the same birthday as" is another: everyone shares a birthday with themselves, sharing is mutual, and two people who share with a third share with each other. An equivalence relation is a way of saying "these two are the same, for present purposes": same birthday, same remainder, same fractional part, same value. The three properties are the minimum any notion of sameness must have.
Being universal, each property is broken by a single counterexample, and three relations on show that any two can hold without the third. The order is reflexive and transitive but not symmetric, since and not . "Close to", meaning , is reflexive and symmetric but not transitive: is close to and to , but is not close to . And when is symmetric and transitive (if and , then and both have the sign of ) but not reflexive, since .
That last example refutes a tempting proof: "if then , so by transitivity". Each step is valid, but the argument needs some with to start from, and for there is none. Reflexivity asks about every , including those related to nothing. The argument does prove something: in a symmetric and transitive relation, every element related to anything is related to itself.
"Close to" deserves a second look, because it is the commonest way to go wrong outside mathematics. Two measurements that agree within a tolerance are "the same" for practical purposes, but the tolerance does not chain: and agree within , as do and , while and do not. A chain of a thousand indistinguishable steps can join two very different things, which is the old paradox of the heap in modern dress. A relation that must be an equivalence cannot be defined by a tolerance.
Two further properties belong to the next lesson but are worth naming now so that they are not confused with these. A relation is irreflexive when no element is related to itself, as with , which is stronger than failing to be reflexive: the relation above is neither reflexive nor irreflexive, since holds and does not. And it is antisymmetric when and together force , as with . Symmetric and antisymmetric are not opposites: equality is both.
Proving a relation is an equivalence
Such a proof is three short proofs, one per property, each a universal conditional: take arbitrary elements, assume the hypothesis, and reach the conclusion from the definition of the relation. Label the three parts, and in each state what is assumed and what is to be shown.
Example. On , let when . Prove that is an equivalence relation.
Reflexive: let . Then , an integer, so . Symmetric: let , so for some integer . Then , also an integer, so . Transitive: let and , so and for integers and . Adding, , an integer, so . All three hold, so is an equivalence relation.
Here : two reals are related when they have the same fractional part. The three steps used that the integers contain and are closed under negation and addition, and the same proof works with replaced by any set of reals with those three properties, such as or the multiples of .
Now you. On the nonzero reals, let when . Prove that is an equivalence relation.
Answer
Reflexive: for , , which is rational, so . Symmetric: let with rational. Since , , so is rational and . Transitive: let and with and rational. Then , which is rational, so . Hence is an equivalence relation. This time the proof used that the nonzero rationals contain and are closed under reciprocals and products: the multiplicative version of the Example.
Equivalence classes
An equivalence relation says which elements are "the same". Gathering each element together with everything the same as it gives the central object of this lesson.
Definition. Let be an equivalence relation on and . The equivalence class of is the set of everything related to it:
Any element of a class is a representative of it. The set of all equivalence classes is the quotient of by , written and read " modulo ", and the function , , is the quotient map.
Under the fractional part relation of the Example above, , and : one class, two names. Each class contains exactly one number in , the common fractional part, so the classes correspond to the points of . Under "has the same birthday as", the class of a person is everyone born on the same day of the year, and there are at most 366 classes.
The quotient is a set whose elements are sets, and the notation hides a trap. The class is named after one of its elements, but it does not remember which name was used: and are the same set, as much as and are the same number. Everything that follows turns on one fact, that a class is the same whichever representative names it.
Lemma. Let be an equivalence relation on , and let . The following are equivalent:
(i) ;
(ii) ;
(iii) .
Proof. We prove (i) (ii) (iii) (i).
(i) (ii). Suppose . We show by double inclusion. Let , so . With , transitivity gives , so . Conversely, let , so . Symmetry turns into , and transitivity gives , so .
(ii) (iii). By reflexivity , so . If , then lies in both, and the intersection is not empty.
(iii) (i). Suppose , so and . Symmetry gives , and transitivity applied to and gives .
Each property of an equivalence relation did a visible job. Reflexivity put every element in its own class, symmetry let the relation be read in either direction, and transitivity carried membership from one class to another. The lemma says two classes are either equal or disjoint, never partly overlapping, and that is the content of the partition theorem below.
Example. On , let when . Prove that is an equivalence relation, describe its classes, and find a set containing exactly one representative of each class.
Reflexive: . Symmetric: an equation read from right to left is the same equation. Transitive: if and , then . So is an equivalence relation, and all three properties came straight from the corresponding properties of equality, because the relation compares the value of one quantity, , at two points.
The class of is the set of points with , where : the parabola . So the classes are the parabolas , one for each real , stacked vertically and filling the plane without overlapping. The parabola crosses the axis exactly once, at , so the axis contains exactly one representative of each class.
Now you. On , let when . Prove that is an equivalence relation, describe its classes, and find a set containing exactly one representative of each class.
Answer
Reflexive, symmetric and transitive follow from the same properties of equality, applied to the values of , exactly as in the Example. So is an equivalence relation.
The class of is the set of points with , where . For this is the circle of radius centred at the origin, and for it is the single point , since forces . So the classes are the circles centred at the origin together with the origin itself.
The ray contains exactly one representative of each class: the class of radius meets the axis at and , and only the first has a non-negative first coordinate (for the two coincide). Leaving out the origin would miss a class, and taking the whole axis would count every circle twice.
A set containing exactly one element of each class, like the axis in the Example or the ray in the Now you, is called a set of representatives or a transversal. For congruence modulo , later in the lesson, the remainders are the standard one.
Classes and partitions
A partition of a set is a collection of non-empty subsets of , its blocks, such that every element of lies in exactly one block. The even and odd integers partition ; the positive reals, the negative reals and partition ; birthdays partition a room. The sets and do not partition , because lies in both, and neither do and , because lies in neither.
Theorem (the partition theorem). Let be a set.
(i) If is an equivalence relation on , then its equivalence classes form a partition of .
(ii) If is a partition of , then the relation " when and lie in the same block" is an equivalence relation on , whose equivalence classes are exactly the blocks of .
(iii) These two constructions are inverse to each other: starting from an equivalence relation, forming its partition into classes, and then the relation "in the same class" returns the original relation; starting from a partition, forming the relation "in the same block", and then its classes returns the original partition.
Proof. (i) Each class is non-empty, since by reflexivity, and every element of lies in at least one class, its own. If lies in two classes and , then , so by the lemma. So every element lies in exactly one class.
(ii) Reflexive: every lies in some block, and is in the same block as itself. Symmetric: " and lie in the same block" does not depend on the order in which they are named. Transitive: suppose and share a block , and and share a block . Then lies in both and , and since it lies in exactly one block, ; so and share the block . For the classes, let and let be the block containing . Then exactly when lies in the same block as , which is exactly when . So , and every block is a class, because every block is non-empty and so is the class of any of its elements.
(iii) Starting from , two elements lie in the same class exactly when , which by the lemma is exactly when , so the relation "in the same class" is again. Starting from a partition, part (ii) showed that the classes of "in the same block" are the blocks.
So equivalence relations on and partitions of are one idea described two ways, and the theorem gives a bijection between the set of equivalence relations on and the set of partitions of . Either description can be used, whichever is easier: a relation is often easier to define, and a partition easier to see. On there are five partitions (all together, all apart, or a pair beside a singleton, in three ways), so only five of the 512 relations on that set are equivalence relations.
How many equivalence relations does a finite set carry?
By the partition theorem, as many as it has partitions. Write for the number of partitions of a set of elements. Counting by hand gives , and , and it is natural to take , since the empty set has exactly one partition, the empty collection of blocks (every element of lies in exactly one block, vacuously).
There is a recurrence. Take a set of elements and fix one of them, . A partition is determined by two things: the set of elements not in the same block as , which can be any subset of the other elements, and a partition of into the remaining blocks. If has elements, there are ways to choose and ways to partition it, so
From and this gives , then , and . These are the Bell numbers, named after Eric Temple Bell, who wrote about them in the 1930s. They grow much faster than but much slower than the relations: on a set of elements, of the relations are equivalence relations.
The number was known long before. In the Japanese incense game genjikō, played from the Edo period, five packets of incense are burned and the players must say which of them were the same; the possible answers, the partitions of a set of five, were drawn as small diagrams of vertical and horizontal bars and each named after a chapter of The Tale of Genji. Refining the count by the number of blocks gives the Stirling numbers of the second kind, and Problem 14 finds two of them.
Congruence modulo
The most important equivalence relation in elementary mathematics compares integers by their remainders. Fix a positive integer . Integers and are congruent modulo , written , when . So , since , and , since . The notation is Carl Friedrich Gauss's, from his Disquisitiones Arithmeticae of 1801, and a clock uses it daily: five hours after nine o'clock is two o'clock because .
Example. Prove that congruence modulo is an equivalence relation on .
Reflexive: for , , so . Symmetric: let , so for some integer . Then , so . Transitive: let and for integers and . Adding, , so . Congruence modulo is therefore an equivalence relation.
This is the fractional part Example over again, with the multiples of in place of the integers: the proof used only that the multiples of contain and are closed under negation and addition.
The classes are the congruence classes (or residue classes) modulo , and the class of is
the integers reached from by adding or subtracting any number of times. When the modulus needs saying, write .
Theorem. Let be a positive integer. Then exactly when and leave the same remainder on division by . Consequently there are exactly congruence classes modulo , namely , and they are all different.
Proof. Divide both numbers by : and with . If , then , so . Conversely, suppose . Then with , which is a division of by with remainder in range, so by the uniqueness half of the division algorithm .
So every integer is congruent to its remainder , and lies in the class , one of . These classes are different, because two distinct numbers and in the range to are their own remainders, which differ, so they are not congruent, and by the lemma on classes .
For :
and these three sets partition . For the two classes are the even and the odd integers, so the corollary of the division algorithm that every integer is even or odd, and not both, is the partition theorem for congruence modulo . For there is a single class, itself, since divides everything.
The set of congruence classes modulo is written , read " mod ", where is the set of multiples of ; some books write . So
is a set of elements, each of which is an infinite set of integers. The remainders to form a set of representatives, and there are others: also contains one element of each class modulo .
Now you. On , let when . Prove that is an equivalence relation, and identify its classes.
Answer
Reflexive: , so . Symmetric: let . Then , so . Transitive: let and . Then , so .
In fact , so exactly when : this is congruence modulo in disguise, and its classes are , and modulo . Spotting the disguise first would have given all three properties at once from the Example.
Why not just work with the remainders to ?
For integers, one could. Define an arithmetic on the set by "add or multiply as usual, then take the remainder", and nothing in this lesson would be lost. Many programming languages do exactly that, and the Discrete Mathematics course computes with remainders all the time.
The classes earn their place in three ways. First, they need no choice of representative. The remainders are one set of representatives among many, and statements such as , proved below, hold for every representative at once, which is what makes computations such as legitimate without first converting to . Second, the construction works where no convenient representatives exist. In the fractional-part relation on the interval does the job, but for the fractions built at the end of this lesson, "the representative in lowest terms" needs the theory of greatest common divisors to even define, while the classes need nothing. Third, the same construction applies far beyond the integers. The notation records that the classes are the sets , translates of the set of multiples of . Group theory takes any group and any suitable subgroup and forms from the translates of in exactly this way; linear algebra forms quotient spaces of a vector space by a subspace; topology glues spaces together by declaring points equivalent. In each case there is usually no preferred representative, and the classes are the only way to proceed.
The price is the obligation that the next section is about: any operation defined through representatives must be shown to be independent of them.
Well defined operations
Clock arithmetic adds hours: nine o'clock plus five hours is two o'clock. In the language of classes, that is the rule
on , with . The rule is stated through representatives: to add two classes, pick an element of each, add the elements, and take the class of the result. A class has infinitely many representatives, and nothing yet guarantees that different choices give the same answer. If they did not, the rule would assign several values to one pair of classes, and it would not be a function at all.
Definition. Let be an equivalence relation on , and let be a rule that assigns to each element of an element of a set . The rule "" is well defined on when
that is, when takes the same value on all representatives of a class. For a rule in two variables, such as addition, the condition is that and together imply .
In the language of the previous lesson, the rule proposes the set of pairs as the graph of a function on . Every class appears as a first coordinate, since every class has a representative, so the first half of the definition of a function is automatic. The second half, that no class appears with two different values, is exactly the condition above. A proof that a rule is well defined is therefore a proof that it defines a function, and it must always be given.
Here is one that fails. "Send the class of modulo to the class of modulo ", , looks innocent. But , and the rule sends this one class to through one name and to through the other, and because . So there is no such function. The rule from to fails for the same reason whenever : but .
Addition modulo , on the other hand, is well defined. Let and , say and . Then
so , and . Clock arithmetic works whether nine o'clock is represented by , or .
Example. Prove that multiplication of congruence classes modulo , , is well defined.
Let and , so and for integers and . The goal is , and the trick is to change one factor at a time, adding and subtracting the mixed product :
Since is an integer, , so and the product class does not depend on the representatives.
Because both operations are well defined, congruences can be added and multiplied like equations: from and follow and , and by induction for every natural number . That is how large remainders are found without large numbers. For example, , so for every , and a number with decimal digits satisfies
so a number and the sum of its digits leave the same remainder on division by : the old rule of "casting out nines". Similarly , since , so .
With the operations in hand, is a number system with elements. It obeys the familiar laws, commutativity, associativity and distributivity, because each law holds for representatives and the operations are computed from representatives: for instance . It also behaves in unfamiliar ways. In , , a product of two non-zero classes that is zero. In that never happens, and every non-zero class has a multiplicative inverse: . Which behave like and which like , and why, is the subject of the Discrete Mathematics lesson on modular arithmetic, which builds on the definitions here.
Now you. Show that the rule , from to , is well defined, and that the rule is not. Interpret the first on a clock face.
Answer
Well defined: suppose , so for some integer . Then , so and . The value does not depend on the representative.
Not well defined: , since , but , since . The rule gives two different values for one class.
On a clock face, the first rule sorts the twelve hours into four classes by their remainder on division by : , and o'clock all go to , and , and o'clock to . It is well defined because , so a full turn of the clock is a whole number of cycles of . The same argument shows that is well defined whenever .
Can congruence classes be raised to powers?
A power with a class as the base is fine: for a natural number is repeated multiplication, and it is well defined because multiplication is. The trouble is a class in the exponent. The rule on , with restricted to non-negative representatives, is not well defined. Modulo , , but and , so would be both and . The base respects congruence modulo , and the exponent does not.
The exponent does respect a different congruence. Pierre de Fermat stated in a letter of 1640 what is now called Fermat's little theorem: if is prime and , then . Granting it, if with , say with , then . So for a base not divisible by , the exponent may be reduced modulo : modulo , exponents live modulo , and indeed and differ because and are not congruent modulo . Leonhard Euler generalised this to any modulus, and the result is the arithmetic behind RSA encryption, where a message is raised to one power to encrypt it and to another, chosen through the exponent's own modulus, to decrypt it. The Discrete Mathematics lesson on Fermat, Euler and RSA proves both theorems.
The lesson for well-definedness is that an operation can respect the relation in one argument and not in another, so each argument must be checked.
Kernels and quotient maps
Several equivalence relations in this lesson had the same shape: two points of the plane were related when , or , took the same value at both. Every function produces a relation of this kind, and every equivalence relation arises this way.
Definition. Let . The kernel of is the relation on given by when .
The name is borrowed from algebra, where the kernel of a homomorphism is the set of elements sent to the identity, and the relation defined here is its general form. (Some books call it the equivalence kernel, or the relation "induced by" .)
Theorem. Let .
(i) The kernel is an equivalence relation on , and its classes are the non-empty fibres , for in the range .
(ii) The rule , , is well defined and is a bijection.
(iii) , where is the quotient map and is the inclusion.
(iv) Every equivalence relation on a set is the kernel of its own quotient map .
Proof. (i) Reflexivity, symmetry and transitivity of are those of equality, applied to the values of : ; if then ; if and then . The class of is , which is the fibre . Conversely each fibre over an element of the range is the class of .
(ii) Well defined: if , then , which means . Surjective: every element of is for some . Injective: if , then , so and by the lemma on classes.
(iii) For , .
(iv) For , means , which by the lemma on classes means . So the kernel of is .
Part (iii) says that every function is a surjection, then a bijection, then an injection: first collapse each fibre to a single point, then match the collapsed points one to one with the values, then include the values in the codomain. Part (iv) says that "equivalence relation" and "kernel of a function" are the same notion. Together they give a practical method. To prove a relation is an equivalence, it is enough to find a function whose equal values define it, and then the classes are the fibres and can be counted by counting the values.
In the proof of (ii), well-definedness and injectivity were the same argument read in opposite directions: " implies " and " implies ". That is typical. A rule on classes is well defined when it does not distinguish elements that the relation identifies, and injective when it distinguishes all the elements that the relation does not identify.
Example. On , let when . Show that is an equivalence relation, and find its classes.
The relation is the kernel of , , since says exactly . So it is an equivalence relation by part (i) of the theorem, and its classes are the non-empty fibres of .
To find the fibres, note that depends only on the class of modulo , because multiplication of classes is well defined. So it is enough to square the five classes: , , , and . The range of is , and the fibres are
So there are three classes: the multiples of , the integers congruent to or modulo , and those congruent to or . The classes and are not squares modulo , so their fibres are empty and contribute no class. As a check, and are congruent modulo , and indeed and lie in the same class.
Now you. On , let when . Show that is an equivalence relation, and find its classes.
Answer
It is the kernel of , , so it is an equivalence relation, with the non-empty fibres of as its classes. Since depends only on , cube the seven classes: ; ; ; ; ; ; . (For instance and .)
The range is , and the three classes are , then , then . So and , while and are in different classes.
What else is built by identifying things?
Much of geometry and topology. Take the fractional-part relation on from the start of the lesson, when , and form the quotient , usually written . Each class has exactly one representative in , but the quotient is better pictured as a circle than as an interval. Numbers just below , such as , are close to numbers just above , such as , once and are identified, so walking right along goes round and round the quotient. The kernel theorem makes this exact: the function from to the unit circle is surjective, and its kernel is exactly , because the cosine and sine of two angles both agree exactly when the angles differ by a whole number of turns. So is in bijection with the circle. Angles, times of day and the phase of any periodic process live naturally in this quotient.
The same idea in two dimensions: on , let when both and are integers. Each class has one representative in the unit square , and passing to the quotient glues the left edge of the square to the right edge and the bottom edge to the top. The result is a torus, the surface of a ring doughnut, and it is the world of old arcade games in which a ship leaving the screen on one side reappears on the other. Gluing the edges of a strip with a half twist gives a Möbius band; identifying each point of a sphere with the opposite point gives the projective plane, the setting of projective geometry.
In algebra the same move builds new number systems. The complex numbers can be constructed as a quotient of the polynomials with real coefficients, by declaring two polynomials equivalent when their difference is a multiple of , so that the class of becomes a square root of . The arithmetic of is the simplest instance of all these constructions, and the requirement met in this lesson, that the operations be well defined, is exactly what each of them has to check.
The fractions as classes of pairs
A fraction is written as a pair of integers, but different pairs name the same number: , and are one rational number written three ways. An equivalence relation makes this precise, and builds from without assuming the division it is meant to create.
Let , and for pairs in let when , the cross multiplication test stated with multiplication alone. It is reflexive, since , and symmetric, since is the same equation as . Transitivity is the real work.
Claim. If and , then .
Proof. We are given and , and must show . Multiplying the first equation by gives , and by the second . Hence , that is, . The pair lies in , so , and a product of integers is zero only when a factor is; so .
The condition is not a formality. Allow and it is related to everything, since . Then and , but is not related to , because and . Transitivity would fail, and it fails exactly at the step that cancelled .
Definition. A rational number is an equivalence class of pairs in , written , and is the set of these classes.
So is the set , and the familiar facts about fractions become facts about classes. " exactly when " is the lemma on classes. "Every fraction can be written with a positive denominator" says that each class contains a pair with , since . "Every fraction can be written in lowest terms" says that each class contains a pair with and no common factor greater than , and that such a pair is unique, which is a real theorem about integers rather than a fact about notation.
The integers sit inside through the map , . It is injective: if then , so . It is not surjective, since is not for any integer ( has no integer solution). Identifying each integer with is how "" is meant.
Arithmetic comes next, through representatives, and it carries the obligation of the section on well defined operations. The school rules
compute with a chosen pair from each class, and they define operations on only if the answer is independent of the choice. A school favourite shows that this can fail: "add the tops and add the bottoms" gives , yet with for it gives , and because and . So is not an operation on at all.
Example. Prove that addition of rationals, , is well defined.
First, because and , so lies in and the result is a rational number. Now let and , that is, and . We must show , that is, . Expanding, grouping, and substituting the two hypotheses,
So the sum depends only on the classes, and addition of rationals is well defined.
Now you. Prove that multiplication of rationals, , is well defined, and check that on integers it agrees with ordinary multiplication: .
Answer
Since and , , so . Let and , so and . We must show . Rearranging and substituting,
so the product class does not depend on the representatives. On integers, . The same check for addition gives , so the new arithmetic extends the old.
With both operations defined, the laws of arithmetic on are proved from those on one representative at a time, as for . The new feature is division: a non-zero rational has , so , and , since . Every non-zero rational has a multiplicative inverse, which no integer other than and has in . The division that could not be assumed has been built.
Is a fraction really an infinite set of pairs?
It is one way to make "fraction" precise, and the point of the construction is not that anyone should think of as an infinite set while doing arithmetic. The point is that the construction exists. It shows that the rational numbers, with all their laws, can be built from the integers using nothing but sets, so that any contradiction in the theory of would already be a contradiction in the theory of . After the construction, what matters is how the rationals behave, and any other construction that produced a system with the same behaviour would serve equally well.
The same method goes further down and further up. The integers can be built from the natural numbers: declare pairs of natural numbers equivalent when , thinking of as "", which avoids assuming the subtraction it creates. Problem 12 carries this out. The natural numbers themselves can be built from sets alone: in the standard construction, due to John von Neumann, the number is the empty set and each later whole number is the set of those before it, so that , , and so on.
Going up, the real numbers cannot be built from by an equivalence relation on pairs, because there are "more" reals than pairs of rationals, a fact made precise later in the course. Both classical constructions were published in 1872. Richard Dedekind defined a real number as a "cut", a way of splitting the rationals into a lower and an upper part, and as the cut between the rationals whose square is below (together with all negative rationals) and the rest. Georg Cantor used sequences of rationals whose terms get closer and closer together, with two such sequences declared equivalent when their difference tends to : an equivalence relation again, on sequences rather than pairs, and a real number is a class of them. So each step of the ladder , , , above the first is built by the method of this lesson or a close relative.
Grouping and ranking
Equivalence relations group things. They say when two objects are the same for present purposes, cut a set into classes, and let the classes become objects in their own right, with operations of their own once those are shown to be well defined. Every equivalence relation is the kernel of a function, and every function is, up to a bijection, the quotient map of its kernel followed by an inclusion.
The other great kind of relation ranks things instead. The order on the numbers, on sets and divisibility on the positive integers are reflexive and transitive but far from symmetric: indeed they are antisymmetric, as two things each ranked below the other are the same thing. The lesson on order takes up these relations, and meets equivalence relations again at once: a relation that is merely reflexive and transitive, such as "divides" on all of , where and , becomes an order only after the elements it cannot tell apart are identified.
Problems
Work each problem on paper before opening anything; for Core and Challenge problems, try the hint before the solution.
Warm-up
1. For each relation on , decide whether it is reflexive, symmetric and transitive, giving a failing instance for each property that fails. (a) . (b) . (c) . (d) .
Solution
(a) Reflexive, since , , are all present. Symmetric: the only pairs with different entries are and , and each has its reverse. Transitive: in a chain in which one step is a loop, the conclusion is the other step, which is present; the only other chains are and , whose conclusions and are present. So is an equivalence relation, with classes and .
(b) Not reflexive: . Not symmetric: but . Transitive: the only chain of two pairs is , and .
(c) Not reflexive: . Symmetric, since each pair is its own reverse. Transitive: the only chains are and , whose conclusions are present. This is a symmetric, transitive relation that is not reflexive, and it fails at , the element related to nothing.
(d) Not reflexive: . Symmetric and transitive vacuously, since there are no pairs for the conditions to fail at.
2. Which of these are partitions of ? (a) The even integers and the odd integers. (b) The positive integers and the negative integers. (c) The sets , one for each integer . (d) The multiples of , the multiples of , and the integers divisible by neither. For each partition, describe the corresponding equivalence relation.
Solution
(a) A partition: both sets are non-empty, and every integer is even or odd and not both. The relation is " is even", congruence modulo .
(b) Not a partition: is in neither set.
(c) A partition. Each set has three elements, so is non-empty. Every integer lies in the set with equal to its quotient on division by , since with , and in no other, by uniqueness of the quotient. The relation is " and have the same quotient on division by ", the kernel of the function sending each integer to its quotient; for example , both having quotient , while and are not related.
(d) Not a partition: is a multiple of both and , so it lies in two blocks.
3. In , find the classes containing , and , and compute , and . In , find all classes with , and in all classes with .
Solution
, so . , so . , so .
, and .
In there are seven classes to try, and for is (for instance ). So is the only solution.
In , is exactly when , and trying gives , of which and are multiples of . So or : two solutions, and a non-zero product that is zero.
4. Write out, as a set of ordered pairs, the equivalence relation on whose classes are , and . How many pairs does it contain? In general, how many pairs does an equivalence relation on a finite set contain, in terms of the sizes of its classes?
Solution
Two elements are related exactly when they lie in the same class, so the relation is the union of over the classes :
that is, the nine pairs with , the four pairs , and : pairs.
In general, if the classes have sizes , the relation is the union of the disjoint sets , so it has pairs. The two extremes are equality, with classes of size and pairs, and the relation that relates everything, with one class and pairs.
Core
5. On the set of non-zero points of the plane, let when for some non-zero real number . Prove that is an equivalence relation, describe its classes geometrically, and prove that contains exactly one representative of each class.
Hint
For the three properties, find the that works in each case: , then , then a product. For the representatives, split on whether the first coordinate is zero.
Solution
Reflexive: . Symmetric: if with , then with . Transitive: if and with , then with . So is an equivalence relation.
The class of is , the line through the origin and with the origin removed. So the classes are the lines through the origin, each with the origin deleted.
Representatives. Let be a non-zero point. If , take : then is in the class, and it has the form . If , then , and gives in the class. So every class contains at least one point of the set.
It contains only one. If , then , so and . And is not related to any , since every point related to has the form , with first coordinate . So distinct points of the set lie in distinct classes.
The quotient is the projective line: the set of directions through the origin, each line counted once. The representatives are labelled by the slope , and is the vertical line, the one direction with no slope.
6. Find the flaw in this proof, and show that the claim is false.
Claim. The rule defines a function from to .
Proof. We must check that is well defined. Suppose . Then and . Since , we have , and so . Hence is well defined.
Hint
What does actually tell you about and ?
Solution
The flaw is the step "since , we have ". Equal classes do not have equal representatives; by the lemma on classes, means only that , that is, . The whole point of checking well-definedness is to handle two different representatives of one class, and the proof assumed the difficulty away.
The claim is false. Take and . Then , but the rule sends this class to through the first name and to through the second, and since . So the rule does not define a function. By the argument of the Now you on well defined operations, is well defined when , and here .
7. For which positive integers does the rule define a function from to ? Prove your answer.
Hint
Try and . The value depends only on the parity of .
Solution
Exactly when is even.
Suppose is even, say , and let , so for some integer . Then is even, so and have the same parity (lesson on direct proof), and , since is for even and for odd . So the rule is well defined.
Suppose is odd. Then , since , but and because is odd. So one class receives two values, and the rule does not define a function.
(The exponent may be negative; still makes sense, since .)
8. Equivalence relations on a set are subsets of , so they can be intersected and united.
(a) Prove that if and are equivalence relations on , then is an equivalence relation on , and that the class of under is the intersection of its classes under and under .
(b) Identify the intersection of congruence modulo and congruence modulo on .
(c) Show that the union of congruence modulo and congruence modulo is not an equivalence relation.
Hint
For (b), use the Example in the lesson on direct proof: if and only if and . For (c), look for a chain that uses one relation for the first step and the other for the second.
Solution
(a) Reflexive: for , and , so . Symmetric: if , then and by symmetry of each, so . Transitive: if and are in , then both are in , so , and both are in , so ; hence . For the classes, is in the class of under exactly when and , exactly when lies in both classes of .
(b) For integers and : and are related by the intersection exactly when and , which by the result quoted in the hint holds exactly when . So the intersection is congruence modulo . Its classes are intersections of classes modulo and modulo , for instance .
(c) In the union, is related to (congruent modulo ) and is related to (congruent modulo ). But is not related to : is divisible by neither nor . So the union is not transitive, and not an equivalence relation. (It is reflexive and symmetric, as a union of reflexive and symmetric relations always is.)
9. Prove or disprove that each relation on is an equivalence relation. Where it is one, describe the classes. (a) when . (b) when . (c) when , where is the greatest integer at most .
Hint
Two of these are kernels of functions, which settles them at once. For the other, test a chain through .
Solution
(a) An equivalence relation. Directly: ; if then ; if and with , then . (Equivalently, it is the kernel of , the class of under the fractional-part relation.) The class of is , the set of over the integers . For example, the class of is .
(b) Not an equivalence relation. It is reflexive, since , and symmetric, since . It is not transitive: and , so and , but , so and are not related. The number is related to everything and joins the positive and negative numbers into one chain.
(c) An equivalence relation, since it is the kernel of the function . The classes are its non-empty fibres, one for each integer : the fibre over is . So the classes are the half-open intervals , , which partition .
10. Let be an equivalence relation on , with quotient map , and let be a function. Prove that there is a function with if and only if is constant on each class, that is, implies . Prove that such an is unique, and that it is injective if and only if implies .
Hint
The equation says for every , so it leaves no freedom in choosing . The question is only whether that formula is well defined.
Solution
() Suppose , and let . Then by the lemma on classes, so .
() Suppose is constant on each class. Define . This is well defined: if , then , so . Every class has a representative, so is a function on all of , and for every .
Uniqueness: if and both satisfy , then for every class , . Two functions with the same domain, codomain and values are equal, so . (Equivalently: is surjective, and surjections can be cancelled on the right.)
Injectivity: suppose implies , and let . Then , so and . Conversely, suppose is injective and . Then , so , and .
Together with the kernel theorem, this says a function out of a quotient is the same thing as a function on that respects the relation, which is how functions on quotients are defined in practice.
11. Decide whether each rule defines a function, and prove your answer. (a) , from to . (b) , from to . (c) , from to , and from to . What do the rules in (a) and (c) do to a rational number?
Hint
For each rule, take two related pairs and ask whether their images are related. For (b), try two names of ; note also that may be .
Solution
(a) Well defined. The pair lies in since . Let , so . Then , so . The rule is , since .
(b) Not a function. First, it can leave : would be sent to the "class" of , which is not in . And even where it stays inside it is not well defined: , but the images are and , and , so they name different rationals, and .
(c) On it is a well defined function. A non-zero rational has (since is zero, as ), so . If , then , which is the same equation as , the condition for . On all of the rule fails, because would go to the class of . The rule is .
Challenge
12. This problem builds the integers from the natural numbers, using only addition and multiplication in and the cancellation law (if then ). On , let when . Think of as standing for .
(a) Prove that is an equivalence relation.
(b) Prove that is well defined.
(c) Prove that is well defined.
(d) Prove that every class contains exactly one pair of the form with , or , or with , and exactly one of these three forms occurs.
Hint
Subtraction is not available in , so every step must be an equation between sums. For transitivity, add the two given equations and cancel. For (c), change one argument at a time: first show that replacing by a related pair gives a related product, then use the symmetry of the formula for the other argument. For (d), compare and .
Solution
(a) Reflexive: . Symmetric: is the same equation as , which says . Transitive: suppose and . Adding the equations gives , that is, , and cancelling gives , so .
(b) Let and , so and . Adding, , which says .
(c) First change the left argument. Let , so , and let be any pair. We need , that is,
Multiplying by gives , and multiplying by gives . Adding these two equations gives exactly the required one.
Now the right argument. The formula is symmetric: swapping the two pairs gives , which is the same pair as . So replacing by a related pair also gives a related product, by the first step with the roles exchanged.
Finally, if and , change one argument and then the other: the product for is related to that for , which is related to that for , and transitivity finishes it.
(d) Let . Exactly one of , , holds. If , then for a natural number , and , since . If , then , since . If , then , and , since .
No two different pairs of these forms are related. Two pairs and are related exactly when , that is, , and similarly for the third form. A pair is not related to , since that would need , that is, , which is not a natural number; similarly for the other combinations, would need . So each class contains exactly one pair of these forms.
The classes of play the part of the positive integers , the class of is , and the classes of are the negative integers . With read as , the formulas in (b) and (c) are the rules and .
13. Let be any relation on a set .
(a) Prove that the intersection of all equivalence relations on that contain is an equivalence relation containing , and that it is contained in every equivalence relation containing . It is called the equivalence relation generated by .
(b) On , let . Prove that the equivalence relation generated by is congruence modulo .
Hint
For (a), there is at least one equivalence relation containing to intersect. For (b), show two inclusions: congruence modulo is one of the relations being intersected; and any equivalence relation containing relates to , and hence, by induction, to .
Solution
(a) The family of equivalence relations containing is not empty: , which relates everything, is an equivalence relation containing . Let be the intersection of the family. It contains , since every member does. Reflexive: for , lies in every member, so in . Symmetric: if , then lies in every member, so does too, by symmetry of each member, and . Transitive: if and are in , they lie in every member, so lies in every member, and . Finally, an intersection of a family is contained in each member, so is contained in every equivalence relation containing . So is the smallest equivalence relation containing .
(b) Write for congruence modulo , for the relation generated by , and for .
: congruence modulo is an equivalence relation, and it contains , since and are even. By (a), is contained in it.
: first, for every integer . Indeed (taking in place of in the first set), so , and by symmetry . Also , so . By transitivity, .
Next, for every integer and every integer , by induction on . For this is reflexivity. If , then since by the first step, transitivity gives .
Now let , so for some integer . If , then . If , then with , so , and by symmetry. So , and the two relations are equal.
The same argument shows that the relation generated by the steps and is congruence modulo because is an integer combination of the steps. In general, steps and generate congruence modulo the greatest common divisor of and , which is Bézout's theorem in disguise.
14. Let and .
(a) Prove that there are exactly equivalence relations on with exactly two classes.
(b) Prove that there are exactly equivalence relations on with exactly classes.
Hint
Count partitions instead, by the partition theorem. In (a), a partition into two blocks is determined by the block containing . In (b), the class sizes are forced.
Solution
By the partition theorem, equivalence relations on with classes correspond one to one with partitions of into blocks, so it is enough to count partitions.
(a) Given a partition of into two blocks, let be the block containing . Then is a subset of containing , and , because the other block is non-empty. Conversely, every subset with and gives the partition into two blocks: both are non-empty ( contains , and is non-empty since ), they are disjoint, and they cover . The block of this partition containing is , and a partition into two blocks is determined by either block, so the two maps are inverse to each other.
So the count is the number of subsets of with and . A subset containing is for exactly one subset of , and there are such . Excluding leaves .
(b) In a partition of into blocks, the block sizes are positive integers adding to . If every block had one element the total would be , so exactly one block has two elements and the rest are singletons; a block of three or more, or two blocks of two, would push the total above . So the partition is determined by its one two-element block , and every two-element subset of arises from exactly one such partition (itself together with the singletons of the other elements). The number of two-element subsets of is : there are ordered pairs with , and each subset arises from exactly two of them.
For : relations with two classes, with three classes, and with the one relation with one class and the one with four, the total is , the Bell number .