Lesson 10
Integers
Taught
Formal Differences
At the end of the last chapter was a monoid in which cancellation holds and in which nothing but has an inverse. It is regular and it is not a group, and this chapter closes the gap between those two facts. We do not add an axiom and we do not assume the integers exist. We build them, out of the natural numbers we already have, by writing down what a difference ought to be and then declaring two of them equal when they ought to be equal.
Pairs and the Sum Criterion
Every integer we want is a difference of two natural numbers. We want to be and to be , and we want to be and as well: the pair recording the difference is not unique, and any construction must say when two pairs record the same thing.
The condition we want is , and as it stands that is not a statement about , since subtraction is available only when the answer stays in . But adding to both sides of it turns it into
which mentions nothing but addition and is a perfectly good statement about four natural numbers. That equation is the relation we put on pairs, and the rest of the chapter is built on it.
Definition 10.1 (Net-difference equivalence).
On the set declare
The relation is called net-difference equivalence, and the displayed equation is the sum criterion.
Read the pair as a formal stand-in for the difference , one that makes sense whether or not that difference exists in . Two pairs are related exactly when the differences they stand for ought to agree. The symbol is used for equivalence relations throughout mathematics and throughout this book; in this chapter it means only the relation just defined.
Proposition 10.2 (Net-difference equivalence is an equivalence relation).
The relation is an equivalence relation on .
Discussion.
Three properties to check, and each unfolds the sum criterion into a statement about addition in . Reflexivity asks for , which is commutativity. Symmetry asks that give , which is the same equation read backwards with the two sides commuted. Transitivity is the only part that needs work: two sum criteria are given and a third must be produced, and the obstacle is that the middle pair appears in both hypotheses and in neither conclusion. The way to remove it is to add to the first equation so that the second becomes substitutable, and then to strip the surviving off both sides by cancellation, the property that made regular.
Proof.
For reflexivity, by the laws of addition, so .
For symmetry, suppose , so . Commuting each side gives , which is the sum criterion for .
For transitivity, suppose and , so
Adding to the first equation and rearranging by associativity and commutativity gives . The second equation replaces on the right by , so
Cancelling leaves , which is .
The Net Difference
The sum criterion is easy to check but does not describe what a class looks like. A second description of the same relation gives each pair a standard representative: compare the two coordinates using trichotomy and subtract the smaller from the larger.
Definition 10.3 (Net difference).
The net-difference function
is defined by
where is the difference of the order chapter: the unique element with , which exists because .
By trichotomy the three clauses cover every pair exactly once, so is a function. Informally, with is a positive difference, a negative one, and is zero; the next few propositions make that reading precise and tie back to .
Proposition 10.4 (Coordinates of a net difference).
Let . Then at least one coordinate of is , and
- if with , then ;
- if with , then ;
- if , then .
Discussion.
The opening claim is read straight off the definition, every clause of which puts a in one coordinate. The three numbered parts run the definition backwards, which is legitimate because the three cases are mutually exclusive: given the value of , we ask which clause could have produced it and find that only one can. For the first two the argument is that the other two clauses put in the coordinate that is here positive. The third is the leftover case and is best argued by contradiction: if then trichotomy puts one of them strictly below the other, and either way one coordinate of is a positive natural number, so the value is not .
Proof.
Trichotomy gives exactly one of , , , and each of the three clauses of the definition places in at least one coordinate.
Suppose with . The second and third clauses put in the first coordinate, so neither produced this value, and the first clause applies; hence . The same argument with the coordinates exchanged gives the second part.
For the third, suppose . Trichotomy gives or . In the first case and is positive, since would give ; in the second case the second coordinate is positive for the same reason. Either way .
Proposition 10.5 (Shifting both coordinates).
For all ,
Discussion.
An equality of values of , so we split on the trichotomy comparison of with and check the three cases separately. Shifting does not change the comparison: adding a fixed element preserves the order, so if then and both sides of the claimed equality are produced by the same clause. Once that is known the two sides are and , and what remains is that shifting both arguments leaves the difference alone, which is uniqueness of differences applied to the defining equation. The case is the same with the coordinates exchanged, and is immediate.
Proof.
Suppose . Then , so
Write , so and hence by associativity and commutativity. Uniqueness of differences therefore gives , and the two values agree.
If the same argument applies with the coordinates exchanged. If then , and both sides are .
Proposition 10.6 (Equal net differences satisfy the sum criterion).
If , then .
Discussion.
The hypothesis is an equality of pairs and the conclusion an equality of natural numbers, and we must convert one into the other, and the conversion depends on which of the three shapes the common value has. We therefore split on the comparison of with , and in each case the previous proposition on coordinates transfers the same comparison to and . Once both pairs are known to be of the same shape with the same entry , the defining property of the difference rewrites the hypothesis as and , two equations with no subtraction in them, and substituting both into produces after rearrangement.
Proof.
Suppose first that . Then with , so as well; by the proposition on coordinates , and . Hence and , and
by associativity and commutativity.
The case is the same argument with the coordinates exchanged. If then , so and ; then reads .
Proposition 10.7 (The sum criterion yields a common shift).
Let and satisfy with . Then there is with
Discussion.
An existence claim, and the hypothesis gives the witness directly: the description of the associated order says that is exactly the existence of an with . It remains to check that the same works in the other coordinate. Substituting for in the sum criterion and rearranging leaves in front on both sides, and cancelling it gives .
Proof.
Since , there is with . Then
the first equality being the sum criterion and the last associativity and commutativity. Cancelling gives .
Three readings of “the same formal difference” are now available, and they agree.
Theorem 10.8 (Characterisations of net-difference equivalence).
Let and lie in . The following are equivalent.
- .
- .
- Either and for some , or and for some .
Discussion.
Three conditions asserted to be equivalent, so rather than six implications we run a cycle through them, in the manner already used for equivalence classes. The first arrow, from the net difference to the sum criterion, is the proposition just proved. The second, from the sum criterion to the shift, is the other proposition together with a case split: the shift condition offers two alternatives because the previous proposition needed , and trichotomy guarantees that one of and holds, each giving one alternative once the roles of the two pairs are exchanged. The third arrow, from the shift back to the net difference, is the proposition on shifting both coordinates, read in one direction for the first alternative and in the other for the second.
Proof.
That the first implies the second is the proposition on equal net differences.
Suppose the second holds. If , the proposition on common shifts gives with and , which is the first alternative of the third condition. Otherwise by trichotomy, and the same proposition applied to the pairs in the other order — the sum criterion being the given equation read backwards — gives with and , which is the second alternative.
Suppose the third holds. Under the first alternative, the proposition on shifting both coordinates gives
Under the second it gives . Either way the first condition holds, and the cycle is closed.
Remark (Which characterisation to use).
Each of the three is the convenient one somewhere below. The sum criterion is easiest to use in algebra, since it is an equation in and nothing else, and every well-definedness check in this chapter uses it. The shift criterion says that two pairs agree when one is the other with the same amount added to both coordinates. The net difference gives each class a single named representative, and that is what lets us say what the integers are rather than only when two of them are equal.
Compute and .
Show that for every , from the defining property of the difference. Deduce that and for all , and hence that .
Prove the proposition that is an equivalence relation a second time, taking the first condition of the theorem as the definition of and checking the three properties directly from properties of .
The Integers
Integers as Classes
Definition 10.9 (The integers).
The set of integers is the quotient
of by net-difference equivalence. We write for the class of the pair .
No axiom has been added. The set is carved out of a product of two copies of by a relation already checked to be an equivalence, and both of those operations have been available since the chapters on sets and on relations. What remains is to define the arithmetic.
By the theorem and the proposition on coordinates, every class has exactly one representative among the pairs
these being the values takes, and appearing once in the first list. We call it the normal form of the class. In particular when , and when .
Discussion.
Injectivity is the statement that equal values force equal arguments, so we assume and must reach . Equal classes mean related representatives, by the characterisation of equivalence classes, and the sum criterion for those two particular pairs is , which is the conclusion up to two zeros.
Proof.
Suppose . Then , so by the sum criterion, and by the identity law for addition.
So embeds in , and the normal form says every class is either for a unique , or for a unique . Once addition is in place the second family will turn out to be the additive inverses of the first.
List five distinct pairs in the class , and give the normal form of that class.
Show that if and only if .
Addition and Negation
The arithmetic must be defined on classes, but the only formulae available are written with pairs. We follow the same pattern three times: define the operation on pairs, prove that equivalent inputs give equivalent outputs, and only then pass to classes. The middle step ensures that the result does not depend on which representatives were picked.
Pretend for a moment that differences already exist. Then and
and those two identities suggest the definitions on pairs. Nothing below uses this; it only motivates the definitions.
Definition 10.11 (Pre-negation).
The pre-negation of a pair is the pair .
Proposition 10.12 (Pre-negation respects equivalence).
If , then .
Discussion.
Hypothesis and conclusion are both sum criteria, so both unfold into equations in . The hypothesis is . The conclusion, written out for the pairs and , is . Those are the same equation with the two sides exchanged, so symmetry of equality is the whole proof.
Proof.
The hypothesis is . Reading it backwards gives , which is the sum criterion for .
Define negation on by
By the proposition just proved, the right-hand side depends only on the class of and not on the representative chosen for it.
Definition 10.14 (Pre-addition).
Define pre-addition on pairs by
Proposition 10.15 (Pre-addition respects equivalence).
If and , then
Discussion.
Two sum criteria are given and one is wanted, and since all three are equations between sums in we add the two hypotheses together. What comes out is an equation whose two sides are the four summands in some order, and the general associativity and rearrangement available in any abelian semigroup lets us collect them into the grouping the conclusion asks for. No case split and no cancellation are needed.
Proof.
The hypotheses are and . Adding the two equations and rearranging the summands on each side gives
which is exactly the sum criterion for .
Definition 10.16 (Addition and subtraction).
Define addition on by
which the previous proposition makes independent of the representatives; and for define .
Theorem 10.17 (The integers form an abelian group).
With the addition just defined, is an abelian group. Its identity is and the inverse of is . Moreover
and .
Discussion.
The definition of a group asks for four things and the last claim adds a fifth, but every one of them is a law in applied in each coordinate, so the proof is a sequence of short computations. Associativity and commutativity of the new addition are associativity and commutativity of the old one, used once in each coordinate. The class is an identity because is one in . The only step that needs thought is the inverse: adding to gives the class of , and this is not because the two coordinates are zero (they are not) but by the sum criterion, which asks only that . That is commutativity. The claim about is the definition of addition read on pairs whose second coordinate is .
Proof.
Let , and . Then
by associativity of addition in in each coordinate, so the operation is associative; and by commutativity in each coordinate. So is an abelian semigroup.
Next,
so is an identity, and it is the only one by uniqueness of the identity. Finally
the last equality by the sum criterion, which asks for and gets it from commutativity. So every element is invertible and is an abelian group.
For the last claim, , and by definition.
In particular , so the classes with normal form are precisely the additive inverses of the embedded positive naturals. Every integer is therefore for a unique or for a unique , which is the normal form restated using addition. Writing for and for , the familiar list names every integer exactly once.
Remark (What was gained).
The chapter on groups observed that is regular but not a group, and said that regularity is the condition needed to enlarge a monoid into a group. This theorem does that for . The regularity was used once, in the proof that is transitive, and without it the relation would not be an equivalence and there would be no quotient.
Compute and , and give each answer in normal form.
Prove directly from the definitions that and for all . Which of the two also follows from a proposition of the chapter on groups, and why does the other not?
Show that for all , so that every class really is a difference of two embedded natural numbers.
Multiplication
Pretend again that differences exist. Then
and the rule on pairs is forced.
Definition 10.18 (Pre-multiplication).
Define pre-multiplication on pairs by
Proposition 10.19 (Pre-multiplication respects equivalence).
Let . Then for every pair ,
Likewise, if then for every .
Discussion.
Two statements, one for each factor, and together they are what a definition on classes needs: changing the representatives one at a time changes them both. Each is again an implication between sum criteria, but unlike the additive case the hypothesis cannot simply be added to something, because the conclusion involves products. So we write down the sum criterion the conclusion asks for, expand both of its sides using distributivity in , and regroup the terms until the hypothesis becomes visible. The left side collects into and the right into ; the hypothesis says the two bracketed factors are equal, so the two sides are the same sum written twice. The second statement is the first with the roles of the factors exchanged, which is legitimate because pre-multiplication is symmetric in its two arguments.
Proof.
Assume . The two pre-products are
and the sum criterion for their equivalence asks that
Regrouping the left side by distributivity, associativity and commutativity gives , and the right side gives . Writing for the common value of and , both sides are , so they agree.
For the second statement, pre-multiplication is unchanged when its two arguments are exchanged, since and are symmetric under exchanging with ; so the first statement applied to the exchanged pairs gives it.
Definition 10.20 (Multiplication).
Define multiplication on by
which the previous proposition makes independent of both choices of representative.
Theorem 10.21 (Distributivity in the integers).
For all ,
Discussion.
An identity between two integers, so we name representatives for the three of them and compute both sides down to a single class each. The left side expands by the definition of addition and then of multiplication, the right side by multiplication twice and then addition, and each expansion is an application of distributivity in inside a coordinate. The two resulting pairs then have the same four terms in each coordinate, in a different order, so commutativity of addition finishes. We write the computation with the pairs visible, since the identity holds coordinatewise.
Proof.
Let , and . Then , so
while
The two pairs have the same terms in each coordinate, so they are equal by commutativity of addition in , and the two classes agree.
Proposition 10.22 (The embedding preserves multiplication).
For all we have . Moreover is an identity for multiplication on all of .
Discussion.
Two computations, each one line. For the first, expand by the definition: both second coordinates are , so three of the four products in the formula vanish and what is left is , which is . The second claim is not the case of the first, since that only says acts as an identity on the image of , and the image is not all of ; so it needs its own computation, which is the same expansion carried out against a general class. Only one side need be checked, because pre-multiplication is symmetric in its arguments.
Proof.
For the first claim,
For the second, let be any class. Then
and the other side is the same computation, pre-multiplication being symmetric in its two arguments.
Remark (What is left to check).
The remaining algebra (associativity and commutativity of multiplication, the sign rules and , and the absence of zero divisors) follows the pattern of this section without exception: name representatives, expand, and quote the corresponding law in . None of it needs a new idea, so it is set as problems. What is still missing is the order on .
Prove that multiplication on is commutative and associative.
Prove that and for all .
Prove that if and , then or . Reduce to normal form first, and then use that a product of positive natural numbers is positive.
Using the problem that , show that if and only if in .
The Order on the Integers
So far nothing distinguishes from except the labels; the arithmetic treats them alike. The order does distinguish them, and we define it from the normal form, which sorts every class into one of three shapes.
Definition 10.23 (Positive integers).
An integer is positive if for some .
Proposition 10.24 (Every integer has exactly one sign).
Let . Then exactly one of the following holds: is positive; ; for a positive .
Discussion.
The claim is that three cases cover and no two of them overlap, so there are two halves to it. Coverage is the normal form: every class is with or with , and the first of those is , positive when and when , while the second is by the remark following the group theorem. Exclusivity is the uniqueness half of the normal form, together with the injectivity of : two of the cases could only collide if two distinct normal forms named the same class, or if identified with something in .
Proof.
Every class has exactly one normal form. If it is with , then is positive. If it is , then . If it is with , then with positive. So the three cases cover .
For exclusivity, suppose is positive and also . Then for some , so by injectivity of , contradicting . Suppose is positive and also with . Then has normal forms and with , and those are different pairs, contradicting uniqueness. The same argument rules out .
Proposition 10.25 (Positive integers are closed under the operations).
If and are positive, then so are and .
Discussion.
Both claims say that a value built from two positive integers is again of the form with , and the two facts that produce such a form are already proved: carries sums to sums and carries products to products. So each claim reduces immediately to the corresponding closure in , which is the proposition that the positive natural numbers are closed under addition and multiplication. Nothing about is used beyond the two formulas for .
Proof.
Write and with . Then and , and both and lie in . So both values are positive.
Theorem 10.27 (The integers are strictly ordered).
The relation is a strict linear order on .
Discussion.
Two conditions are asked for. Transitivity is a computation: from and positive we must produce positive, and the way to reach from those two is to add them, since the middle terms cancel in the group ; the previous proposition then keeps the sum positive. Trichotomy is the proposition on signs, applied not to or but to the single integer : its three cases say that is positive, or zero, or the negative of a positive, and those are exactly , and since . That last identity is the rule for the inverse of a product read additively, together with .
Proof.
For transitivity, suppose and , so and are positive. Their sum is positive by the previous proposition, and
by associativity and the inverse law in . So .
For trichotomy, let and apply the proposition on signs to . If is positive then . If then, adding to both sides, . If with positive, then is positive, so . Exactly one of the three cases holds, and they are the three alternatives trichotomy demands.
Proposition 10.28 (The order and the operations).
Let .
- If then .
- If and is positive, then .
- if and only if , for all .
Discussion.
Each part unfolds the definition of into a statement about a difference being positive, so each is settled by computing that difference. In the first the difference is , and the two copies of cancel in the group, leaving unchanged: so the hypothesis is the conclusion. In the second the difference is , which factors as by distributivity together with the sign rule , and the previous proposition then multiplies two positives. Both of those facts about multiplication were set as problems above, and we quote them. The third is the definition of on each side: is when , so positivity of the difference in says exactly what says in .
Proof.
For the first, by associativity, commutativity and the inverse law, so one difference is positive exactly when the other is.
For the second, the problems on multiplication give , and distributivity gives
If then is positive, and is positive, so the product is positive by the previous proposition; hence .
For the third, suppose in . Then with , so , which is positive; hence . Conversely, if then for some , so and by injectivity, giving .
Corollary 10.29 (One is the least positive integer).
If is positive, then .
Proof.
Write with . Then , since is positive and has least element among its own members, so by the third part of the proposition.
Remark (Dropping the embedding from the notation).
From here on we write for and for , and treat as a subset of . This is harmless, by the proposition on the order: carries sums to sums, products to products, and the order to the order, and it is injective, so every statement about transfers unchanged to its image and back. The positive integers are then exactly , the list
names every integer exactly once, and by the corollary.
Show that if and only if , and that is positive if and only if .
Show that if and then , and that for every , with equality only at .
Show that no integer lies strictly between and , and deduce that has no maximum and no minimum.
Sequences, Sums and Products
Many of our notions are already functions. Addition is a map , iteration is repeated composition, and counting a finite set is a bijection . A sequence is the same idea read in the other direction: a list of values is a function whose domain is a set of indices. That notion is not new: finite and infinite sequences were defined in the chapter on relations, and the summation symbol in the chapter on the natural numbers. What is new is that the indices may now run over an interval of integers rather than an opening stretch of , which makes it easier to write a sum starting at or at , or to shift one along.
Indexing by an Integer Interval
Definition 10.30 (Integer intervals).
For with , write
and for write
The first is finite and the second is not, as the next paragraph records. When and the interval is exactly the block .
Proposition 10.31 (Intervals are finite and are counted by their length).
Discussion.
The first claim is an existence statement about a bijection, and the map comes from the shape of the interval: an element of is plus something, and the something is bounded by the length. So we only check the two halves of bijectivity, and both come from the order: injectivity is cancellation for addition in , and surjectivity is the observation that makes a natural number below . The cardinality is then read off, a cut having elements. The last claim is a contradiction: a finite subset of a totally ordered set has a maximum, and the ray has none, since is always a larger member.
Proof.
Write , a positive integer since . If then , so and the map lands in the interval. It is injective because gives by cancellation, and surjective because makes a natural number with , so and .
Hence and .
Were the ray finite it would be a non-empty finite subset of the totally ordered set , hence would have a maximum ; but lies in the ray and , which no upper bound permits.
Definition 10.32 (Sequences on an interval).
Let be a set. A finite sequence in indexed by is a function , and an infinite sequence indexed by is a function on that ray. One writes for , calls the -th term and the index, and calls the domain the index set.
Composing with the bijection of the proposition turns such a sequence into one indexed by a cut, and back again, so this is the notion of the chapter on relations with the indices relabelled and not a second notion. The gain is convenience: one may now write a rule on a generic index, as in ” for ”, and start wherever the problem starts. The index is a bound variable and may be renamed, so the same sequence is equally for .
Remark (Shifts are different functions).
A finite sequence is commonly written , or when the index set is understood, and sequences may be built from sequences: is a sequence once is one. But
are not equal, even though they list the same values in the same order. Their domains differ, and functions with different domains are different functions. One is a shift of the other, and the theorem on index shifts below is what relates their sums.
Take the values . Give a finite sequence with exactly those terms, and name its index set. Write a shifted sequence with the same values in the same order, and extend the original to an infinite sequence.
Let be a finite sequence and let . Show that and have the same image, but are equal as functions if and only if .
Sums over an Interval
Definition 10.33 (Summation over an interval).
Let be a sequence with values in a set carrying an operation written , and let lie in its index set. For every in that index set define
That the clauses determine one value at each is the recursion theorem, applied after the running length has been shifted into ; it is the same argument that produced the summation symbol in the chapter on the natural numbers, and taking with values in a Peano system recovers that symbol exactly. What the present definition adds is an arbitrary lower limit and an arbitrary value set: needs an operation and nothing else. If every term lies in a subset of closed under , the sum lies there too, since the recursion never leaves that subset.
Proposition 10.34 (An interval sum is a left-associated sum).
Let be a set with an operation and let . Then
where is the left-associated product of the chapter on groups, written additively.
Discussion.
Both sides are defined by a recursion, and the claim is that the two recursions are the same one in different notation. So the proof is an induction on the number of terms in which each step compares the two recursive clauses: the base cases are the single-term clauses, which both give , and the step appends on the right in both definitions. Nothing about is used. We record it because it lets us quote the results of the chapter on groups here instead of proving them again.
Proof.
Induct on with . At both sides are . If the two agree at , then
the outer equalities being the recursive clauses of the two definitions and the middle one the inductive hypothesis.
Theorem 10.35 (Splitting a sum).
Let be a semigroup and let and in , with defined on . Then
Discussion.
This is the splitting identity of general associativity, which says a left-associated product may be cut anywhere, and the previous proposition has just identified an interval sum with such a product. So we only need to match the two statements: the cut after the -st term of the interval corresponds to the cut after the -th factor of the list, and the two blocks are the two sub-intervals.
Proof.
Write the list , of length , and cut it after position , which satisfies . The first part of the theorem on general associativity gives
and the previous proposition rewrites each of the three left-associated sums as the corresponding interval sum.
Remark (Moving parentheses).
Once is associative the outer bracketing of a finite sum is irrelevant, and the theorem is the interval form of that fact. The reading fixed by the definition is the left-associated one, so means , and the theorem equates it with and with . It does not reorder the terms. Reordering needs commutativity, which the rearrangement corollary supplies for a list and the last section of this chapter supplies for an unordered index set.
Theorem 10.36 (General distributivity).
Let carry operations and with for all . Then for and ,
Discussion.
An identity over an interval whose length is not fixed, so it is an induction on that length, with the upper limit climbing from to . The base is the single-term clause, where both sides are . The step uses the hypothesis on once: expand the left side by the recursive clause, apply the binary distributive law to split across the two summands, replace the shorter sum by the inductive hypothesis, and reassemble by the recursive clause on the right. Associativity is not needed anywhere, so the theorem is stated for any pair of operations.
Proof.
Induct on , writing . At both sides are . Suppose the identity holds at and . Then
by the recursive clause, distributivity, the inductive hypothesis, and the recursive clause again. Taking gives the theorem.
If the multiplication is not commutative the matching right-hand law, , is proved by the same induction from the right distributive law.
Theorem 10.37 (Termwise sums, zeros and negatives).
Let and let and be defined on .
- If is an abelian semigroup, then .
- If has an identity for , then .
- If is an abelian group, then .
Discussion.
The first two are inductions on the length, of the same shape as the one just done. In the first the step produces a four-term expression on the left and must match a four-term expression on the right, and the matching is a rearrangement, so this uses commutativity as well as associativity. In the second the step adds one more to a running total already equal to , and . The third needs no induction: by the first two parts the two sums add to , so each is the inverse of the other by uniqueness of inverses.
Proof.
For the first, induct on with . At both sides are . At the step,
and rearranging the four summands by associativity and commutativity gives .
For the second, induct likewise: the single-term sum is , and .
For the third, the first two parts give
and the same computation in the other order, so is an inverse of and hence is .
Let be a set with an operation, let , and let . Then
Discussion.
First, the right-hand sum makes sense, because gives , so every term named is a term of . The identity itself is an induction on the length: at the base both sides are , and at each step the term appended on the left is while the term appended on the right is , and those are the same element. This is the relation between shifted sequences mentioned earlier: two different functions with the same sum.
Proof.
Induct on , writing . At both sides are . If the identity holds at , then
by the recursive clause, the inductive hypothesis, and the recursive clause again.
Proposition 10.39 (Agreement on an interval).
Let and be sequences in whose index sets both contain , and suppose for every in that interval. Then their sums over it agree.
Discussion.
We need this because a sequence may be defined on a larger index set than the one being summed over, so the two sequences need not be equal as functions. The sum depends only on the terms named: equal single terms give the base, and the recursive clause appends equal terms at each step, so equality is preserved all the way up.
Proof.
Induct on . At both sums are . If the sums to agree and , the recursive clause appends to each.
Using only the definition, show that , that , that , and that .
Show that the binary distributive law in is the case , of general distributivity, and that the case , , of the splitting theorem is the ordinary associative law.
Show that agrees with the summation symbol of the chapter on the natural numbers when and the values lie in a Peano system with addition.
Products over an Interval
Definition 10.40 (Products over an interval).
Let have values in a set carrying an operation written multiplicatively, and let lie in its index set. For define
Everything proved for sums holds for products, because nothing proved for sums used anything about beyond the recursion and the laws named in each hypothesis. Replacing by and by throughout turns each statement above into its multiplicative twin, and each proof into a proof of it: the splitting theorem, general distributivity read the other way, termwise products, the product of ones, the index shift, and agreement on an interval. We use them under those names without restating them, and taking recovers the product symbol of the chapter on the natural numbers.
One consequence is used often when taking products apart.
Proposition 10.41 (Splitting off the first factor).
Let have a multiplication with identity , and let . Then there is with
Discussion.
An existence claim, and there are two cases according to whether the interval has one term or more. If the product is itself, and serves, which is the only place the identity element is needed. If the splitting theorem cuts the product after the first factor, and the second block is the required ; no computation is involved beyond naming it.
Proof.
If then , so serves. If then the splitting theorem with the cut after the first factor gives
so the second block serves as .
Remark (Left association as the default).
An unbracketed means the sum of the three-term sequence, hence , and longer unbracketed sums and products are read the same way. That matches the convention already fixed for the left-associated product and for composition of functions. The factorial may now be written for , with the empty product already recorded there.
Using only the definition, expand for and check that the reading is left-associated. State the identity obtained from the splitting theorem for products with , , .
Sums over an Unordered Index Set
An interval carries an order, so its terms arrive in a fixed sequence. When is commutative as well as associative the order should not matter, and then the index set need not be ordered at all: one wants for an arbitrary finite . Throughout this section is a commutative monoid (associative, commutative, with an identity ), and means a function .
The plan is to sum along an ordering and then prove the answer independent of it.
Definition 10.42 (Sum along an ordering).
Let be finite with , let have values in , and let be a bijection, with . Define
Proposition 10.43 (Peeling the last index).
Let , let be a bijection, put , and let be the restriction of to a bijection . Then
Discussion.
First, the restriction is a bijection onto because is injective and , so nothing below is sent to . The identity itself splits into two cases. When the left side is and the right side is , so the identity law applies; this is where the convention for the empty sum is used. When the recursive clause peels the last term off the interval sum, and what is left is the interval sum of over ; that agrees with the sum along because the two sequences take equal values there, which is the proposition on agreement.
Proof.
If then , the left side is , and the right side is .
If the recursive clause gives
and . The sequences and agree on , so their sums there agree by the proposition on agreement, and that sum is the sum along .
Proposition 10.44 (The ordering does not matter).
Let be finite with and let be bijections. Then
Discussion.
The claim is universal in and we use strong induction, since the step will need the hypothesis at as well as at . At and there is only one bijection available, so there is nothing to compare. For we look at where the two orderings put their last element, and . If they agree, peeling both by the previous proposition leaves two sums over the same smaller set, which the hypothesis identifies. If they differ, we cannot peel to a common set in one step, so we take two: choose an ordering of ending at and an ordering of ending at (these exist because a transposition rearranges any ordering to end where we like), and peel each side twice. Both sides then reduce to the same sum over with and attached, in opposite orders, and commutativity finishes.
Proof.
We first record that for any there is a bijection sending to : take any bijection and compose it with the transposition of and in , which is a bijection.
Now induct strongly on . If the two bijections coincide, since has one map to and has one map to a singleton.
Let and assume the claim for all index sets of smaller cardinality. Put and , with restrictions as in the previous proposition.
If , peeling both sides gives sums over along and along , which agree by the inductive hypothesis, so the two sides agree.
If , choose a bijection with and a bijection with , and let be their restrictions to bijections onto . Write for the common value of the sums over along and along , equal by the inductive hypothesis. Peeling twice on each side,
where the inductive hypothesis at was used to replace by and by . Associativity and commutativity make the two right-hand sides equal.
Definition 10.45 (Sum over a finite index set).
Let be finite and let have values in . Define
for any bijection , which the previous proposition makes independent of the choice.
Proposition 10.46 (Agreement with interval sums).
If in , then .
Discussion.
The two sides are sums of the same terms under two definitions, and to compare them we need a bijection , which the proposition on intervals gives: is one, with . Summing along it produces an interval sum from to of the shifted sequence, and the index-shift theorem carries that back to the sum from to . So the work is in the index shift.
Proof.
Put . The map with is a bijection, with inverse . Hence
the last step being the index shift with .
Theorem 10.47 (Peeling and splitting).
Let be finite and let have values in .
- If then , and if then .
- If then .
- If with , then .
Discussion.
The first part is the definition, read at the two smallest index sets. The second is the proposition on peeling for a chosen element: that proposition peeled whichever element the ordering put last, and since the sum no longer depends on the ordering we may choose one that puts the element we want there, which the transposition trick supplies. The third is the main one and is proved by building an ordering of out of orderings of the two pieces, laid end to end; it is a bijection because the pieces are disjoint, and the cardinality of a disjoint union says its domain has the right size. Summing along it and cutting after the first block is the splitting theorem, and the second block needs an index shift to be recognised as a sum over . The empty cases are handled first, since an ordering of an empty piece is not available to concatenate.
Proof.
The first part is the definition together with the case of peeling.
For the second, choose a bijection with , as in the proof of the previous proposition, and apply peeling; the two sums are independent of the orderings by that proposition.
For the third, put and , so . If then and , and the claim reads ; the case is the same. Suppose both are positive, choose bijections and , and define by
Disjointness of and makes injective, and it is surjective because is their union. Then
by the splitting theorem. The first block is . In the second, the index shift by turns it into , which is .
Let and be finite, let have values in , and let be a bijection. Then
Discussion.
Both sides are defined by choosing an ordering, and the sum does not depend on which, so we are free to choose orderings that make the two sides identical term by term. An ordering of produces one of by composing with , since a composite of bijections is a bijection; and the -th term of the left sum along is , which is the -th term of the right sum along . So the two interval sums are the same sum.
Proof.
If then and both sides are . Otherwise put and choose a bijection . Then is a bijection, and
each outer equality being the definition of the sum over an index set.
Corollary 10.49 (Rearranging a sum).
Let be finite and let be a permutation of . Then .
Proof.
Reindexing with .
That is the general commutative law for sums, and the rearrangement corollary of the chapter on groups is the case where is an interval and is written as a permutation of positions. Termwise addition carries over to unordered index sets the same way: choose an ordering and quote the interval statement.
Proposition 10.50 (Termwise sums, unordered).
Let be finite and let and have values in . Then
Discussion.
The empty case is the identity law, . Otherwise choose any ordering; each of the three sums becomes an interval sum along it, and the interval version of termwise addition applies to the two ordered sequences. The choice of ordering does not matter, by the proposition on independence.
Proof.
If both sides are . Otherwise let and let be a bijection. Then
by the interval theorem on termwise sums.
Everything in this section holds for products over a commutative monoid written multiplicatively, with in place of ; the definitions, the independence of the ordering, peeling, splitting, reindexing and the commutative law all carry over under that substitution, and their proofs with them.
State the product analogues of the definition of and of the peeling and splitting theorem, and say which line of each proof changes.
Let and let be the permutation . Expand both sides of the rearrangement corollary for a general in .
Let and be finite and let for and . Show that summing along first and then along gives the same element as summing along first and then along .
Divisibility
is a group and is not, since only and have multiplicative inverses. So exact division inside is rare. The study of when one integer divides another is number theory, and this section is its beginning.
Divisors
Proposition 10.51 (The only invertible integers).
Let with . Then either or .
Discussion.
The hypothesis pins a product to a particular value, and we use the order to get information about the factors. So we work through the signs. Neither factor can be , since a product with a zero factor is and . They cannot have opposite signs, since a positive times a negative is negative while is positive. That leaves both positive or both negative. If both are positive, each is at least by the corollary on the least positive integer, and if were strictly larger than then multiplying that inequality by the positive would push above and so above ; so , and then . The negative case is the positive one applied to and , whose product is again .
Proof.
Neither factor is , since . If one is positive and the other negative, their product is negative, while is positive; so both are positive or both are negative.
Suppose both are positive. Then and . If , multiplying by the positive gives , contradicting . So , and .
If both are negative then and are positive and , so and .
Definition 10.52 (Divisibility).
Let with . Then divides , written , if for some ; in that case is a divisor of and a multiple of . When does not divide we write .
The condition is part of the notation: wherever appears as a hypothesis, is part of it. Usage keeps divisor for the general statement and factor for a number appearing in a particular product, so and are the positive divisors of , while and are the factors of in the expression . This is the notion the problem on divisibility introduced for natural numbers, now stated where negative multipliers are available.
An integer whose only positive divisors are and is prime.
This makes precise a word we have used informally since the first chapter, and it restates two old results: that is even says exactly that , and the proposition that odd squares are odd now reads if and only if . The four rules below are the basic arithmetic of divisibility.
Proposition 10.54 (The arithmetic of divisibility).
Let with the divisors below non-zero.
- If and , then .
- If and , then .
- If and , then for all .
- If or , then .
Discussion.
All four are proved the same way. Each hypothesis unpacks by the definition into an equation with an integer, and each conclusion asks for one integer of the same shape; so in every case the work is to substitute the hypotheses into the expression named in the conclusion, regroup by associativity, commutativity and distributivity until a single factor of the intended divisor stands in front, and observe that what remains in the bracket is an integer because is closed under the operations. The first substitutes one equation into the other and takes the product of the two multipliers. The second multiplies the two equations and regroups. The third is the one where the shared divisor matters: both unpackings carry the same , so distributivity pulls it out of the combination. The fourth is a disjunction, hence two cases, each of which is the first line of the others. Nothing needs the order, and nothing needs a case split on sign.
Proof.
For the first, write and . Then , and , so .
For the second, write and . Then by associativity and commutativity, so .
For the third, write and . For any ,
by distributivity, and , so .
For the fourth, suppose , so . Then and , so . If instead , the same argument applies with and exchanged.
Corollary 10.55 (Sums and differences).
If and , then and .
Proof.
Take , and then , , in the third part of the proposition.
Theorem 10.56 (Each factor divides the product).
Let be a sequence in defined on with , and let with . Then
Discussion.
The conclusion asks for the product to be written with standing in front, so we move there. If is the first index, the proposition on splitting off the first factor has already done it. Otherwise cut the product just before by the splitting theorem for products; the second block now begins at , so splitting off its first factor exposes , and what is left is the first block times whatever followed. Commutativity and associativity of multiplication in then move to the front of the whole, and the remaining bracket is an integer because a product of integers is one. The hypothesis is needed only because the divisibility symbol demands it.
Proof.
If , the proposition on splitting off the first factor gives for some , so divides the product.
Suppose . The splitting theorem for products, cutting before , gives
and splitting off the first factor of the second block writes it as for some . Writing for the first block,
by commutativity and associativity, and . So divides the product.
Division with Remainder
Non-divisibility is harder to use than divisibility, because it gives no equation. Instead we use the remainder, and every integer has exactly one. That was proved for in the chapter on order; it extends to with one extra step.
Theorem 10.57 (Division with remainder in the integers).
Let and . Then there is exactly one pair with
Discussion.
An existence-and-uniqueness claim, and the two halves need different arguments, as they did over . For existence we look for the remainder rather than the quotient: the numbers that land in form a set to which well-ordering applies, provided it is non-empty. That is the one new step, since a negative leaves nothing when ; taking works, because multiplying a negative by only makes it more negative. Minimality of the least member then forces it below , since otherwise one more could be subtracted. Uniqueness is the argument from the earlier theorem word for word: two decompositions give a multiple of equal to a difference of remainders, which is trapped strictly between and and so is .
Proof.
For existence, let . It is non-empty: if then gives ; and if then gives , since and .
Well-ordering supplies , with for some and . If then and , so ; but because is positive, contradicting minimality. Hence .
For uniqueness, suppose with . Then , and . If were non-zero its absolute size would be at least , so would be at least or at most , which the bounds forbid. Hence , and then .
Corollary 10.58 (Remainder forms).
Let . Every has exactly one of the forms , , …, with . In particular if and only if the remainder is .
Proof.
The theorem gives exactly one pair with and , and the available values of are . If then and ; conversely is a decomposition with remainder , which uniqueness makes the only one.
So says that takes one of the forms , and a proof from a non-divisibility hypothesis is a proof by cases with that many cases. Taking recovers the familiar reading: says . The next proposition is the pattern at .
Proposition 10.59 (Divisibility by three).
Let . If , then .
Discussion.
The statement is a conditional in which is "" and is "". A direct proof would have to start from a non-divisibility fact about , which offers no equation to work with, so we take the contrapositive: if then . That still opens with a non-divisibility, but now it is a hypothesis rather than a conclusion, and the corollary converts it into two cases, and . Each case is then ordinary algebra: expand , take a factor of out, and check that what remains in the bracket is an integer.
Proof.
We prove the contrapositive: if , then . By the corollary, or for some .
If , then
and , so .
If , then
and , so .
Remark (Exhibiting a remainder is enough).
The corollary works in both directions. If or for some , then , because divisibility would give the form and each integer has exactly one of the three forms. So when the conclusion wanted is itself a non-divisibility, exhibiting a remainder settles it, and the same holds with any in place of .
Show that for every .
Show that and together force or , and that with forces or according to sign — state the inequality carefully before proving it.
Let be non-zero and let . Using the theorem on factors and the rearrangement corollary, show that each divides as well as .
Show that the square of an integer leaves remainder or on division by , and deduce that no integer of the form is a sum of two squares.
Rings and Fields
This last section names the structure formed by and on , and shows that the construction of works for any monoid with the right properties.
The Construction Was Not Special
Look back at what the first half of the chapter used. It took , a commutative monoid in which cancellation holds, and produced a group containing a copy of it. Cancellation entered once, in the proof of transitivity. Commutativity and the identity entered in the routine checks. Nothing else about was used: not the order, not induction, not the successor.
Theorem 10.60 (Every regular commutative monoid sits inside a group).
Let be a commutative regular monoid with identity . Then there are a group with identity and an injective map such that
and such that every has the form for some . Moreover the pair is unique up to a unique isomorphism: if is another such pair, there is exactly one isomorphism with .
Discussion.
Two claims, one much harder than the other. The first is an existence claim, and it needs no new work: the construction of from used only the hypotheses now assumed, so repeating it with in place of builds , and the proofs of this chapter become its proofs. We say which pieces correspond.
The second is the one to prove. Uniqueness of comes first and is immediate: the condition fixes on the image of , and since every element of is a quotient , and a homomorphism must send an inverse to an inverse, is forced everywhere. That forced formula is then taken as a definition, and since an element of may be written as such a quotient in many ways, we check that two writings give the same value, which uses injectivity of . That is a homomorphism is a short computation, and we get bijectivity by building the map the other way and observing that both composites satisfy the defining condition of the identity, which the uniqueness half then identifies them with.
Proof.
For existence, run the construction of the first half of this chapter with in place of and in place of . Declare when ; this is an equivalence relation, the proof of transitivity using cancellation exactly where it used it for . Let be the quotient, with , well defined by the same computation as before. Then is an abelian group with identity and , and is injective with and . Finally
so every element of has the required form.
For uniqueness, let be another such pair and suppose is a homomorphism with . For we get
using that homomorphisms respect inverses. So is determined, and at most one such map exists.
That formula does define a map. Suppose . Multiplying by gives , that is , so by injectivity of . Applying to that equation and reversing the steps gives , so the value does not depend on the writing.
The map so defined is a homomorphism, since
in and the same identity holds in , both by commutativity and the inverse of a product. It satisfies , by taking .
Exchanging the roles of and produces a homomorphism with . Then is a homomorphism with , and so is ; the uniqueness just proved, applied with and , forces . Likewise . So is a bijection, hence an isomorphism.
Remark.
The theorem says the integers are the only possible answer: any group containing a copy of in which every element is a difference of two copied elements is isomorphic to , by a unique isomorphism respecting the copy. It also saves work later. The same theorem, applied to a multiplicative monoid instead of an additive one, is what will build the rationals out of the integers, and we shall not have to write the pairs down again.
Rings, Integral Domains and Fields
A ring is a set with two operations and such that is an abelian group, written with identity ; is a semigroup; and both distributive laws hold,
The ring is commutative if is commutative. It is a ring with identity if there is with and for every . It is free of zero divisors if forces or . A commutative ring with identity and free of zero divisors is an integral domain, and an integral domain in which every is invertible under is a field.
The identity of and the identity of are each unique, by uniqueness of the identity applied to the two operations separately, so the notation and names something definite. Nothing yet says how the two operations interact beyond distributivity; the next proposition gives some consequences of distributivity.
Proposition 10.62 (Arithmetic in a ring).
Let be a ring and let . Then
- ;
- ;
- .
Discussion.
None of these is an axiom, and each has to be derived from distributivity, which is the only link between the two operations. For the first, write as and distribute: the result is an equation saying that added to itself is itself, and in a group only the identity does that, so cancellation finishes. The second uses the first as its target: becomes, by distributivity, , which says is an additive inverse of , and inverses are unique. The third is the second applied twice, or once with replaced by , together with .
Proof.
For the first, by the right distributive law. Cancelling in the group gives . The computation for is the same with the left law.
For the second, , and likewise , so is an additive inverse of and hence equals . The same argument on the other side gives .
For the third, replacing by in the second part gives .
Theorem 10.63 (The integers are an integral domain).
is an integral domain, and it is not a field.
Discussion.
Each clause of the definition has already been proved or set as a problem, so the proof mostly collects them: the additive group is the theorem of the second section, the multiplicative semigroup and its commutativity and identity are the problems of the third, and distributivity is its theorem. Two points need a comment. Freedom from zero divisors is the problem on products that vanish. That is not a field is the proposition on invertible integers, which leaves only and invertible, so has no inverse and has no solution.
Proof.
is an abelian group by the theorem of the second section. Multiplication is associative and commutative by the problems there, with identity by the proposition on the embedding, and it distributes over addition by the theorem on distributivity; commutativity turns the one distributive law into both. The problem on vanishing products says forces or . So is an integral domain.
It is not a field: by the proposition on invertible integers, the only invertible elements are and , so has no multiplicative inverse.
Example 10.64 (The smallest field).
Let with . The field axioms fix both tables. Multiplication is forced by the previous proposition and the identity law: and . For addition, only is not yet determined, and would give
which is forbidden; so . The tables are
and one checks directly that they satisfy the axioms. A field needs , so no smaller field exists.
Corollary 10.65 (The binomial theorem in a commutative ring).
Let be a commutative ring with identity, let and let . Then
where means the sum of copies of .
Proof.
The proof of the binomial theorem used only the commutative, associative and distributive laws and the recursion defining powers, as the remark following it recorded. Every one of those holds in a commutative ring with identity, so the argument applies word for word, with the coefficient read as an instruction to add copies.
Remark.
The coefficient cannot in general be read as an element of , since need not contain a copy of ; what it names is a repeated sum, and repeated sums can be . In , for instance, for every , so the middle term of disappears and .
Greatest Common Divisors
The next theorem, proved with division with remainder, is what we need to build fields from the integers.
Theorem 10.66 (Bézout's identity).
Let be not both , and let
Then contains a positive element, its least positive element divides both and , and every common divisor of and divides . In particular for some .
Discussion.
Three assertions, and the first is needed for well-ordering to produce : taking and gives , which is positive because a square is never negative and the two are not both . The second is the main one, and it uses division with remainder. Divide by ; the remainder is again of the form , being minus a multiple of , and it is strictly below ; since was the least positive member, the remainder cannot be positive, so it is and divides . The same for . The third assertion is the easiest: a common divisor of and divides every combination , by the arithmetic of divisibility, and is one of those.
Proof.
Taking and gives , which is positive since squares are non-negative and and are not both . So the positive members of form a non-empty subset of , and well-ordering supplies a least one, .
Divide: with . Then
so . Were positive it would be a positive member of below , contrary to the choice of ; so and . The same argument with in place of gives .
If divides both and , then divides by the third part of the arithmetic of divisibility.
Definition 10.67 (Greatest common divisor and coprimality).
For not both , the greatest common divisor is the of the theorem: the least positive integer of the form . The integers and are coprime if .
The name is justified by the theorem: is a common divisor, and every common divisor divides it, hence is at most . Coprimality says exactly that for some integers and , and the next section uses that equation.
The Integers Modulo
Definition 10.68 (Congruence).
Let and . Then is congruent to modulo , written , if .
Proposition 10.69 (Congruence is an equivalence relation).
For each , congruence modulo is an equivalence relation on , and its classes are in bijection with .
Discussion.
Each of the three properties follows from the definition. Reflexivity is , which holds because . Symmetry is the observation that is , and a divisor of an integer divides its negative. Transitivity is the corollary on sums: divides and , hence their sum . For the count, division with remainder attaches to each integer exactly one remainder below , and two integers are congruent exactly when their remainders agree, because their difference is then a multiple of , and conversely a difference of two numbers both below cannot be a non-zero multiple of .
Proof.
Reflexivity: , so . Symmetry: if then . Transitivity: if and then divides by the corollary on sums.
For the count, let be the remainder of on division by . If then , so . Conversely if then is a multiple of lying strictly between and , hence . So induces a bijection from the classes onto .
Theorem 10.71 (The integers modulo form a ring).
The two operations above are well defined, and is a commutative ring with identity and zero , with when .
Discussion.
Well-definedness is the only thing that needs care, as in the first half of the chapter: the formulas name representatives, and a class has many. So we suppose and and must show and . The first is the corollary on sums applied to the two differences. The second needs one step more: does not obviously factor, so we insert and remove , splitting it into and , each divisible by by the fourth part of the arithmetic of divisibility, and then add. Every ring axiom afterwards is the corresponding axiom of read inside the brackets, and the count is the bijection of the previous proposition.
Proof.
Suppose and . Then divides , so the sum is well defined. And
in which divides each summand by the fourth part of the arithmetic of divisibility, hence divides the whole by the corollary on sums; so the product is well defined.
Associativity, commutativity and distributivity for the classes follow from the same laws in applied to representatives; is an additive identity with , and is a multiplicative identity. When the classes are distinct and exhaust the quotient by the previous proposition, so there are of them and .
Theorem 10.72 (A prime modulus gives a field).
Let . Then is a field if and only if is prime. When is prime one writes for it, a field with exactly elements.
Discussion.
A biconditional, and the two directions use opposite features of . Suppose is composite, say with both factors strictly between and . Then and are non-zero while their product is , so the ring has zero divisors; and a zero divisor can never be invertible, since multiplying by a hypothetical inverse of would give . So no composite modulus works.
Suppose instead is prime and , that is . The positive divisors of are and , and is not among the common divisors of and , so . Bézout then writes , and reading that equation modulo leaves . Every non-zero class is therefore invertible, which with the previous theorem is the definition of a field.
Proof.
Suppose is not prime, so with . Then and , since divides neither factor, while . If had an inverse then , a contradiction. So is not a field.
Suppose is prime and let , so . Any positive common divisor of and divides , hence is or ; it is not , since . So , and Bézout gives with . Then , so and is invertible. With the previous theorem, is a field, and it has elements.
Remark.
Taking recovers , whose tables were forced by the axioms a few pages ago; now it comes from the construction, which gives one field for every prime. These are not all the finite fields (there is one with elements for each prime and each ), but the others are not quotients of , and we do not build them here.
Show that is invertible if and only if , and that the invertible classes form an abelian group under multiplication.
Write out the addition and multiplication tables of for and , and say which classes are invertible in each.
Show that a subset of a ring is itself a ring under the restricted operations if and only if it is non-empty and and lie in whenever and do. Show that is such a subset of but does not contain the identity of .
Show that freedom from zero divisors is equivalent, in a commutative ring with identity, to cancellation: with forces . Which of the two conditions was easier to check for ?
Subrings, Homomorphisms and Ideals
The chapter on groups asked, of every structure it defined, which subsets inherit it and which maps respect it. We ask the same two questions of rings. The answers are parallel, except that the kernel of a ring homomorphism has a strictly stronger property than a subring.
Let be a ring. A non-empty subset is a subring if and whenever .
The two conditions say exactly that is a subgroup of , by the one-step criterion, and is closed under multiplication; associativity and distributivity are laws and so are inherited. Freedom from zero divisors is inherited too, being another law. What is not inherited is the identity: is a subring of containing no multiplicative identity of , and a subring of a ring with identity may lack one.
Definition 10.74 (Ring homomorphism).
Let and be rings. A function is a ring homomorphism if
for all . A bijective ring homomorphism is a ring isomorphism. The kernel is and the image is .
Proposition 10.75 (Kernel and image of a ring homomorphism).
Let be a ring homomorphism. Then is a subring of and is a subring of ; and is injective if and only if .
Discussion.
A ring homomorphism is in particular a homomorphism of the additive groups, so everything proved about kernels and images in the chapter on groups is available and settles the additive half of each claim, injectivity included. What remains is closure under multiplication, one line on each side: a product of two elements of the kernel maps to a product of zeros, and a product of two values is the value at a product. Nothing here needs the identity, and neither the kernel nor the image need contain one.
Proof.
Since is a homomorphism of into , the proposition on kernels and images makes a subgroup of and a subgroup of , and makes injective exactly when .
If then , so . And . So both are closed under multiplication and hence are subrings.
Remark (Neither identities nor freedom from zero divisors survive).
The image of a ring with identity need not contain the identity of the target, and the image of an integral domain need not be free of zero divisors: the map sending to is a ring homomorphism, and for composite its image is the whole of a ring with zero divisors. The kernel contains the identity only in one case: if then for every , so is the zero map.
The kernel has a further property, the analogue of normality.
Proposition 10.76 (Kernels absorb multiplication).
Let be a ring homomorphism, let and let . Then and .
Discussion.
A subring need only be closed under products of its own elements, but the kernel contains the product of any of its elements with anything at all, and the reason is the one-line computation that sends to , which is by the arithmetic of a ring. This property is strictly stronger, and like normality for subgroups it gets its own name.
Proof.
, so ; and , so .
Let be a commutative ring. A non-empty subset is an ideal if
- whenever ;
- whenever and .
An ideal other than and is proper. For the set is the principal ideal generated by , written ; more generally .
The second clause makes the first look weak, and in a ring with identity it is: from one gets , so closure under subtraction follows from closure under addition. Every ideal is a subring, and the kernel of every ring homomorphism is an ideal by the proposition above. The converse, that every ideal is a kernel, is proved below.
Example 10.78 (Ideals of the integers).
For the set of multiples of is an ideal of , and it is the principal ideal . It is the kernel of , and congruence modulo is exactly the relation , so the general quotient construction below, applied to this ideal, reproduces the ring built by hand earlier, which explains the notation. Bézout’s identity says more: , so every ideal generated by finitely many integers is principal.
Theorem 10.79 (The quotient ring).
Let be a commutative ring and an ideal. Then meaning is an equivalence relation, and the operations
are well defined on the quotient , making it a commutative ring. The map sending to is a surjective ring homomorphism with .
Discussion.
That the relation is an equivalence is the first clause of the definition, which makes a subgroup of : reflexivity is , symmetry is closure under negation, transitivity is closure under addition.
Well-definedness of the sum is the additive statement already proved for quotient groups, an abelian group having every subgroup normal. Well-definedness of the product uses the second clause of the definition: does not obviously lie in , so we insert and remove , splitting the difference into and , each of which is a ring element times a member of , which lies in an ideal but need not lie in a subring. The ring axioms then follow from those of applied to representatives, and the statement about is the definition read backwards.
Proof.
The first clause makes a subgroup of the abelian group , so is an equivalence relation whose classes are the cosets, and the theorem on quotient groups makes well defined with an abelian group.
For the product, suppose and . Then
and the second clause puts both summands in , so their sum lies there and .
Associativity, commutativity and distributivity for classes are the corresponding laws in applied to representatives. Finally and , so is a ring homomorphism; it is surjective by construction; and holds exactly when .
Theorem 10.80 (First isomorphism theorem for rings).
Let be a homomorphism of commutative rings. Then
by the ring isomorphism sending to .
Discussion.
Both sides exist already: the quotient because kernels are ideals, the image because it is a subring. So the work is in the named map, and it is the group version with one clause added. Well-definedness, additivity, surjectivity onto the image and injectivity are exactly as they were there, since is in particular a homomorphism of additive groups. The one new thing to check is that the map respects multiplication, and that is the definition of the quotient product followed by the multiplicativity of .
Proof.
Write , an ideal by the proposition on kernels, and define .
Everything about the additive structure — that is well defined, additive, surjective onto and injective — is the first isomorphism theorem for groups applied to as a homomorphism of into .
For multiplication, . So is a bijective ring homomorphism onto .
Remark (Fields have no proper ideals).
If is a field and an ideal containing some , then , and then for every , so . A field therefore has only the two trivial ideals, and consequently a ring homomorphism between fields is either the zero map or injective: its kernel, being an ideal not containing unless it is everything, must be .
Show that an intersection of ideals of is an ideal, and that is the smallest ideal containing .
Show that in a commutative ring with identity if and only if , that is a unit if and only if , and that is a greatest common divisor of and exactly when .
Show that every ideal of is principal. Use well-ordering on the positive members, as in the proof of Bézout’s identity.
Polynomials
A polynomial is usually written as an expression, and an expression is not an object. We do what we did for ordered pairs and for the integers: say what the object is, in terms of things already built, and then recover the familiar notation as a theorem.
Definition 10.81 (Polynomials and formal power series).
Let be a commutative ring with identity. A formal power series over is a sequence , written with . It is a polynomial if for all but finitely many . Define
Write for the set of polynomials and for the set of all formal power series, with these operations. The degree of a non-zero polynomial is the largest index carrying a non-zero coefficient.
The product is the rule one would get by multiplying out two expressions and collecting the terms of each degree; here it is a definition, and the sum defining it is a finite sum over an interval, so it names an element of without any question of convergence. “Formal” means that the series is a sequence of coefficients and nothing more.
Theorem 10.82 (Polynomials form a ring).
Let be a commutative ring with identity. Then is a commutative ring with identity under the operations above, and is a subring containing that identity. The map sending to is an injective ring homomorphism, and writing gives
Discussion.
Addition is coordinatewise, so the additive group is immediate. Commutativity of the product is the observation that reversing the order of summation in turns it into , which is reindexing a finite sum. Associativity is the corresponding statement for a double sum: both and have -th coefficient the sum of over all triples with , so the two agree once the sums are rearranged, which the results on unordered index sets allow. Distributivity is coordinatewise. That is a subring is the observation that a sum or product of two sequences with finitely many non-zero terms has finitely many non-zero terms; for the product, because the -th coefficient vanishes once exceeds the sum of the two cut-offs. The claims about are a computation from the product rule, and the last display is then bookkeeping.
Proof.
Addition is coordinatewise, so is an abelian group with zero and .
For commutativity of the product, the substitution is a bijection of with itself, so reindexing gives .
For associativity, both and equal the sum of over the finitely many triples in with , by splitting each double sum and reindexing. Distributivity is coordinatewise, since the -th coefficient of is .
The element is an identity, since its only non-zero coefficient is at and the product sum collapses to .
If for and for , then every term of vanishes once , so is closed under products; it is clearly closed under differences. So is a subring, and it contains .
Finally has in position and elsewhere, by induction on from the product rule, so has in position and elsewhere, and adding those for reproduces .
Proposition 10.83 (Degree and zero divisors).
Let be an integral domain and let be non-zero, of degrees and . Then and . Hence is an integral domain, and it is never a field.
Discussion.
We look at the top coefficient. Writing and for the two degrees, the coefficient of at is a sum in which every term but one has a factor above the cut-off of or of , hence vanishes; the remaining term is the product of the two leading coefficients, which is non-zero because has no zero divisors. So the product is non-zero and its degree is exactly . The last claim follows: has degree , so any with would have , which the order on forbids.
Proof.
Put and . The coefficient of at is ; a term with has , and a term with has and so . Only survives, giving , which is non-zero because has no zero divisors. Coefficients above vanish by the same count. So with degree , and is an integral domain.
If for some , then , impossible in . So is not invertible and is not a field.
Show that is a unit if and only if is a unit in , by solving for the coefficients of the inverse one at a time. Deduce that is invertible in and identify its inverse.
Show that evaluation at , sending to , is a ring homomorphism . Show that its kernel is an ideal containing .
Show that is infinite while the set of functions is finite, and conclude that distinct polynomials may define the same function. Give two such polynomials.
Modules and Vector Spaces
The last definition of the chapter describes a ring acting on an abelian group, where the group need not be a ring itself.
Definition 10.84 (Module and vector space).
Let be a commutative ring with identity. An -module is an abelian group together with a map , written , such that for all and
When is a field , an -module is called a -vector space, and its elements vectors.
Example 10.85 (Modules already met).
Every ring is a module over itself, with the ring product; every ideal of is a submodule. Every abelian group is a -module, with the -fold sum, which is exactly the map construction read with in place of . For a field and a set , the functions form a -vector space under pointwise operations, and taking gives the space of -tuples with coordinatewise addition and scaling. And is an -module, the scalars acting on the coefficients.
Remark (Where this goes).
A ring that is also a -vector space, with the two structures compatible, is a -algebra; the linear maps of a vector space to itself form one under composition, and choosing a basis identifies it with a ring of matrices. That is linear algebra, and we stop at the definition. Every structure in these chapters (semigroup, group, ring, field, module) was built from the same two things, a set and a function.
Show that and in any -module, quoting the corresponding argument for rings.
Show that an abelian group admits exactly one structure as a -module. Where does the uniqueness come from?
Exercises
Answers are checked in your browser, as often as you like. Nothing is sent anywhere and
nothing is kept but your own work. A formula may be written with the symbols themselves or
with ~ & | -> <-> ^, and \and, \or, \to expand as you type.
Define and for , which is the sequence of the Fibonacci problem indexed from .
is:
And is a multiple of :
Let be coprime and let be a multiple of both. Then:
Let and .
If , then :
If , then :
A block of consecutive integers, each greater than and none of them prime:
Let .
Comparing with :
If , then is:
Let .
Integers with :
The least positive multiple of of that form is:
Let be a ring with identity, let be a subring of containing that identity, and let .
If is invertible in , then is:
If instead is invertible in , then is:
A subring of a field containing the identity of that field is:
Let in . Every block of consecutive positive integers holds two distinct members whose product is a multiple of :
Let be coprime and call reachable if for some .
The set of unreachable is:
For and the largest unreachable is:
Let be the set of positive integers leaving remainder on division by , which the remainder forms show is closed under multiplication. Call with prim if it is not a product of two smaller members of .
The number of prims among , , , and is:
The least member of that is a product of prims in two genuinely different ways is:
Exercises in Lean
The proofs below are checked in your browser. Nothing is sent anywhere, and nothing is
stored but your own work. Type \to for →,
\and for ∧, \< and
\> for ⟨ ⟩.
An integer of this chapter is a class of pairs of natural numbers, and the sum criterion that decides when two pairs name the same integer mentions nothing but addition on . So the whole construction can be checked in the carrier the pairs are drawn from, and the sheet is written there: a pair is two naturals and , and is the equation
m + n' = n + m'with no new notation needed for it. What the chapter proves about becomes an implication between such equations, which is what the exercises ask for.
Two laws of multiplication join the arithmetic already listed, both from the problems of the chapter on the natural numbers:
Nat.mul_assoc (m * n) * p = m * (n * p)
Nat.add_mul (m + n) * p = m * p + n * pand divisibility arrives as the definition the order chapter gave it, written a ∣ b and typed \mid:
Nat.dvd_iff a ∣ b ↔ ∃ c : ℕ, b = a * cIt is an equivalence rather than a definition the checker unfolds, so it is used through .mp and .mpr.
Rearranging a sum
Every calculation with pairs ends the same way: four naturals added in one order must be shown equal to the same four added in another order. We prove this once.
Example.
Associativity opens the bracketing, commutativity exchanges the middle pair, and associativity closes it again. It is listed below as Nat.add_shuffle.
Example.
Symmetry of , which is the sum criterion read backwards with each side commuted.
The exchange that Proposition 10.5 turns on.
A common shift satisfies the sum criterion, which is the third condition of Theorem 10.8 implying the second.
Transitivity, and with it Proposition 10.2 . Adding to the first equation is what makes the second substitutable, and cancellation clears what is left.
Proposition 10.15 : pre-addition respects the equivalence. This is what Nat.add_shuffle is for.
Every number divides itself.
The first part of Proposition 10.54 , on the carrier.
And Corollary 10.55 , whose subtraction half has no reading in .
A divisibility survives multiplying both sides by the same factor.
The third part of Proposition 10.54 , in the form can state. (Harder.)
What the checker understands
Tactics
| intro h | assume the hypothesis of an implication, naming it h |
| exact e | give the proof outright |
| apply f | reduce the goal to the hypotheses of f |
| assumption | close the goal with a hypothesis already present |
| trivial | close the goal True |
| exfalso | replace the goal with False |
| by_contra h | assume the negation of the goal |
| constructor | split ∧ into both halves, or ↔ into both directions |
| left / right | choose which half of a ∨ to prove |
| rcases h with a | b | argue by cases on a disjunction |
| obtain ⟨a, b⟩ := h | take a conjunction or an existential apart |
| cases h | as above, keeping the name |
| refine e | give the proof with holes left in it |
| have h : p := … | record an intermediate result |
| show p | restate the goal in an equal form |
| use w | give a witness for ∃ |
| specialize h a | instantiate a ∀ hypothesis |
| rw [h] | rewrite with an equation, ← to go backwards |
| rfl | both sides compute to the same thing |
| decide / norm_num | settle a closed computation |
| tauto | close a goal that is true by pure logic |
| induction n with k ih | the fifth Peano condition: prove the goal at 0, then at succ k from ih |
Results you may cite
| Classical.em | ∀ (a : Prop), a ∨ ¬a — the law of excluded middle |
| Classical.byContradiction | ∀ {a : Prop}, (¬a → False) → a — proof by contradiction; the tactic by_contra does this for you |
| Classical.byCases | ∀ {a b : Prop}, (a → b) → (¬a → b) → b — split on whether a holds |
| not_not | ∀ {a : Prop}, ¬¬a ↔ a — double negation |
| not_and_or | ∀ {a b : Prop}, ¬(a ∧ b) ↔ ¬a ∨ ¬b — De Morgan |
| not_or | ∀ {a b : Prop}, ¬(a ∨ b) ↔ ¬a ∧ ¬b — De Morgan |
| not_imp | ∀ {a b : Prop}, ¬(a → b) ↔ a ∧ ¬b |
| and_comm | ∀ {a b : Prop}, a ∧ b ↔ b ∧ a |
| or_comm | ∀ {a b : Prop}, a ∨ b ↔ b ∨ a |
| Set.ext | ∀ {A B : Obj}, (∀ x : Obj, x ∈ A ↔ x ∈ B) → A = B — extensionality: sets with the same elements are equal |
| Set.ext_iff | ∀ {A B : Obj}, A = B ↔ (∀ x : Obj, x ∈ A ↔ x ∈ B) — extensionality and substitution, in one biconditional |
| Set.subset_antisymm | ∀ {A B : Obj}, A ⊆ B → B ⊆ A → A = B — mutual inclusion is equality |
| Set.empty_subset | ∀ {A : Obj}, ∅ ⊆ A — the empty set is a subset of every set |
| Set.pair_eq | ∀ {a b c d : Obj}, ((a, b) = (c, d)) ↔ (a = c ∧ b = d) — two ordered pairs are equal exactly when their coordinates are |
| Nat.succ_inj | ∀ {m n : ℕ}, succ m = succ n → m = n — the third Peano condition: the successor is injective |
| Nat.succ_ne_zero | ∀ (n : ℕ), succ n ≠ 0 — the fourth: zero is nobody's successor |
| Nat.pred | ∀ {n : ℕ}, n ≠ 0 → ∃ m : ℕ, n = succ m — predecessors: everything but zero is a successor |
| Nat.add_zero | ∀ (m : ℕ), m + 0 = m — the first clause of addition |
| Nat.add_succ | ∀ (m n : ℕ), m + succ n = succ (m + n) — the second clause of addition |
| Nat.zero_add | ∀ (n : ℕ), 0 + n = n — addition from the left |
| Nat.succ_add | ∀ (m n : ℕ), succ m + n = succ (m + n) — addition from the left, at a successor |
| Nat.add_assoc | ∀ (m n p : ℕ), (m + n) + p = m + (n + p) — addition is associative |
| Nat.add_comm | ∀ (m n : ℕ), m + n = n + m — addition is commutative |
| Nat.add_ne_zero | ∀ {a : ℕ} (b : ℕ), a ≠ 0 → a + b ≠ 0 — positivity is absorbing |
| Nat.mul_zero | ∀ (m : ℕ), m * 0 = 0 — the first clause of multiplication |
| Nat.mul_succ | ∀ (m n : ℕ), m * succ n = m * n + m — the second clause of multiplication |
| Nat.zero_mul | ∀ (m : ℕ), 0 * m = 0 — multiplication from the left |
| Nat.succ_mul | ∀ (m n : ℕ), succ m * n = m * n + n — multiplication from the left, at a successor |
| Nat.add_right_cancel | ∀ {m n k : ℕ}, m + k = n + k → m = n — cancellation, from the last sheet |
| Nat.add_eq_zero | ∀ {m n : ℕ}, m + n = 0 → m = 0 ∧ n = 0 — a sum is zero only when both parts are, from the last sheet |
| Nat.mul_comm | ∀ (m n : ℕ), m * n = n * m — multiplication is commutative, from the last sheet |
| Nat.mul_add | ∀ (m n p : ℕ), m * (n + p) = m * n + m * p — multiplication distributes over addition, from the last sheet |
| Nat.mul_assoc | ∀ (m n p : ℕ), (m * n) * p = m * (n * p) — multiplication associates, from the problems of the last chapter |
| Nat.add_mul | ∀ (m n p : ℕ), (m + n) * p = m * p + n * p — distributivity on the other side |
| Nat.add_left_cancel | ∀ {a m n : ℕ}, a + m = a + n → m = n — uniqueness of differences |
| Nat.lt_trichotomy | ∀ (m n : ℕ), m < n ∨ m = n ∨ n < m — trichotomy, from the theorem that ℕ is strictly ordered |
| Nat.lt_irrefl | ∀ (n : ℕ), ¬(n < n) — anti-reflexivity, from the last sheet |
| Nat.lt_trans | ∀ {m n p : ℕ}, m < n → n < p → m < p — transitivity of the strict order, from the last sheet |
| Nat.lt_succ_self | ∀ (n : ℕ), n < succ n — every number is below its successor, from the last sheet |
| Nat.not_lt_zero | ∀ {n : ℕ}, ¬(n < 0) — nothing lies below zero |
| Nat.lt_succ_iff | ∀ {m n : ℕ}, m < succ n ↔ m < n ∨ m = n — nothing lies strictly between n and succ n |
| Num.inj | ∀ {m n : ℕ}, ↑m = ↑n → m = n — distinct numbers name distinct objects of ω |
| swap_apply_left | ∀ (a b : Obj), swap a b a = b — the transposition sends a to b |
| swap_apply_right | ∀ (a b : Obj), swap a b b = a — and b to a |
| swap_apply_of_ne_of_ne | ∀ {a b x : Obj}, x ≠ a → x ≠ b → swap a b x = x — and fixes every other point |
| swap_swap | ∀ (a b x : Obj), swap a b (swap a b x) = x — a transposition is its own inverse |
| Function.iterate_zero_apply | ∀ (f : Obj → Obj) (x : Obj), f^[0] x = x — the first clause of the powers of a map |
| Function.iterate_succ_apply | ∀ (f : Obj → Obj) (n : ℕ) (x : Obj), f^[succ n] x = f^[n] (f x) — the second clause: f^[succ n] is f^[n] ∘ f |
| Function.iterate_add_apply | ∀ (f : Obj → Obj) (m n : ℕ) (x : Obj), f^[m + n] x = f^[m] (f^[n] x) — the first law of exponents |
| Nat.factorial_zero | 0 ! = succ 0 — the first clause of the factorial |
| Nat.factorial_succ | ∀ (n : ℕ), (succ n) ! = succ n * n ! — the second clause of the factorial |
| Nat.choose_zero_right | ∀ (n : ℕ), choose n 0 = succ 0 — the empty set is the one 0-subset |
| Nat.choose_eq_zero_of_lt | ∀ {n k : ℕ}, n < k → choose n k = 0 — no subset is larger than the whole |
| Nat.choose_succ_succ | ∀ (n k : ℕ), choose (succ n) (succ k) = choose n k + choose n (succ k) — Pascal's identity |
| mul_assoc | ∀ (a b c : Obj), (a ∗ b) ∗ c = a ∗ (b ∗ c) — the operation associates |
| e_mul | ∀ (a : Obj), e ∗ a = a — the identity on the left |
| mul_e | ∀ (a : Obj), a ∗ e = a — and on the right |
| inv_mul_cancel | ∀ (a : Obj), a⁻¹ ∗ a = e — the inverse on the left |
| mul_inv_cancel | ∀ (a : Obj), a ∗ a⁻¹ = e — and on the right |
| inv_inv | ∀ (a : Obj), (a⁻¹)⁻¹ = a — worked above: inverting twice gives the element back |
| mul_left_cancel | ∀ {a x y : Obj}, a ∗ x = a ∗ y → x = y — worked above: the left half of prop-9-5 |
| Nat.add_shuffle | ∀ (p q r s : ℕ), (p + q) + (r + s) = (p + r) + (q + s) — worked above: the rearrangement every pair calculation needs |
| Nat.dvd_iff | ∀ {a b : ℕ}, a ∣ b ↔ ∃ c : ℕ, b = a * c — a divides b when b is a multiple of it |
From the logical core
| And.intro | ∀ {a b : Prop}, a → b → a ∧ b |
| And.left | ∀ {a b : Prop}, a ∧ b → a |
| And.right | ∀ {a b : Prop}, a ∧ b → b |
| And.symm | ∀ {a b : Prop}, a ∧ b → b ∧ a |
| Or.inl | ∀ {a b : Prop}, a → a ∨ b |
| Or.inr | ∀ {a b : Prop}, b → a ∨ b |
| Or.elim | ∀ {a b c : Prop}, a ∨ b → (a → c) → (b → c) → c |
| Or.symm | ∀ {a b : Prop}, a ∨ b → b ∨ a |
| Iff.intro | ∀ {a b : Prop}, (a → b) → (b → a) → (a ↔ b) |
| Iff.mp | ∀ {a b : Prop}, (a ↔ b) → a → b |
| Iff.mpr | ∀ {a b : Prop}, (a ↔ b) → b → a |
| Iff.symm | ∀ {a b : Prop}, (a ↔ b) → (b ↔ a) |
| Iff.rfl | ∀ {a : Prop}, a ↔ a |
| Iff.trans | ∀ {a b c : Prop}, (a ↔ b) → (b ↔ c) → (a ↔ c) |
| True.intro | True |
| False.elim | ∀ {a : Prop}, False → a |
| absurd | ∀ {a b : Prop}, a → ¬a → b |
| id | ∀ {a : Prop}, a → a |
| mt | ∀ {a b : Prop}, (a → b) → ¬b → ¬a |
| Eq.refl | ∀ {α : Type} (a : α), a = a |
| Eq.symm | ∀ {α : Type} {a b : α}, a = b → b = a |
| Eq.trans | ∀ {α : Type} {a b c : α}, a = b → b = c → a = c |
| congrArg | ∀ {α : Type} {β : Type} {a b : α} (f : α → β), a = b → f a = f b |
| Exists.intro | ∀ {α : Type} {p : α → Prop} (w : α), p w → ∃ x : α, p x |
| Exists.elim | ∀ {α : Type} {p : α → Prop} {b : Prop}, (∃ x : α, p x) → (∀ y : α, p y → b) → b |