MA0 1
Introduction to University Mathematics (Proofs)
Every lesson so far, in one document · 10 chapters
Lesson 1
Introduction to Logic
Taught
Symbols, Logic and Language
Logic is the language of mathematics. It deals with statements that are either true or false, and it fixes the meaning of expressions that are ambiguous in ordinary language, such as “if … then,” “or,” and “and.”
Early Greek philosophers, notably Aristotle and Chrysippus, laid the initial formal foundations but did not make its semantics precise. It was not until the work of modern mathematicians such as Leibniz (1666), Boole (1847) and De Morgan (1847) that propositional logic was formalised.
This work introduced formal languages, variables, operators, axioms, logical inference and proof in the form used today.
Syntax and Semantics
Because logic is the formal language of mathematics, it has two aspects. The rules for how symbols may be combined are its syntax, while the meaning behind a particular arrangement of those symbols is its semantics.
In mathematics, we refer to objects by giving them names. A variable is a symbol that stands in for an object that has not yet been specified. We assign a name to a particular object using the assignment operator . For example, writing assigns the value to the variable . We can similarly define the golden ratio as
The objects and variables within an expression are its terms. For instance, , , and are all distinct terms.
Remark (On Notation).
Variables are typically denoted using single Latin or Greek letters. Common choices include:
- Lowercase:
- Uppercase:
- Greek:
Propositions and Truth Values
Mathematics, in its most basic form, is the practice of assigning truth to well-defined statements; it differs from other sciences in that its results are proven rigorously, as opposed to being hypothesized and then “confirmed” via experiements.
For these notes, most of our work amounts to taking a collection of statements which we already know to be true and using them to establish newer, more complex ones, or formulating statements whose truth or falsity we wish to determine. If we were to encounter a falsity, we would have to demonstrate that it is indeed false; so, we begin with the logic that connects what we know to what we wish to know.
The statements mathematicians study are called logical or mathematical statements or propositions, which we define as follows:
A proposition is a grammatically correct declarative sentence that has a definite truth value.
By “grammatically correct,” we just mean that the words and symbols follow the rules of English (or any language you speak), and make sense.
The truth value of a proposition indicates whether the proposition is true or false. We abstract away the specific content of a statement to focus solely on its logical status, denoting ‘true’ with the symbol (read “top”) and ‘false’ with the symbol (read “bot” or “bottom”).
The foundation of classical logic rests on the principle of bivalence, which states that every proposition is either true or false, but not both.
Some basic examples include:
- . (Truth value: )
- The integer 7 is even. (Truth value: )
- For any real number , . (Truth value: )
- Every even integer greater than 2 can be written as the sum of two prime numbers. (Truth value: unknown)
- The Earth is round. (Truth value: )
Example 4 is something to note: by the principle of bivalence, a sentence need not have a known truth value to qualify as a proposition; all that matters is that it makes logical sense to assign one; in fact, although the truth value of many propositions remains unknown, they are still valid propositions.
Remark.
Propositions like Example 4 are called conjectures, with Example 4 being known as the Goldbach Conjecture; in general, a conjecture is a claim believed to be true but which has not yet been proved or disproved.
By the principle of bivalence, we also see that many mathematical expressions and sentences are not propositions because they lack a definite truth value — imperative sentences (commands) and interrogative sentences (questions), for example, are naturally excluded.
The following are not propositions:
- . (This is a term. Its value depends on , but it is not a complete sentence capable of carrying a truth value.)
- Solve the equation . (An imperative command.)
- Is a rational number? (An interrogative question.)
- . (This is something called an open sentence, but its truth value depends on the unspecified variable . It is a predicate, which will be addressed in later sections.)
Suppose we say “Every even number greater than 2 can be written as the sum of two primes.” Is this a proposition?
Semantically Void and Self-Contradictory Sentences
Consider the following sentence: “The theory of relativity eats breakfast loudly.” Although it possesses a subject, verb, and adverb, the problem is that a scientific theory is an abstract concept which cannot eat; thus, because it describes a nonsensical scenario, there is no sensible way to assign a truth value to it — assigning is absurd, while assigning would require that “The theory of relativity does not eat breakfast loudly” is a true statement, which is equally bizarre.
A more subtle challenge arises from paradoxes: sentences that are semantically meaningful but inherently are self-contradictory. Consider a page containing only the following sentence:
“The only proposition on this page is false.”
Attempting to assign a truth value to this sentence, denoted by , yields a contradiction:
- If is : Then the sentence asserts that is false; since it is the only proposition present, must evaluate to , contradicting our initial assumption that is true.
- If is : Then the sentence’s assertion that the only proposition on the page is false must itself be false. Since is the only proposition on the page, must therefore evaluate to , contradicting our initial assumption that is false.
Hence, as the sentence cannot be assigned a truth value, it is not a proposition.
What happens if we do allow sentences like this to count as proper mathematical statements? What if we abandon the requirement that every statement we care about must be either true or false — is something fundamentally wrong, or have we simply entered a different logical universe?
In general, self-referential sentences like the one above, are quite bizarre and can produce some paradoxes that we want to disallow. By narrowing our scope strictly to propositions, we guarantee that our logical framework remains consistent, and most importantly suitable for automated reasoning and algorithmic verification (yes this is about Lean).
Construct an example of a true proposition, a false proposition, a proposition whose truth value you do not currently know, a paradox, and a mathematical statement that is not a proposition.
Atomic Statements and the Structure of Mathematical Truth
To analyse complex (or compound) statements, we decompose them into their foundational components.
Definition 1.5 (Atomic Statement).
A statement is called atomic (or an atomic proposition) if it cannot be broken down into simpler constituent propositions.
For example, “5 is a prime number” is an atomic statement. Conversely, “5 is a prime number and 4 is an even number” is a complex statement built from two atomic components.
Remark.
We traditionally express these base components using propositional variables, denoted by lowercase letters such as .
By combining atomic statements into more complex structures, we can construct arguments in which some statements support another. Such an argument is a proof.
A proof of a proposition is a verified logical argument demonstrating its truth. It must begin from known or assumed truths, proceed via agreed-upon valid logical steps, and be entirely verifiable by a knowledgeable reader.
The results we prove are labelled by their role:
- Proposition: In addition to its logical meaning above, “proposition” is also commonly used as a label for a proved result, usually one of lesser or supporting importance than a theorem.
- Theorem: A significant mathematical result.
- Corollary: A result that follows as an immediate logical consequence of a theorem or proposition.
Logical Connectives
Thus far, we have mostly been working with atomic propositions; the next step is to combine statements into new statements using logical operators or connectives, where the truth value of the combined statement is based solely on the truth values of the original statements and on the type of logical operator facilitating the combination. These rules should make sense to you based on your understanding of the English language as a whole, but we also define them using a truth table (a table whose columns correspond to mathematical statements and their respective truth values), which lists the output truth value for every possible combination of truth values assigned to the input propositional variables.
Negation
The simplest logical operator is the negation operator, which produces the “opposite” of the original statement in the logical sense. It is actually a so-called unary operator, i.e., it does not combine statements but is merely applied to one statement. If is a statement, its negation, written , is the statement with the exact opposite truth value, usually produced by placing a “not” in the grammatically appropriate spot. For example, if is the statement “Jack is a boy,” then is the statement “Jack is not a boy,” or for another example if is the statement “31 is a prime number” (), then is the statement “31 is not a prime number” or, equivalently, “31 is composite” ().
We negated “31 is prime” to “31 is composite.” Does swapping “not prime” for “composite” work for every natural number, or did 31 get lucky?
Compound Sentences
Having seen how a unary operator acts on a single statement, we now proceed to binary logical operators, i.e., logical operators combining precisely two statements. Given two statements and , we can join them with an “and” or an “or” to build a complex statement whose truth value depends, in the way you would expect, on the truth values of and .
The conjunction of and , read ” and ” and written , is true precisely when both pieces are true, and false otherwise.
Let be the proposition “2+3=5,” be the proposition “There exists a prime number greater than ,” and the statement “the sky is red.” Thus, because both are true, their conjunction is true. Pairing with instead gives ” and the sky is red.” Here the first piece is true and the second is false, so is false.
Remark.
In English, conjunctions are frequently expressed using words such as “but,” “yet,” “while,” or “moreover.” The statement “A square has four sides, but a triangle has three vertices” serves the exact same logical function as a formal “and” statement.
The disjunction of and , read ” or ” and written , is true if at least one of the component propositions is true, and evaluates to false only when both and are false.
Since both may hold at once, our “or” is what computer scientists call an inclusive or. The exclusive or, also known as XOR, on the other hand, denoted , evaluates to if exactly one of or is .
Reusing our definitions of in the example block above, is true, is true, but is false.
Remark (On Ambiguity).
In everyday English, “or” is heavily context-dependent. The statement “Candidates must have a degree in mathematics or computer science” implies an inclusive or, as possessing both degrees is entirely acceptable. However, being offered “soup or a salad” with a meal implies an exclusive or, where choosing both is not an option. In mathematics, “or” strictly denotes the inclusive disjunction unless specified otherwise.
Suppose is while is . What do you know about and ?
As you will have noted in the stated examples, logical operators can combine statements even when their meanings do not seem directly connected. While this might seem strange, adding restrictions based on content is neither needed nor helpful, because statements that appear unrelated can later become relevant within the same context. The same point applies to implications and equivalences, where the connection may initially seem even less intuitive.
”If-Then” Statements
Most statements we meet in these notes arrive as “If , then .” These are the conditional statements (or implications), written (or ) and read ” implies ”; within one, is called the hypothesis (or premise) and the conclusion. The logic of the implication is usually a little bit counter-intuitive to beginners so to be extra careful we can think of the statement to mean the same thing as “whenever is true, is also true”; i.e., evaluates to in only one scenario: when is but is .
Remark.
The key word here is “whenever”: claims that every situation in which is true is also one in which is true, so a situation where is false cannot violate the implication, regardless of the truth value of .
Consider the statement: “If the employee finishes the project by Friday (), then they will receive a bonus ()”:
- If is , is : The employee finishes on time and gets the bonus.
- If is , is : The employee finishes on time, but does not receive the bonus. This contradicts the promise, so the statement is .
- If is , is : The employee misses the deadline but receives a bonus anyway (perhaps for previous good work). The original statement only specified what happens if the project is finished on time; it did not prohibit a bonus otherwise. The statement remains true.
- If is , is : The employee misses the deadline and receives no bonus. The statement remains true.
Cases 3 and 4 illustrate what is known as a vacuous truth: whenever the hypothesis is , the implication places no restriction on the conclusion and therefore evaluates to automatically.
“If , then 7 is prime” — true or false? What about “If , then 7 is composite”?
I promise: “if it rains, I bring an umbrella.” You catch me carrying one under a cloudless sky. May you call me a liar?
Another bit of confusion with these kind of statements comes from the word “implies,” as some use the word to convey some kind of causality. Take, for example the statement ” implies ,” which is a true statement; many implications seem to follow this pattern, where the truth of the hypothesis seems to lead us to the truth on the conclusion, but this isnt the case in general!
Another example, “the sky being blue implies ,” is a true statement, despite the color of the sky having nothing to do with equaling 4; thus, the truth of , depends only on the truth values of and , regardless of if we can deduce the conclusion directly from the hypothesis (or if any meaningful connection between either even exist).
Granted, the implication is not really useful in situations, where the truth values of both and are already known; that is in a typical application, one tries to establish the truth of to prove the truth of (a strategy that will fail if happens to be false); it is important to keep in mind, that this is a consequence of the strategy not an undelying part of how conditional statements are defined.
Finally, like conjuction, there are a plethora of ways to express implication in english; consider the implication , where is “It is raining” and is “The ground is wet,” assuming the implication evaluates to , one may also say:
- If it rains, then the ground is wet.
- The ground being wet is a consequence of it raining.
- From “it is raining,” one may infer “the ground is wet.”
- It raining is sufficient for the ground to be wet.
- The ground being wet is necessary for it to rain.
- It rains only if the ground is wet.
The connectives introduced above are the standard primitives of propositional logic, but classical logic requires even fewer primitives than just these; in fact, every logical connective can be expressed using only negation and disjunction. Using this fact, express , and , only with and , and verify each expression using a truth table. Can you find more than one expression for any of them?
Operator Precedence
Finally, before concluding this section, to preserve clarity and avoid an unreadable accumulation of parentheses in complex expressions, logical connectives adhere to a strict order of precedence. Operations are evaluated in the following hierarchy:
- Negation,
- Conjunction,
- Disjunction,
- Implication,
Under these rules, compound propositions are implicitly bracketed. For example, logical equivalence allows us to interpret expressions unambiguously without superfluous parentheses; is the same as ; likewise, means .
Remark.
The exclusive or lacks a universally standardised precedence level within this hierarchy; consequently, parentheses must always be explicitly written when incorporating it into compound statements.
Consider the unparenthesised propositional formula . First, rewrite this formula with all implicit parentheses explicitly shown, adhering strictly to the operator precedence hierarchy. Second, determine the final truth value of the formula given the assignment where is , is , and is .
The Structure of Proof Systems
Although truth tables answer individual questions, they have several problems, one being that brute-force enumeration of every possible assignment scales poorly: a formula with atomic variables needs rows (quite obvious to see). Another, more fundamental, problem is that a truth table tells us that something is true without revealing why it is true, or how its truth connects to anything else. To patch this, we build what is called a proof system.
Formally, a proof system — pioneered by Gottlob Frege in 1879 — is a mechanism that uses axioms (assumed truths) and inference rules to mechanically derive new valid statements from existing ones. To achieve this, the system operates on two fundamental objects: statements (finite symbol strings expressing propositions) and proofs (the formal sequences justifying them). The relationship between these objects is governed by two rules:
- Semantics (Truth): A rule determining whether a given statement is true or false (the previous section used truth tables).
- Verification (Syntax): A procedure that decides if a specific string constitutes a valid proof for a given statement. This verification must be efficiently computable; a proof whose validity cannot be checked in reasonable time is useless.
A proof system should make the provable statements and the true statements coincide, which is expressed by two properties: Soundness: If a statement has a valid proof, it is true (no false statement possesses a valid proof) and Completeness: If a statement is true, a valid proof for it exists.
Remark (On Computational Efficiency).
In contrast to truth tables, verifying a formal proof requires only line-by-line pattern matching against inference rules, taking time proportional to the length of the proof itself. Verifying a proof is cheap even when finding one is hard, and this asymmetry is central to computational complexity theory.
Consider statements of the form “The integer is composite.”
- Semantics: The statement is true if has a divisor such that .
- Proof: A valid proof could simply be the divisor itself.
- Verification: Divide by and check whether the remainder is zero.
The verification step is computationally cheap, even when finding the divisor is extraordinarily difficult.
Satisfiability
Before constructing proofs, we must classify propositions by the range of truth values they can assume. Not all compound propositions behave alike: some are always true, some are always false, and some depend on the assignment.
A compound proposition is a tautology if it evaluates to under every possible assignment of truth values to its atomic variables.
Definition 1.13 (Contradiction).
A compound proposition is a contradiction if it evaluates to under every possible assignment of truth values to its atomic variables.
Definition 1.14 (Contingency).
A compound proposition is a contingency if it is neither a tautology nor a contradiction; its truth value depends on the specific assignment.
A proposition is satisfiable if there exists at least one assignment under which it evaluates to . Every tautology and every contingency is satisfiable. A contradiction is unsatisfiable.
The proposition is a tautology (by the principle of bivalence, one of or must hold). The proposition is a contradiction. The bare variable is a contingency.
To establish that a proposition is satisfiable, a single witness assignment suffices. To establish that it is unsatisfiable, one must check every assignment, which is the expensive enumeration that the algebraic approach below avoids.
Determine the satisfiability of . If satisfiable, provide a witness assignment. If unsatisfiable, justify your answer.
Logical Equivalence and Nonequivalence
Next, we need a way to decide when two statements are actually “the same,” at least in terms of their truth values. In particular, we may be able to prove that two statements have the same truth value for every possible assignment of the variables they contain.
From the logical operations and negation we can assemble statements of considerable complexity. Consider the formula
This is a disjunction of three terms; by the associativity of (which we will prove shortly), the parentheses around the disjunction are irrelevant, and thus the formula is true exactly when at least one of the negated conjunctions is true. Now compare it with the much simpler expression . Even a quick glance suggests they both express “at least one of is false.” Their truth tables confirm this equivalence in a single combined table:
The two formulas agree on every row.
Definition 1.16 (Logical Equivalence).
Let and be statements built from the same simpler statements using , and . They are logically equivalent, written , if every assignment of truth values to those simpler statements gives and the same value.
We can express this “same truth value” agreement directly in the language with a single connective.
Biconditional
Let and be statements, the biconditional, (read ” if and only if ,” frequently abbreviated as “iff”) describes a relationship where two propositions strictly share the same truth value. For example, “A polygon is a triangle () if and only if it has exactly three sides ().” If one is true, the other must be true; if one is false, the other must be false. Also note that when dealing with a biconditional , the proposition is said to be “necessary and sufficient” for .
Equivalently, asserts both []. If is true, then forces to be true; if is false, then forces to be false. Thus, in either case, and have the same truth value.
Show using a truth table that and [] have the same truth values for every possible truth.
The biconditional gives us a convenient way to characterize logical equivalence. For any particular assignment, tells us whether and agree under that assignment. If they agree under every assignment, then the biconditional is always true.
Remark (Equivalence via Biconditional).
Equivalence can also be expressed in terms of a tautology: This will be especially useful when we work algebraically, because it allows us to replace by the statement that reduces to .
The opposite situation is equally important.
Definition 1.17 (Logical Nonequivalence).
Two statements and are not logically equivalent, written , if there exists at least one assignment of truth values to their variables for which their resulting truth values differ. Such an assignment is termed a counterexample.
And thus finally, we now have all the tools to build a proof system.
Equivalence Proofs
We now introduce the axiomatic foundation that allows us to reason about propositional equivalences without enumerating truth tables. The axioms of classical propositional logic specify the algebraic behaviour of the connectives , , and . Each axiom is a logical equivalence, asserting that two expressions are interchangeable in all contexts. The first five axiom pairs define a structure known as a Boolean algebra.
The axioms govern only , , and . To bring and within their reach we use the defining equivalences of the two conditional connectives, which rewrite them in terms of the core trio:
Feel free to pick any three axioms and prove them using a truth table.
From these axioms, we derive theorems. Recall Definition 1.6 : a proof begins from known truths and proceeds via valid logical steps. An equivalence proof is a chain of equivalences, each justified by an axiom, a definition, or a previously established theorem:
The astute might ask: what logically permits us to stitch individual equivalences together into a single chain? Well this method relies on the principle of transitivity; we first show by truth table the closely related transitivity of implication, and then verify the transitivity of equivalence.
Let and be any propositions. We show that the transitivity of implication, , is a tautology.
The final column is in every row, so the formula is a tautology. Similarly, for any propositions and , we show that the transitivity of equivalence, , is also a tautology.
By the truth table, the transitivity of equivalence is likewise a tautology, fully justifying the chain-of-equivalences method. For complex formulas this is much shorter than a truth table (as we see below), though it needs some ingenuity rather than mechanical enumeration.
Fundamental Theorems
Theorem 1.18 (Uniqueness of Complements).
For any propositions and , if and , then .
Discussion.
The statement is a conditional whose hypothesis is a pair of equivalences and whose conclusion is a third, so we assume both hypotheses and show that and both reduce to . Each hypothesis is an equivalence with or on one side, so it can be used only after a or a has been introduced: Identity introduces the , Complement the , and Distributivity combines and so that the hypotheses apply. Transitivity of equivalence then gives .
Proof.
Let and be arbitrary propositions satisfying and . We show that both and reduce to the same expression. First:
Similarly:
Both and equal , hence .
Remark.
The symbol at the end of a proof is a modern substitute for the traditional Q.E.D., an initialism for the Latin phrase quod erat demonstrandum, meaning “what was to be shown.”
The theorem says that anything that behaves like a complement, giving under and under , is the complement. Most of the derivations below use it.
and .
Proof.
By Identity, . By Commutativity and Identity, . The premises of Theorem 1.18 are satisfied with and , yielding . The second statement follows identically with , .
Corollary 1.20 (Negative Equivalence).
For any propositions and , if , then .
Proof.
Let . Then: and
By Theorem 1.18 (with playing the role of and playing the role of ), we conclude .
For any propositions such that and :
Proof.
Two propositions are equivalent exactly when they take the same truth value under every assignment. Fix such an assignment. The hypothesis says and take the same value there, and says the same of and . Each connective is a function of the truth values of its arguments and of nothing else, so and are the same function applied to the same pair of values, and therefore agree; likewise for , for and for . Since the assignment was arbitrary, the four equivalences hold.
With Theorem 1.18 and its corollaries established, we can now derive the classical theorems of propositional logic.
Theorem 1.22 (Double Negation).
For any proposition , .
Discussion.
The claim is that is the complement of , so we use uniqueness of complements: we check that and , and the theorem gives the result. Both conditions are the Complement axiom with its two sides commuted.
Proof.
By Complement (and Commutativity): and . The premises of Theorem 1.18 are met with in the role of and in the role of . Therefore .
For any proposition , and .
Discussion.
Each equivalence is proved by a chain of rewritings from the left side down to . Since cannot be simplified directly, the chain begins by adjoining a or a by Identity. Complement turns that constant into or , Distributivity factors out the repeated , and Complement and Identity remove the rest. The second case is the first with and exchanged throughout, which the duality of the axioms permits.
Proof.
For the conjunctive case:
The disjunctive case follows analogously:
For any proposition , and .
Discussion.
Again two dual equivalences, each proved by a chain. Complement rewrites as , with the same that already appears, so that Associativity brings the two copies of together. Idempotence, just proved, merges them, and Complement gives again. The proof uses the previous theorem.
Proof.
For the disjunctive fragment:
The conjunctive fragment:
For any propositions and , and .
Discussion.
In both statements disappears, so we isolate in a bracket that Domination removes. Identity supplies a next to the first , Distributivity factors out and leaves , and Domination reduces that to . The conjunctive case is the dual, with in place of .
Proof.
For the disjunctive case:
The conjunctive case:
Theorem 1.26 (De Morgan's Laws).
For any propositions and , and .
Discussion.
Each statement asserts that a particular compound is the complement of another, so we use uniqueness of complements again and verify that and give under and under . The first of these uses Distributivity twice, so that meets and meets ; each pair collapses by Complement, and Domination removes what is left. The second law is the first with the two connectives exchanged, and the second condition is the dual of the first.
Proof.
We prove by applying Theorem 1.18 . We must show and .
The conjunctive branch:
By Theorem 1.18 , . The proof of is analogous.
Prove by equivalence proof that (the second De Morgan’s Law).
De Morgan’s Laws are an instance of a general symmetry between conjunction and disjunction, called duality.
Definition 1.27 (Logical Duality).
Two binary logical connectives are dual when negating a compound expression built from one connective yields a formula that is logically equivalent to the compound expression built from the other connective, but with the inputs themselves negated.
Remark (Principle of Duality).
More generally, for any equivalence involving only , , and , swapping every with (and every with ) produces another valid equivalence. This is the Principle of Duality for Boolean algebra.
Conjunction and disjunction are the fundamental dual pair of classical logic. The two De Morgan’s Laws show exactly that and are dual to each other: negating an AND gives an OR of the negated parts, and negating an OR gives an AND of the negated parts.
Using this we extend the De Morgan’s Laws extend naturally to any finite number of propositions.
For any propositions , and
Proof.
Since and are dual, negating a conjunction exchanges for while negating each of its components; hence By the same duality, negating a disjunction exchanges for , giving
Show that is a tautology, without using a truth table.
Equivalences Involving Conditionals
The defining equivalences of and allow us to derive every conditional equivalence by reducing implications to and applying the theorems above:
Notice the pattern in the implication equivalences: when implications share the same premise, the conclusions combine with the same connective ( or ). When they share the same conclusion, the premises combine with the opposite connective. This “flip” from to (and vice versa) comes from the negation in the definition of : the antecedent of an implication sits behind a , so De Morgan’s Laws invert the connective when premises are merged.
Contrapositive, Converse, and Inverse
Let and be mathematical statements. From an implication , three related conditionals arise:
- The contrapositive .
- The converse .
- The inverse .
Something hinted at so far is that the direction of an implication matters: in general, reversing an implication does not preserve its truth. That is, even if is true, its converse need not be true.
Using an equivalence proof, show that and
The first equivalence is particularly important. Since if we wish to prove , we may instead show and this technique is one of the most useful methods of proof in mathematics (we see more of it later). However, because the converse is not determined by the truth value of the original implication whenever a mathematician proves a statement of the form , a natural follow-up question is whether the converse also happens to hold. This distinction is also the source of a common logical fallacy: Suppose we have established that ; someone might object that does not necessarily imply , and therefore claim that the original argument is wrong, however, this objection confuses an implication with its converse.
Negating Conditional Statements
For the end of this specific section we ask: what does it mean for an implication itself to be false?
Recall that fails in exactly one situation: when is true and is false; expressing this algebraically using the conditional equivalence:
Theorem 1.29 (Negation of a Conditional).
For any propositions and ,
Discussion.
The proof is three rewritings. The conditional is an abbreviation, so first expand it into ; De Morgan’s laws then move the negation inside the disjunction; and Double Negation removes the on .
Proof.
This has a useful interpretation: to show that an implication is false, one must exhibit a case in which the hypothesis holds but the conclusion fails. In other words, a counterexample to an implication is precisely a witness to . It is worth distinguishing this from several superficially similar statements: neither nor is the negation of . Anyway, we can negatate the biconditional similarly.
Theorem 1.30 (Negation of a Biconditional).
For any propositions and ,
Discussion.
The proof follows the previous one: expand the biconditional into the conjunction of its two conditionals, expand each conditional into a disjunction, and move the negation inside with De Morgan’s laws. This gives a conjunction of two disjunctions, which Distributivity expands into four terms, two of which vanish by Complement. The proof is left as the problem below.
Prove the above theorem.
Thus, a biconditional is false exactly when and have different truth values; this is precisely the exclusive-or, relationship.
Equivalence Proofs in Practice
The following examples use the method, with Python as a check.
Show that .
Show that is a tautology.
The formula reduces to with no surviving variables, confirming it is a tautology regardless of assignment.
Show that .
Prove the above result.
This is the usual proof strategy for a disjunction: to show that a disjunction implies something, it suffices to show that each disjunct separately implies it.
Example 1.34 (Negation of an Implication).
The negation of “If I think, then I am” () is: by the definition of and De Morgan (Theorem 1.26 ). So the negation is “I think and I am not.”
Example 1.35 (XOR Distributivity).
Is distributive over and ?
The claim holds. Expanding both sides via the definition :
Left side:
Right side:
Both sides reduce to the same expression. However, fails.
A single counterexample suffices: set , , .
Using equivalence proofs (not truth tables), show that . This establishes the contrapositive equivalence from first principles.
Show, using an equivalence proof, that . Identify precisely where the “flip” from to the structure of the result occurs, and which axiom is responsible.
The negation of “Candidates must have a degree in mathematics or computer science” is not “Candidates must have a degree in mathematics and computer science.” Using the propositions = “The candidate has a degree in mathematics” and = “The candidate has a degree in computer science,” express the original statement formally as an implication and compute its negation. Identify the De Morgan’s Law involved.
Normal Forms
We Finish off this chapter with Normal forms.
The equivalence proofs developed demonstrate that any compound proposition can be transformed into an equivalent expression using only the core connectives , , and . But this raises a question: given two arbitrary propositions, how do we determine whether they are equivalent without the algebraic ingenuity required for an equivalence proof? (excluding truth tables of course).
A normal form solves this by being a fixed structural template for propositional formulas: If two propositions are equivalent, their normal forms will be identical (after simplification). This converts the semantic question “do these formulas always agree?” into the syntactic question “do these strings match?” But before defining the two principal normal forms, we need some terminology.
A literal is a propositional variable or its negation. If is a propositional variable, then both and are literals.
A clause is a disjunction or conjunction of literals. A disjunctive clause (or simply a clause in the context of CNF) is a disjunction of literals. A conjunctive clause (or term) is a conjunction of literals.
Disjunctive Normal Form
Definition 1.38 (Disjunctive Normal Form).
A propositional formula is in Disjunctive Normal Form (DNF) if it consists of a disjunction of one or more terms, where each term is a conjunction of literals. That is, DNF has the shape:
where each is a literal.
The structure is: OR of ANDs. Each conjunctive term describes one specific scenario under which the formula holds; the overall disjunction asserts that at least one of these scenarios is realised.
The following formulas are in DNF:
- . Two terms, each a conjunction of two literals.
- . A single literal is a degenerate term (a conjunction of one literal).
- .
The following formulas are not in DNF:
- . The negation is not a literal.
- .
- .
Constructing DNF from Truth Tables
Every compound proposition can be mechanically converted to DNF via its truth table via the procedure:
- Construct the truth table for the proposition.
- Identify every row where the proposition evaluates to .
- For each such row, form a conjunctive term: include the variable if it is assigned in that row, or if it is assigned .
- Take the disjunction of all such terms.
Each term encodes exactly one satisfying assignment, and the disjunction collects them all.
Find the DNF of .
We construct the truth table:
Rows 2, 4, 6, 7, 8 evaluate to . Reading off each row:
This is the full DNF. It can be simplified using the equivalence (which follows from Distributivity and Complement). Group the first two terms:
For the last three terms, observe that we may use Idempotence (Theorem 1.23 ) to duplicate the fifth term () without altering the formula. This allows two independent groupings:
Combining:
Applying the definition of and De Morgan (Theorem 1.26 ) in reverse: . The simplified DNF recovers the original formula, confirming equivalence.
Conjunctive Normal Form
Definition 1.41 (Conjunctive Normal Form).
A propositional formula is in Conjunctive Normal Form (CNF) if it consists of a conjunction of one or more clauses, where each clause is a disjunction of literals. That is, CNF has the shape:
where each is a literal.
The structure is: AND of ORs, the dual of DNF. Each disjunctive clause represents a constraint that must be satisfied; the conjunction demands that every constraint holds simultaneously.
The following formulas are in CNF:
- .
- .
The following formulas are not in CNF:
- .
- .
Constructing CNF
There are two systematic methods for obtaining CNF.
Method 1: Algebraic manipulation. Eliminate all implications using the defining equivalences of and . Push negations inward using De Morgan’s Laws (Theorem 1.26 ) and Double Negation (Theorem 1.22 ). Then distribute over using the equivalence (the disjunctive form of Distributivity) until every clause is a disjunction of literals.
Method 2: Truth table (via negation of DNF). Observe that by Double Negation (Theorem 1.22 ), any proposition satisfies . Construct the DNF of by reading off the rows where evaluates to (equivalently, where evaluates to ). Then negate the resulting DNF. By De Morgan’s Laws (Theorem 1.26 ), negating a disjunction of conjunctions produces a conjunction of disjunctions: precisely CNF.
Find the CNF of .
Method 1 (Algebraic):
Method 2 (Truth table):
The formula evaluates to in rows 5 and 7. Form the DNF of the negation by reading these rows: and simplify, thus giving . Now negate: by De Morgan (Theorem 1.26 ) and Double Negation (Theorem 1.22 ). This is already in CNF.
Remark.
Method 2 produced , while Method 1 produced . These are equivalent: the second clause in Method 1’s result is absorbed by the first via Absorption (Theorem 1.25 ), since any assignment satisfying automatically satisfies .
The Cost of Canonicality
Converting between normal forms can cause an exponential blowup in the number of clauses.
Consider a formula already in DNF with terms:
To convert this to CNF, we must distribute over repeatedly. Each application of Distributivity doubles the number of clauses. Starting with :
Two terms in DNF produce four clauses in CNF. Adjoining a third term via disjunction and distributing again doubles to eight clauses. After terms, the CNF may contain up to clauses. The symmetric explosion occurs when converting CNF to DNF.
The blowup comes from the normal forms themselves, not from the method of conversion. It is also the reason why the satisfiability of CNF formulas (the SAT problem) occupies a central position in complexity theory: determining whether a CNF formula has a satisfying assignment is the canonical NP-complete problem, meaning that no known algorithm solves it efficiently in all cases.
Find the DNF of using the truth table method. Simplify the result.
Convert into DNF using algebraic manipulation (Distributivity, not truth tables). Verify your result computationally.
Find the CNF of using both methods (algebraic and truth table). Confirm that both methods yield equivalent results.
Application: Knights and Knaves
Logic puzzles can be solved with these methods.
On an island, every inhabitant is either a knight (who always tells the truth) or a knave (who always lies). You encounter two inhabitants, and .
- says: “B is a knight.”
- says: “The two of us are of opposite types.”
Let denote ” is a knight” and denote ” is a knight.” We translate the scenario into propositional logic.
- If is a knight ( is ): then ‘s statement is true, so is . If is a knave ( is ), then ‘s statement is false, so is . In both cases, ‘s declaration encodes .
- ’s statement asserts that and are of opposite types, which means exactly one of is : this is . If is a knight ( is ), then must be . If is a knave ( is ), then must be . So ‘s declaration encodes .
The full constraint is thus
-
Case 1: Assume is . From , we get is . Then . But . The conjunction evaluates to . Contradiction.
-
Case 2: Assume is . From , we get is . Then . And . The conjunction evaluates to .
Therefore both and are knaves.
On the same island, you meet three inhabitants , , and . says: “All of us are knaves.” says: “Exactly one of us is a knight.” Using propositional variables , , for , , respectively, determine the types of all three inhabitants. Verify your solution computationally.
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.
For each implication below, which of the four statements is its converse?
If it is raining, then the ground is wet.
If is divisible by 4, then is even.
If a function is differentiable, then it is continuous.
Construct a compound proposition in , and that is true exactly when:
is true, is false and is false.
exactly one of , , is true.
at least two of , , are true.
The exclusive or does not distribute over conjunction: . Give an assignment at which the two sides differ.
Write each of the following with the connectives named and no others.
, in .
, in .
, in and .
Find the disjunctive normal form of , simplified as far as it will go.
Find the conjunctive normal form of , simplified as far as it will go.
The compound proposition involves four propositional variables. Settle it without constructing the sixteen-row truth table.
An assignment at which it is true.
An assignment at which it is false.
The proposition is therefore:
On an island, knights always tell the truth and knaves always lie. Person says: “If I am a knight, then is a knight.” Determine what and are.
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 ⟨ ⟩.
Everything above this point was checked by hand. Lean is a language in which a statement and its proof are written so that a machine can check them instead, and it is what the rest of these notes will be verified in. This sheet is where we learn to write in it.
Each box below holds one statement. The grey lines are given and cannot be edited; the lines under them are ours to write, one tactic to a line. Underneath the box sits the info view, which shows what is left to prove and follows the cursor: put the caret between two lines of a proof and it reports the state at that point, which is the only way to see what a tactic has actually done.
Statements and proofs
p : Prop reads ” is a statement”, something that is either true or false. hp : p reads “hp is a proof of ”, and assuming amounts to the same thing, since a hypothesis is a proof we were handed rather than one we made.
A goal is shown as a list of hypotheses, a turnstile, and then the statement to be proved. What stands above the ⊢ we may use; what stands after it we must reach. A proof is finished when no goals are left.
Implication
Three tactics prove everything in this part.
intro
To prove we may assume and prove from it. So if the goal is ⊢ p → q, then intro hp takes that assumption, names it hp, and leaves the goal ⊢ q. Several may be taken at once: intro hp hq.
exact
If a hypothesis is exactly the statement we are trying to prove, exact hp closes the goal. Note that exact p does not: p is the statement and hp is a proof of it, and it is proofs that close goals.
Example.
Three assumptions, one of which is what we want.
apply
apply argues backwards. If the goal is and we hold h : p → q, then it is enough to prove , so apply h replaces the goal ⊢ q with ⊢ p. It works only when the conclusion of h is the goal.
Implications also apply forwards, and read left to right: with h : p → q and hp : p, the term h hp is a proof of . So exact h hp closes in one line what apply h and then exact hp closes in two.
Example.
The goal is an arrow, so we may assume its left side. What we assume is never used again.
Example.
Backwards, in two steps. Putting exact h hp in place of both lines does the same work forwards.
An arrow chain groups to the right: p → q → r is p → (q → r), so to reach we must supply both a and a . If h : p → q → r and the goal is ⊢ r, then apply h leaves two goals rather than one, and a tactic acts only on the first of them.
Every statement implies itself.
A statement that holds goes on holding under a further assumption.
From , together with , reach .
Implication is transitive.
If follows from and together, and follows from , then follows from alone.
True and False
True is Lean’s and False is its . Each is a statement like any other, and each has a tactic of its own.
trivial
trivial closes the goal ⊢ True, which asks for nothing.
Example.
The hypothesis plays no part. Nothing is needed to prove .
exfalso
Since implies everything, a proof of is a proof of anything, and exfalso replaces the goal, whatever it was, with ⊢ False. It is the move to make when the hypotheses already contradict each other, because nothing else is needed.
Example.
Nothing is known about , and nothing needs to be.
The true statement holds.
Anything at all implies the true statement.
The true statement does not imply the false one.
And anything follows from the claim that it does.
From and a refutation of , any follows.
Negation
In Lean ¬p is not a connective of its own. It is defined to be p → False, so the two are one statement and either may be given where the other is asked for. A proof of ¬p is therefore a thing that turns a proof of into a contradiction: intro opens a goal ⊢ ¬p exactly as it opens an arrow, and if hnp : ¬p and hp : p then hnp hp is a proof of False.
Example.
The negation is applied to the proof it refutes.
by_contra
To prove by contradiction we assume and derive . Where the goal is ⊢ p, by_contra hp adds hp : ¬p and changes the goal to ⊢ False. This is the one classical step available here: it is the law of excluded middle in the form of a tactic, and the exercises that need it are the ones that cannot be done without it.
The two readings of are one statement.
The false statement can be refuted.
A statement implies its double negation.
An implication yields its contrapositive.
And the contrapositive yields the implication back.
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 |
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 |
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 |
Lesson 2
Predicates, Quantifiers, and Proofs
Taught
Predicates
There is a problem: So far, what we’ve built (propositional logic) has no way to express the classic (correct) argument “All men are mortal. Socrates is a man. Therefore Socrates is mortal,” because propositional logic treats each proposition as an indivisible whole. It therefore has no way to look inside a statement and relate the object (Socrates), the property (being a man), and the consequence (being mortal); without that internal structure, we cannot formally justify the conclusion.
What is missing is the ability to distinguish the object of our speech from the description we make about it, so we introduce predicate logic, which allows us to reason about objects and their properties.
Variables and Predicates
Recall that a term is a symbol that denotes an object: constants such as the natural number or are terms denoting specific objects, while an unquantified variable such as is a term whose value has not yet been specified. We can then form expressions describing the object denoted by a variable, such as to say ” is a man,” or to say ” is greater than .” We call these expressions predicates (also known as variable propositions), since they make a claim that depends on one or more variables.
Let be variable symbols. We say is an -ary predicate if its truth value is determined once values are assigned to each of the variables (or equivalently, replacing each variable by a term denoting a specific object produces a proposition).
- A -ary (monadic) predicate describes a property, e.g., .
- A -ary (dyadic) predicate describes a relation between two terms, e.g., .
- An -ary predicate describes a relation among terms.
Note that we would usually write such a declaration as: let be the statement ”.”
Remark.
A term by itself is not a complete sentence, so it has no truth value; likewise, as hinted earlier the resulting expressions above () are still not propositions because their truth value depends on the actual value of .
Applying a predicate to the appropriate number of terms gives an atomic formula, the simplest kind of formula in first-order logic; for example, if is the predicate “is prime,” then and are atomic formulas. If all the terms in an atomic formula denote specific objects, then the formula has a definite truth value and is a proposition.
Let denote , where the variables range over the integers. Then is since ; is since ; and is still a predicate, since can be or depending on the values of and .
Remark.
It is common to use capital letters such as to denote predicates.
A predicate’s variables take values in a domain , called the universe of discourse (in the previous example, is the integers). Once values from are substituted, the predicate becomes a proposition with truth value or ; hence we can now apply the logical connectives introduced earlier.
Let denote . Then the following are true: and the following are false: .
More generally, we can build new predicates out of old ones using connectives. Expressions constructed from predicates and logical connectives whose truth value still depends on one or more variables are called propositional functions.
Using as above, the following are propositional functions:
is a predicate in two variables; is a predicate in one variable (since is already a proposition).
Consider the expressions , , and . Which of these are propositions and which are predicates? For each predicate, give one substitution that makes it and one that makes it .
Remark (History and Significance of Predicate Logic).
Aristotle developed a limited form of predicate logic through his theory of syllogisms. The modern version was independently developed by Frege and Peirce between the 19th and 20th centuries, roughly 2000 years later, mirroring the timeline of propositional logic itself. Predicate logic (also called first-order logic) is now the standard language for mathematical statements and is equally fundamental in computer science, appearing in database queries, logic programming (Prolog), automated theorem proving, software verification, and symbolic AI. Some mathematicians, notably Hilbert, hoped it would be a complete system for all of mathematics, but Gödel’s incompleteness theorem showed otherwise: no fixed collection of axioms can prove all true mathematical statements.
Introduction to Sets
We take a quick detour to study sets. Sets are probably the most important structure in mathematics right now; a precise answer as to why they are so important would fill an entire course, but for our purposes it might suffice as a rather crude approximation to say that sets are the building blocks of all mathematics.
Being so important, we introduce them now and will study them in greater detail later. For the moment, the following informal definition will suffice.
Definition 2.5 (Set (to be revised)).
A set is nothing more than a collection of objects. The objects in the collection are called its elements or members. We usually denote sets by uppercase letters , and elements by lowercase letters . If is a set, then means ” is an element of ;” sometimes we also write for and say ” contains .” Also worth talking about, is it’s negation: or , means ” is not an element of ,” or ” does not belong to ;” when needed (not often), some write which stands for ” does not contain .”
Let . Then , but .
Remark.
Membership is a relation between an element and a set. That said, a set can itself be an element of another set. For example, because the collection on the right has two elements: the set and the number ; The problem arises when this is confused with the case where only the original objects are elements: So asks whether is literally a member of the collection , not merely whether its contents appear among the elements of .
Let Which of the following are true?
(a)
(b)
(c)
(d)
There is one refinement we will need: Not every collection is useful in mathematics, for example, “a collection of all beautiful paintings” doesn’t make sense because whether a painting belongs to it depends on the judge; with a different panel of judges we might get a different result, “beauty is in the eye of the beholder” afterall.
Either way, to combat this we normally restrict ourselves to what is called a well-defined set. Informally, a well-defined set is a set such that, for every object, there is a specific objective rule that allows us to determine whether the object belongs to the set or not; one or the other must happen, but not both. Well aside from being a mouthfull, this definition runs into the same exact problems we introduced earlier; our current model cannot describe this so we finally introduce one which can.
Quantifiers
Next we make claims about all values in a domain, or assert that at least one satisfying value exists. These are the universal and existential quantifiers.
The Universal Quantifier
Definition 2.7 (Universal Quantifier).
Let be a predicate with variable ranging over a universe of discourse . The universal quantification of in , written , is the proposition asserting that is for every element . It is read “for all , .”
Determining the truth of amounts to exhaustive verification: examine every object in the universe, and if even one makes false, the entire statement is false. If every object passes, the statement is true; a value for which is called a counterexample.
If the universe is the collection , the universal quantifier reduces to a conjunction:
Remark (Indexed Conjunction and Disjunction).
When a conjunction or disjunction extends over a collection of terms, we write
More generally, for any index set the notations and denote the conjunction and disjunction, respectively, of over every in . In this notation, the finite-universe equivalences above become and, as we shall see shortly, .
Specifying the Quantification Set
Earlier our description of a quantification states that it “ranges over a universe of discourse,” take for example the sentence
which may look true, but as it stands it is meaningless. What is ? “For every ” from where? If ranges over colours, or over sentences, then is not false, it is not even grammatical. We need to know where the object comes from before we can ask whether the claim about it is true.
If we amend the sentence so that ranges over the real numbers, we get a well-formed statement, and a true one. If instead we let range over the complex numbers, we get an equally well-formed statement that is now false: the imaginary unit is a complex number with , and fails. (We will make little real use of the complex numbers in these notes, but they are a convenient source of counterexamples.)
Let denote ”.”
If the universe is the integers, then is : the value is a counterexample, since is false. If is the positive integers (the natural numbers greater than 0), then is . The truth value of a universally quantified statement depends on the choice of universe.
The Existential Quantifier
Definition 2.9 (Existential Quantifier).
Let be a predicate with variable ranging over a universe . The existential quantification of in , written , is the proposition asserting that there is at least one element for which is . It is read “there exists an such that .”
Where the universal quantifier demands exhaustive verification, the existential quantifier demands a search: examine objects in the universe until one satisfies . If such an object is found, it is called a witness and the statement is true. If the entire universe is exhausted without finding a witness, the statement is false.
If the universe is the collection , the existential quantifier reduces to a disjunction:
If is true and is non-empty, then must also be true: if every element satisfies , at least one does.
Let denote ”.”
is when the universe is the integers (witness: ), when is the positive integers, and when is the negative integers.
The following table summarises the two quantifiers:
| Statement | True when | False when |
|---|---|---|
| is for every | There exists a counterexample: some with | |
| There exists a witness: some with | is for every |
Remark (Quantifiers and Finite Domains).
If the domain is finite, quantifiers are technically unnecessary: is a conjunction and is a disjunction, both expressible in propositional logic. Quantifiers are needed for infinite domains, where no finite conjunction or disjunction suffices.
Scope and Variable Binding
Definition 2.11 (Scope, Bound Variables, and Free Variables).
The scope of a quantifier is the portion of the formula to which it applies, typically delimited by parentheses. A variable that falls within the scope of a quantifier is bound to that quantifier. A variable not bound by any quantifier is free. A formula with free variables is a predicate, and becomes a proposition only when all free variables are either substituted by terms or bound by quantifiers.
This is why we bracket the body of a quantifier. Quantifiers bind more tightly than all propositional connectives, so an unbracketed formula is read as narrowly as possible:
This expression has a free variable in and is therefore a predicate. The two ‘s are in fact independent: the expression could equivalently be written . By contrast, has both occurrences of inside the brackets, so both are bound, and the result is a proposition.
Earlier it was shown that a quantifier always comes with a set attached, either named outright or fixed in advance as the universe of discourse. Writing that set into the quantifier itself is common, and has its own notation.
Definition 2.12 (Bounded Quantifiers).
Let be a set and let be a predicate. The bounded quantifiers are defined by
read “for every in , ” and “there is an in with .” When several variables share a set we abbreviate further, writing for , and likewise for .
The restriction enters the universal quantifier through an implication and the existential one through a conjunction, and the pairing cannot be swapped. The statement is made true by any object outside whatsoever, since a false antecedent makes the implication true, so it says nothing about the elements of at all.
The Unique Existential Quantifier
It is often useful to assert that exactly one object satisfies a predicate.
Definition 2.13 (Unique Existential Quantifier).
The unique existential quantification asserts that exactly one element of satisfies . It is defined in terms of the other quantifiers:
This reads: “there exists an such that , and any satisfying must equal .” It takes a bounded form like the other two: for a set ,
Let be the integers and let denote ”.” Then is : the unique witness is . If instead denotes ”,” then is , since every positive integer satisfies and there are infinitely many of them.
Formalising Arguments
We can now symbolise the prime-number argument that propositional logic could not handle. Let be the integers, let denote ” is a prime number greater than ,” and let denote ” is odd.”
- “Every prime number greater than is odd” becomes .
- “The number is a prime number greater than ” becomes .
- By substituting into (1) we obtain . Since is true by (2) and the conditional is true, bivalence forces to be true: ” is odd.”
More broadly, the four classical categorical propositions of Aristotelian logic can be expressed in first-order form. Given predicates and over a universe :
| Type | Statement | First-order form |
|---|---|---|
| A | All are | |
| E | No is | |
| I | Some is | |
| O | Some is not |
Remark (The Connective Trap).
A common error is to write , which makes the much stronger claim that everything in the universe is both and . Equally, is almost always vacuously true: any element that is not makes the implication true and serves as a witness.
Example 2.15 (Translating Natural Language).
Let be all people, let denote ” is a student in this class,” and let denote ” has written a programme in Python.”
“Every student in this class has written a programme in Python” is formalised as .
“Some student in this class has written a programme in Python” is formalised as .
Quantifier Negation
The universal and existential quantifiers are duals, connected by negation in a manner analogous to De Morgan’s laws for conjunction and disjunction.
Theorem 2.16 (Quantifier Negation).
For any predicate with universe :
(1)
(2)
Discussion.
The propositional laws of the last chapter say nothing about quantifiers, so we read each quantifier as what it abbreviates: a universal statement is a conjunction over the whole universe, an existential one a disjunction. Written that way, each claim is an instance of the generalised De Morgan law (the negation of a long conjunction is the long disjunction of the negations, and conversely), and the last step reads the answer back as a quantifier. The second part is the first with the two connectives exchanged.
Proof.
The two quantifiers expand into an indexed conjunction and an indexed disjunction over :
(1)
(2)
Remark (De Morgan over a Universe).
The generalised De Morgan’s laws were stated for propositions, and the proof above applies them to a conjunction indexed by , which need not be finite (we explore this in a second). When , the step is the corollary verbatim:
Which has an immediate consequences: and .
Example 2.17 (Negating in English).
Let be the real numbers.
- “There is a real number with ,” in symbols , is . Its negation is the universal statement “for every real number , ,” which is .
- “Every real number is positive or negative,” in symbols , is : the counterexample is . Its negation is , and De Morgan’s laws turn the negated disjunction into a conjunction, giving : “there is a real number that is neither positive nor negative.” It is , with doing the existing.
Negation and Bounded Quantifiers
The bounded notation of Definition 2.12 is coherent with negation. Applying the theorem to a set :
The restricted domain is preserved under negation: only the predicate is negated, not the domain condition. Unfolding the first one confirms this. Writing the bounded quantifier out in full, negating, and using the negation of a conditional:
which is the bounded existential .
Show the negation of the existential claim to be true.
Distribution of Quantifiers over Connectives
The universal quantifier distributes over conjunction, and the existential quantifier distributes over disjunction:
However, the reverse pairings do not hold in general:
For both non-equivalences, a single counterexample suffices: Let , with true exactly of and true exactly of . Then is (witnesses and ), but is , since fails on the second conjunct and on the first. Likewise is (it holds at via and at via ), while is , since and both fail.
Come up with your own example as to why this fails, what situation does it not fail?
Validity and Satisfiability in Predicate Logic
Just as in propositional logic, a quantified statement with all variables bound can be classified by its truth behaviour across all possible interpretations. A statement is valid if it is true for every domain and every choice of predicates (the analogue of a tautology), satisfiable if there exists at least one domain and choice of predicates making it true, and unsatisfiable if no such choice exists.
The statement is valid: it is an instance of Theorem 2.16 and holds for any predicate and any domain.
The statement is satisfiable: taking makes it true, while taking the domain to be the integers with and makes it false.
The statement is unsatisfiable: it asserts that every element simultaneously satisfies and fails to satisfy , contradicting the principle of bivalence.
Let be a predicate over an arbitrary universe . Determine whether each of the following statements is valid, satisfiable, or unsatisfiable, and justify your answer.
(a)
(b)
(c)
Let be all English texts, and let , and denote ” is a clear explanation”, ” is satisfactory”, and ” is an excuse” respectively. Formalise the following in predicate logic:
(a) All clear explanations are satisfactory.
(b) Some excuses are unsatisfactory.
(c) Some excuses are not clear explanations.
Let be the integers and let be the real numbers. Using Theorem 2.16 , negate each of the following statements and simplify. State whether the original or its negation is true.
(a)
(b)
(c)
Nested Quantifiers
The statements encountered so far have involved a single quantifier binding a single variable. Many mathematical claims, however, involve multiple variables and require several quantifiers applied in sequence. A nested quantifier is a quantifier that falls within the scope of another quantifier.
Example 2.19 (Additive Inverse).
The statement “every real number has an additive inverse” involves two variables: the number itself and its inverse. Letting be the real numbers, the formalisation is:
The outer quantifier asserts that the claim holds for every real . The inner quantifier asserts that, for each such , a suitable exists. The two quantifiers are nested: lies within the scope of .
A nested quantified statement can be decomposed by treating each inner quantification as a propositional function. For instance, can be read as , where and . Note that is itself a predicate: the existential quantifier binds , but remains free until the outer binds it.
Order of Quantifiers
The order in which quantifiers appear is critical. Consider the same predicate , with still the real numbers.
asserts: “for every real , there exists a real such that .” This is : for any given , the witness works. Crucially, the witness may differ for each .
asserts: “there exists a single real such that for every real .” This is : no single number is the additive inverse of every real number.
The difference shows up in how one would search for the answer. In the first statement, we walk through the values of one at a time and look for a fresh at each step. In the second, we pick a candidate first and then test it against every . The quantifier order dictates which variable is chosen first, and therefore which one the other is allowed to depend on.
Example 2.20 (Order Changes the Meaning).
Let be the real numbers and let denote ”.” Then says “for every number there is a larger one,” which is ; the witness works for each . Flipping the two quantifiers, says “there is a number larger than every number,” which is ; among other embarrassments, such an would have to satisfy (this will be important in a second).
Let be the professional footballers, let be the clubs, and let denote ” is the captain of .” Four formally similar statements have four very different meanings:
- : every footballer is some club’s captain. .
- : there is one club whose captain is every footballer at once. , and its dressing room does not bear thinking about.
- : every club has a captain. .
- : there is one footballer who captains every club. .
Only the quantifier order and the choice of which set each variable is drawn from separate these.
Negate statement (3) of the example above, “every club has a captain,” pushing the negation all the way inside. Then say the result in football English.
However, quantifiers of the same type may be freely reordered:
Both nested universal quantifiers demand that hold for every pair, and both nested existential quantifiers demand that at least one pair satisfies . In neither case does the order in which pairs are examined affect the outcome.
Quantification Fixes a Variable
Let be the even integers greater than or equal to , let be the prime numbers, and for and let denote ”.” Consider
The initial quantification serves to fix a value of , which is then used for the rest of the statement. The assertion that follows, that there are primes and with , is made about that fixed but arbitrary value. Read as a whole, the statement says that no matter which is chosen from , we can find and satisfying . The order of quantification is what tells us those values may depend on the chosen .
Take a particular value. We know , since is even and . Can we find with ? We can take and . Now take ; our choices have to be different from before, and , will do (as will ). This is what we mean when we say that and depend on .
What is the difference between the statement above and the following one?
Is it or ? Why?
Remark.
The universal statement is the Goldbach Conjecture, met as a proposition of unknown truth value in the previous chapter. Checking and settles two instances; it does not settle the statement, because a universal quantifier over an infinite set is not exhausted by any number of instances; but a single for which no such and exist would settle it the other way.
Example 2.22 (Translating from Mathematics).
The statement “the sum of two positive integers is always positive” contains implicit quantifiers and a hidden domain. Making these explicit step by step:
- Rewrite with explicit quantifiers: “for every two integers, if both are positive, then their sum is positive.”
- Introduce variables: “for all integers and , if and , then .”
- Formalise, taking to be the integers:
Example 2.23 (Carrying Restrictions Along).
The Archimedean principle says that if and are positive numbers, there is a natural number with . This holds however large is and however small is.
Let be the real numbers, let be the natural numbers, and let denote ”.” If we agree in advance that and range over the positive reals and over the natural numbers, the principle encodes compactly. If instead all three variables range over , we have to carry the restrictions ourselves:
read “for every and , if both are positive, then there is a natural number satisfying .” Writing for the positive real numbers, the bounded quantifiers of Definition 2.12 package the same statement as
The two say the same thing, and the second is shorter.
Example 2.24 (Translating Natural Language).
Let be all people and let denote ” loves .”
Observe how the English phrasing obscures the quantifier order; “Everybody loves somebody” places the universal quantifier first: each person has their own someone. “There is someone who is loved by everyone” places the existential first: a single person is loved by all. Despite their superficial similarity, the two statements are logically independent.
Let be all students in a class and let denote ” and are friends.” Formalise the following in predicate logic, stating the set each variable is drawn from:
(a) Everyone has a friend.
(b) There is someone who is friends with everyone.
(c) No one is friends with everyone.
(d) There exists a pair of students who are not friends with each other.
Example 2.25 (Truth Values of Nested Statements).
Let be the real numbers. Determine the truth value of each statement:
(a) is : for any , choose .
(b) is : taking , there is no real with .
(c) is : choose .
(d) is : addition of real numbers is commutative, so for all . This is the negation of , which is .
Let be the integers. Determine the truth value of each statement, and justify your answer.
(a)
(b)
(c)
Negating Nested Quantifiers
Theorem 2.16 extends to nested quantifiers by repeated application. Each quantifier flips () and the negation pushes inward:
At each step, one quantifier is negated. The process terminates when the negation reaches the predicate.
Let be the real numbers and negate the statement , “every real number has an additive inverse.”
Applying the negation rules from outside in:
In English: “there is a real number with no additive inverse.” This is , confirming that the original statement is .
Let be the real numbers. Negate each of the following statements and simplify. State whether the original or its negation is true.
(a)
(b)
(c)
Remark (Prenex Normal Form).
A formula is in Prenex Normal Form (PNF) if all quantifiers appear at the front, followed by a quantifier-free predicate:
where each is either or , each variable ranges over the universe fixed in advance, and contains no quantifiers. For example, the statement is not in PNF because quantifiers appear on both sides of . Rewriting using the defining equivalence of the conditional and renaming variables for clarity:
The last expression is in PNF. Every statement in predicate logic can be converted to PNF using quantifier negation, variable renaming, and the distribution rules established earlier.
Let and be predicates over a universe . Convert the following to Prenex Normal Form:
(a)
(b)
Proofs
Valid Arguments and Inference Rules
We can use all of this to do what a mathematician (or an AI) was meant to do in the first place: write proofs. In the first chapter of the notes we built a proof system for propositional equivalences, but equivalence proofs are symmetric (carrying identical truth values under every assignment), but much of mathematics proceeds asymmetrically (we know certain facts and wish to derive new ones, in one direction only). If is known and is true, we may conclude , but not the reverse. The tools for this one-way reasoning are called inference rules, and a proof is a structured chain of such inferences leading from premises to a conclusion.
Arguments and Validity
An argument in propositional logic is a finite sequence of propositions . The propositions are the premises and is the conclusion. The argument is valid if the truth of all premises guarantees the truth of the conclusion: is a tautology. An argument that is not valid is invalid.
We write a valid argument with the premises above a horizontal line and the conclusion below:
An inference rule is an argument form that remains valid regardless of which particular propositions are substituted for its variables: just as the axioms of earlier notes gave us equivalences that hold universally, inference rules give us one-directional deductions that hold universally.
Remark (The Turnstile).
The notation (read ” entail ”) means that can be derived from the premises using axioms, inference rules, and previously established theorems. When no premises are needed, we write , meaning is derivable from the axioms alone.
We start off with the most famous.
Modus Ponens
The basic rule of deduction is Modus Ponens (from the Latin modus ponendo ponens, “the method of affirming by affirming”):
If we know and , we may conclude . Its validity rests on the tautology
To see why this is a tautology, suppose both and are true: by the truth table of the conditional, the only circumstance under which is true and is true is when is also true. Hence must hold.
Earlier established the universal statement “every prime greater than is odd.” Let denote “7 is prime and greater than 2” and denote “7 is odd.” The universal claim gives , and we can verify directly (7 is prime, and ); modus Ponens yields : the integer 7 is odd.
Let denote “it is snowing” and denote “the lecture is cancelled.” Suppose we know and . State the conclusion and identify the inference rule. Now suppose instead we know and . Can we conclude ? Justify your answer using the truth table of the conditional.
Modus Tollens
For any propositions and ,
Discussion.
The claim is that a rule of inference is valid: granted the two premises, the conclusion follows. We already have one such rule, Modus Ponens, so rather than argue from truth values we rewrite the premises until that rule applies. The premise is equivalent to its contrapositive , and the second premise is precisely the antecedent of that conditional; Modus Ponens then delivers . So the proof is the contrapositive equivalence followed by one application of Modus Ponens.
Proof.
Assume and . By the Contrapositive equivalence, . Since is true, Modus Ponens applied to and yields .
The Latin name modus tollendo tollens (“the method of denying by denying”) captures the reasoning: if the consequence of an implication fails, its premise must also fail.
If is even, then is even. We observe that is not even and by Modus Tollens, 7 is not even.
Hypothetical Syllogism
Theorem 2.31 (Hypothetical Syllogism).
For any propositions , , ,
Discussion.
Again a rule of inference, but the conclusion is itself a conditional, and a conditional is established by assuming its antecedent and deriving its consequent. So there are three assumptions in play: the two premises, and taken on for the sake of the argument. From and the first premise Modus Ponens gives ; from and the second premise it gives . Having derived from , we discharge the assumption and conclude . Modus Ponens is used twice, and nothing else.
Proof.
Assume and . We wish to show . Assume . From and , Modus Ponens gives . From and , a second application of Modus Ponens gives . Since assuming led to , we conclude .
This inference is also called the chain rule or the transitivity of implication. A multi-step deduction is a chain of hypothetical syllogisms. For instance, suppose we know “if is divisible by , then is even” and “if is even, then is even.” Hypothetical Syllogism yields: “if is divisible by , then is even.”
Implication Elimination
Theorem 2.32 (Implication Elimination).
For any propositions and , .
Discussion.
The statement relates the two arrows: the connective , which lives inside a proposition, and the turnstile , which lives between propositions and asserts derivability. It says that from we may derive from . So we assume and must show , that is, derive from the assumption ; Modus Ponens applied to the assumption and the hypothesis does this. The converse direction is the discharge step used in the previous theorem.
Proof.
Assume . We must show . Assume . From and , Modus Ponens yields . Thus .
This gives one direction of the link between a conditional and a derivation: if is known, then from the assumption one may derive . The reverse direction will appear later in Direct Proof, where we show that if assuming leads to , then the conditional is established. Together, the two directions show how the turnstile and the conditional correspond: if and only if .
Further Propositional Inference Rules
Several additional inference rules arise from tautologies:
Conjunction. From two established truths, their conjunction follows.
The tautological justification is immediate, but Conjunction can also be derived from Modus Ponens alone via reductio.
Proof.
Assume and . Suppose for contradiction that . By De Morgan’s Law (Theorem 6, 1), . By the Conditional axiom, . Since holds, Modus Ponens yields . But is assumed, a contradiction. Therefore .
Simplification. From a conjunction, either conjunct may be extracted.
Addition. A known truth may be weakened to a disjunction.
Disjunctive Syllogism. If one disjunct is eliminated, the other must hold.
Resolution. Two clauses sharing a complementary literal may be combined, eliminating the shared variable.
Constructive Dilemma. Two conditionals with a disjunction of their antecedents yield the disjunction of their consequents.
Prove that all of these are tautologies.
Notice the relationships among these rules. Disjunctive Syllogism is a special case of Resolution (set and apply the Identity axiom). Addition is dual to Conjunction, and Simplification is a special case of Modus Ponens (since is a tautology).
Remark (Resolution Subsumes Other Rules).
Resolution can recover other rules. It gives Hypothetical Syllogism: rewrite as and as (by the Conditional axiom), then a single resolution step on yields , which is . It can also recover Modus Ponens: express as and as , and resolution gives by the Identity axiom. For this reason Resolution is the basis of automated theorem proving in computer science.
The following table collects the propositional inference rules for reference.
Identify the inference rule applied in each step of the following argument. Premises: (i) , (ii) , (iii) .
- From (ii) and (iii), conclude .
- From (i) and step 1, conclude .
Building Complex Arguments
Inference rules are used in chains. A valid argument is a sequence of steps in which each step is either a premise or follows from earlier steps by a single inference rule.
We show the following argument is valid. Premises: (1) , (2) . Conclusion: .
Show that the following argument is valid by listing each step and the inference rule used. Premises: (1) , (2) , (3) , (4) . Conclusion: .
Inference Rules for Quantified Statements
The rules above govern propositional logic. When predicates and quantifiers enter the picture, additional rules are needed to bridge the gap between universal or existential claims and their specific instances.
Universal Instantiation (UI). If a predicate holds for every element of the universe, it holds for any particular element :
Universal Generalisation (UG). If can be established for an arbitrary element (one about which no special assumptions are made), then follows:
The word “arbitrary” is critical. If the proof of exploits any property peculiar to , the generalisation is invalid.
Existential Instantiation (EI). If at least one element satisfies , we may introduce a name for such an element:
The name must be fresh: not previously used in the argument.
Existential Generalisation (EG). If a particular element satisfies , then at least one element does:
Universal Modus Ponens (UMP). Combining Universal Instantiation with Modus Ponens gives the quantifier rule used most often:
Write for the real numbers, and suppose we know , the universe being , and that . Universal Modus Ponens yields .
Identify the quantifier inference rule used in each step. The universe is the positive integers.
- “Every multiple of is a multiple of .” (Premise)
- ”, so is a multiple of .” (Premise)
- “Therefore, is a multiple of .”
- “Therefore, there exists a positive integer that is a multiple of .”
Example 2.35 (Combining Quantifier Rules).
We show that “a student in this class has not read the book” and “every student in this class passed the first exam” together imply “someone who passed the first exam has not read the book.”
Let denote ” is in this class,” denote ” has read the book,” and denote ” passed the exam.” The premises are and . We derive .
Fallacies
A fallacy is an argument form that appears valid but is not: the premises do not logically guarantee the conclusion, even though the reasoning may seem persuasive.
Two fallacies are especially common. Both arise from misapplying the conditional.
Affirming the Consequent. The argument ”; ; therefore ” is invalid. A counterexample: let and . Then is and is , but is .
Denying the Antecedent. The argument ”; ; therefore ” is equally invalid. With and , both premises are satisfied but is .
Both fallacies confuse an implication with its converse or its inverse: does not entail , nor does it entail .
“If it rained, the pitch is wet. The pitch is wet. Therefore it rained.” This affirms the consequent. The pitch might be wet because the sprinklers were on. The converse “if the pitch is wet, then it rained” does not follow from the original implication.
Identify the fallacy in each argument and provide a counterexample (an assignment under which the premises are true but the conclusion is false).
- “If , then . The number satisfies . Therefore .”
- “If , then . The number does not satisfy . Therefore .”
Proof Techniques
With inference rules in hand, we turn to the practical matter of constructing proofs. A proof is a finite sequence of statements, each of which is an axiom, a premise, or a consequence of earlier statements by an inference rule. What dictates the strategy is the shape of the claim: whether it asserts a conditional, a biconditional, a conjunction, a disjunction, or a quantification. Each shape comes with a direct method that builds the claim up from its parts, and an indirect method that assumes the negation and derives a contradiction.
Since these notes are about writing proofs, not merely admiring them, we will not simply state a result and prove it. Each proof comes with a Discussion, where we plan the argument and air the thought process, followed by the Proof itself, written in full English sentences with proper syntax and grammar. The two are kept apart on purpose. A discussion names the form of the statement, says which pieces have to be proved and by what method, and points to the definition or rule each piece will use; the proof then carries that plan out.
We have not built the numbers yet (although we have been using them), and doing so is where this course is headed. But until then we help ourselves to the arithmetic and order rules of school algebra, and we name our objects in words: a whole number is one of , and a real number is any point of the number line. Every rule borrowed along the way is proved from the ground up once we have the objects to prove it about, and where a proof below leans on a borrowed rule we say which one (we will collect on any debt as we continue).
Two properties of whole numbers come up often enough in the examples to be worth fixing now.
Definition 2.38 (Even and Odd).
A whole number is even if it can be written as for some whole number , and odd if it can be written as for some whole number . Every whole number is one or the other and never both.
Definition 2.39 (Prime and Composite).
A whole number greater than is composite if it is a product of two whole numbers each at least , and prime otherwise.
Proving Conditional Claims
Recall that asserts that whenever holds, necessarily holds. The conditional is already true in every case where fails, so no proof need consider those cases: it is enough to suppose and deduce .
The strategies are collected below. The justification column speaks about our proofs rather than inside them, and it uses for that outer step, keeping it apart from the connective that lives in the statements themselves; is the same arrow read right to left.
The last two are called indirect proofs, since they establish the conditional without constructing a chain from to .
The first two are degenerate, and they are worth naming only so that they are recognised when they occur. A trivial proof ignores the hypothesis altogether: “if , then ” holds because the conclusion holds for every . A vacuous proof shows instead that the hypothesis is never met: “for every real number , if , then ” holds because no satisfies .
Definition 2.40 (Direct Proof).
A direct proof of a conditional statement proceeds by assuming and deriving through a sequence of valid inferences. The assumption of is not asserted as fact; it is a hypothesis under which the argument operates.
This strategy reflects the Deduction Rule, a meta-logical principle: if assuming allows us to derive using valid inferences, then the conditional is established. The Deduction Rule connects the turnstile () and the conditional (): the statement (a syntactic derivation) becomes (a logical truth).
Strategy (Direct proof of a conditional).
Claim:
- Suppose holds.
- Prove that holds.
If , then .
Discussion.
We will assume and show . Our tool is the well-known algebraic rule (which we prove later on) that if and with all four numbers positive, then .
Proof.
Assume . Since , both and are positive, so multiplying the inequality by itself yields . Thus .
Our statements will grow considerably more complicated than this, but the shape stays the same. With the proof done, we may now say with full mathematical confidence that whenever a number satisfies , it automatically satisfies .
As we know the contrapositive is logically equivalent to , so proving either one proves the other. The swap is worth making when or carries a negation inside it, since negating it turns the assumption into a positive assertion we can compute with.
Strategy (Contrapositive proof of a conditional).
Claim:
- Suppose holds.
- Prove that holds.
This is the direct strategy applied to .
If , then .
Discussion.
Here is "" and is "". Proving this directly is awkward, since we would begin knowing a fact about and have to dig our way down to a fact about . The contrapositive reverses this. Since is "" and is "", the contrapositive reads “if , then ”, where we start from and build up to ; that direction is straightforward. So we will assume and show , announcing at the outset that we are proving the contrapositive.
Proof.
We prove the contrapositive: if , then . Assume . Since all terms are non-negative, multiplying by itself thrice gives , that is, . The contrapositive holds, so the original statement “if , then ” holds as well.
Indirect proofs
Every indirect method below uses proof by contradiction.
Definition 2.43 (Proof by Contradiction).
A proof by contradiction (Latin: reductio ad absurdum) establishes a proposition by assuming and deriving a contradiction, that is, a statement of the form for some proposition . Since a sound proof system cannot derive a false conclusion from true premises, the assumption must be false, so is true.
The opening move of such a proof is written so often that i abbreviate it to AFSOC standing for “assume for the sake of contradiction.” What we assume is the logical negation of the claim, so each indirect strategy below is really the negation rules of earlier read as instructions.
So in the case of the direct proof, the indirect method rests on the negation of a conditional, . Assuming the negation therefore means granting ourselves the hypothesis and the failure of the conclusion at once, which is one more fact to work with than a direct proof has.
Strategy (Indirect proof of a conditional).
Claim:
- AFSOC that holds and fails.
- Find a contradiction.
For all real numbers and , if , then or .
Discussion.
Our statement is the conditional , where is "" and is the disjunction ” or ”. A direct proof would have to settle which half of to aim at, and the hypothesis does not decide that for us, so we go indirectly. The negation of the whole statement is , and De Morgan turns into ” and ”. That leaves us with three inequalities: we add the two coming from and set the result against .
Proof.
AFSOC that and that the conclusion fails, so that and . Adding these two inequalities gives . But we assumed , and no number is both greater than and at most . Therefore, whenever , at least one of , holds.
Remark (Contradiction Against Contrapositive).
The two indirect routes are easy to confuse. A proof by contradiction assumes the negation of the entire statement, , and derives an absurdity from it. A contrapositive proof assumes only and derives , which is a direct proof of an equivalent statement and never mentions absurdity at all. In practice both are often labelled “proof by contradiction,” but the contrapositive route is usually the cleaner of the two, and it is the one to reach for first.
Prove that if , then .
Prove that for all whole numbers , if is odd, then is odd.
Prove that for all real numbers , if , then .
Proving Biconditional Claims
The connective is defined entirely in terms of : asserting is asserting the conjunction . That gives the obvious strategy, prove one conditional and then the other, and it exposes the most common mistake we see, which is proving one of them and stopping. The two directions are labelled () and (), and each may be proved by whichever of the conditional methods suits it; there is no requirement that both use the same one.
Strategy (Direct proof of a biconditional).
Claim:
- Prove that , by any of the conditional methods.
- Prove that , by any of the conditional methods.
Consider ” is even if and only if is even”. Before the proof, recall the two forms an even and an odd whole number take, and .
is even if and only if is even.
Discussion.
The two conditionals are , “if is even, then is even”, and , “if is even, then is even”. The first is straightforward: write and show that . The second is trickier, since its hypothesis tells us about when we want a conclusion about ; so we take its contrapositive , “if is odd, then is odd”, assume , and show that .
Proof.
() First, suppose is even, so for some whole number . Then , and since is a whole number, is even.
() The remaining conditional is “if is even, then is even”, and we prove its contrapositive: if is odd, then is odd. Suppose for some whole number . Squaring, and since is a whole number, is odd. The contrapositive holds, so the second conditional does too. Both conditionals are proven, and with them the biconditional.
Strategy (Indirect proof of a biconditional).
Claim:
- AFSOC that .
- In the first case, holds. Find a contradiction.
- In the second case, holds. Find a contradiction.
Whether this route is worth taking depends entirely on what and are, and the direct one usually wins; but it helps when both directions are hard to prove directly: the negations and each give two facts to work with, where the direct proof has one.
Let be a real number. Then if and only if no real number satisfies .
Discussion.
Our statement is the biconditional , where is "" and is “no real number satisfies ”. Both directions are hard to prove directly for the same reason, which is that is itself a denial: proving it outright would mean ruling out every candidate one at a time, thus negating gets round both problems. In the first case we hold along with , and produces an actual with , into which we may substitute . In the second we hold along with , and is exactly the condition under which we may divide by , which gives a that says does not exist.
Proof.
AFSOC that one of the two conditionals fails.
Suppose first that holds and fails, so that and some real number satisfies . Then , and .
Suppose instead that holds and fails, so that no real number satisfies , and . Since we may divide by it, and is then a real number with , which denies.
Neither case can stand, so both conditionals hold and the biconditional with them.
A third route is neither direct nor indirect. Rather than linking and to each other, we find an intermediary statement and prove and ; the chain then forces and to share a truth value. The acronym TFAE, “the following are equivalent,” names the theorems built this way: a list of conditions, all asserted to imply one another, proved by running a cycle of implications through the list.
Strategy (Intermediary proof of a biconditional).
Claim:
- Find a statement .
- Prove that , by any of the methods above.
- Prove that , by any of the methods above.
For a real number , the following are equivalent: ; the product is zero; or .
Discussion.
Our statement puts three conditions on a real number and asserts that any one of them forces the other two, so we take to be "" and prove the two biconditionals and ” or ”, each of them directly. The first is a rearrangement, and it runs in both directions because subtracting from both sides is undone by adding it back. The second is the zero product rule, which we borrow here and prove below.
Proof.
Take to be the statement "".
() Subtracting from both sides of gives , and , so holds. Adding to both sides of reverses the step, so the two conditions imply one another.
( or ) We borrow the zero product rule: a product of two real numbers is zero exactly when one of the factors is zero. (It is proved below, in the section on disjunctions.) So holds exactly when or , and the latter says . The chain of equivalences carries the truth value from the first condition to the third, so the three are either all true or all false.
Remark (Always Check the Converse).
A common error is to prove one direction of a biconditional and assume the other follows. Consider the equation . Squaring both sides and simplifying produces as the sole candidate. Squaring can introduce extraneous solutions, so we must substitute back: , and here the candidate is genuine. Contrast this with : squaring leads to candidates and , but , so only is a true solution.
Prove that a whole number is even if and only if is odd. Then prove it a second time by the indirect method.
Prove that a real number satisfies if and only if , , or .
Proving Conjunctions
A conjunction asks for two proofs; The only thing worth saying about the direct method is that both halves must actually appear.
Strategy (Direct proof of a conjunction).
Claim:
- Prove that holds.
- Prove that holds.
If , then and .
Discussion.
Let be "" and be "", with the hypothesis available to both. For we borrow a second rule of order, that if and , then ; since , multiplying by gives . For we multiply by instead, which the same rule permits once we know is positive, and has just told us that .
Proof.
Assume . Since , the number is positive, so multiplying both sides of by gives , which is the first half.
For the second half, note that , so is positive as well. Multiplying both sides of by gives . Both halves hold, so their conjunction does.
By De Morgan’s law the negation of is a disjunction, so the indirect method splits into two cases, each of which must be run to an absurdity.
Strategy (Indirect proof of a conjunction).
Claim:
- AFSOC that holds.
- In the first case, holds. Find a contradiction.
- In the second case, holds. Find a contradiction.
Prove the proposition above a second time by the indirect method, assuming that and that or . Compare the two proofs and say which you would rather read.
Proving Disjunctions
A disjunction asserts that at least one of two statements holds. If we can tell in advance which one it is, there is nothing to discuss: prove that one and ignore the other. That is the direct method.
Strategy (Direct proof of a disjunction).
Claim:
- Prove that holds, or else prove that holds.
The interesting case is when neither half holds on its own, because and are predicates and which of them is true varies with the object. Rather than sort out exactly which objects satisfy which, we argue that if holds the claim is already proved and need not be looked at, which leaves only the cases where fails, and there we must guarantee . Since , the roles may be swapped, and we assume whichever negation is more useful.
Strategy (Proof of a disjunction by otherwise).
Claim:
- Suppose holds.
- Prove that holds.
For every real number , either or .
Discussion.
Our statement is the disjunction , where is "" and is "", and neither half holds for every : the number satisfies and fails , while does the reverse. Thus, we take the “otherwise” route: here reads , and multiplying that inequality by the positive number gives .
Proof.
Suppose fails, so . Then is positive, and multiplying both sides of by gives . Hence in every case at least one of the two holds.
The negation of a disjunction is a conjunction of negations, so the indirect method grants us both failures at once.
Strategy (Indirect proof of a disjunction).
Claim:
- AFSOC that holds.
- Find a contradiction.
For all real numbers and , if , then or .
Discussion.
This is the zero product rule we borrowed for the three equivalent conditions above: the conclusion is a disjunction, so we assume the hypothesis and negate the conclusion, which by gives us and together. A non-zero real number may be divided by, so we divide through by and read off a statement about that the second half of the negation denies.
Proof.
Assume , and AFSOC that both halves of the conclusion fail, so that and . Since we may divide both sides of by , which gives . But we assumed , and no number is both zero and non-zero. Therefore at least one of , holds.
Prove that for every real number , either or .
Prove the proposition about and a second time, by the indirect method.
Proving Universal Claims
To prove we take an arbitrary element of and show that holds of it. Nothing may be assumed about that element beyond its membership in , and Universal Generalisation then gives the claim for every element of .
Strategy (Direct proof of a universal claim).
Claim:
- Let be arbitrary and fixed.
- Prove that holds.
For all whole numbers , the number is composite.
Discussion.
Our statement is universally quantified over all integers . To prove that is composite, we must, by definition, produce two integers each strictly greater than whose product is . The identity gives us exactly such a factorisation. The only possible concern is whether the smaller factor, , is at least . The hypothesis settles this: subtracting from both sides of yields , which is precisely the lower bound we need. (Had we allowed , the factorisation would read , which is prime and therefore would fail.)
Proof.
Let be any whole number. Notice that , a product of two whole numbers. Since , the smaller factor satisfies , so is a product of two whole numbers each at least . Thus is composite.
Remark (Arbitrary Is Not Specific).
Consider the statement “for every whole number , ”. The following is not a valid proof: “let be an arbitrary whole number, say . Then .” The writer has chosen a specific value, not an arbitrary one, and what has been proved is the existential claim, that some whole number has a non-negative square. A correct proof never names , and every step in it must hold for all the values might have taken.
The negation of a universal claim is an existential one, and the work is to show that no such object can exist. This is the route to take when the claim says that something does not happen, since “there is no object with this property” is a universal claim under a negation; it says that every object fails to have the property.
Strategy (Indirect proof of a universal claim).
Claim:
- AFSOC that there is some for which holds.
- Find a contradiction.
There is no least positive real number. That is, no positive real number satisfies for every positive real number .
Discussion.
The statement says that every positive real number fails to be least, which is a universal claim although the negation in front of it hides the fact. Its negation is existential and supplies a positive with for every positive , so we assume such an and look for a positive number smaller than it. Halving serves: is positive whenever is, and it is smaller than , so it both must and cannot satisfy the inequality was assumed to satisfy.
Proof.
AFSOC that a least positive real number exists, so that and for every positive real number . Consider . Since we have , so is itself a positive real number, and being one it must satisfy . But , and no number is both smaller than and at least . Therefore no least positive real number exists.
Prove that for every real number there is a real number with .
Let be a real number with , and suppose for every positive real number . Prove that .
Proving Existential Claims
An existential claim is a claim of existence: it asserts that some object belongs to a set and has a certain property. To prove one we exhibit such an object and verify, for our reader, both halves of the assertion, that the object is an element of the correct set and that it has the correct property. Existential Generalisation then yields the claim. A proof of this kind is called constructive, since the witness is produced.
Strategy (Direct proof of an existential claim).
Claim:
- Define a specific object .
- Prove that .
- Prove that holds.
Fix real numbers with . Then there are real numbers and satisfying both
Discussion.
The claim is existential, so the proof must produce a specific pair , and check that it satisfies both equations, which means we have to find the pair before we can write anything down. Multiplying the first equation by and the second by makes the two terms cancel when we add:
so , which is a real number precisely because . Cancelling the terms the same way, by multiplying the first equation by and the second by , gives and so .
None of this scratch work belongs in the proof. A reader does not care how we came upon the pair; they care what the pair is and why it works, and the proof is shorter and easier to check for leaving the search out.
Proof.
Since , we may define
and both are real numbers. Substituting them into the two equations,
So the pair satisfies both equations, and such a pair exists.
In a non-constructive existence proof we establish that a witness must exist without identifying it. The indirect method is of this kind: it never produces the object; it only shows that its absence leads to a contradiction.
Strategy (Indirect proof of an existential claim).
Claim:
- AFSOC that for every , holds.
- Find a contradiction.
Let , , be real numbers. Then two of them have a non-negative product.
Discussion.
The claim is again existential, but this time there is no pair we could name in advance, since which two work depends on the signs of , , and the statement gives us no signs. So we prove it indirectly. The negation says that every pair fails, and it hands us the three inequalities , and at once. Multiplying all three together produces , and a square cannot be negative.
Proof.
AFSOC that no two of , , have a non-negative product, so that , , and . Multiplying the first two of these negative numbers gives a positive one, and multiplying that by the third gives a negative one, so
But , and we borrow the rule that the square of a real number is never negative. (It is proved below, in the section on disproving claims.) So is both negative and non-negative, which is impossible. Therefore some two of , , have a non-negative product.
Notice what the proof does not tell us: which pair it is. It shows only that every pair cannot fail at once, which is what makes the argument non-constructive.
Unique existence asks for a second step. We find the object that works, then show it is the only one, which we do by assuming that and both work and concluding that .
Strategy (Proof of a unique existential claim).
Claim:
- Prove , by either method above.
- Suppose and both hold, and prove that .
There exists a unique real number such that .
Discussion.
Unique existence is two claims, so the proof comes in two halves. Existence asks for one real number satisfying , and we verify by substitution rather than display the rearrangement that found it. Uniqueness is the half that is often forgotten: producing a solution says nothing about whether there is a second one, so we suppose that and both satisfy the equation and show that the supposition forces .
Proof.
Consider : then , so at least one real number works. For uniqueness, suppose and both satisfy the equation. Then , so , and dividing by gives . Thus exactly one real number satisfies .
Fix a real number . Prove that the equation has exactly one real solution.
Fix a real number . Prove that there is a real number satisfying .
Disproving Claims
To disprove a statement is to show that its truth value is , and by the definition of negation that is the same as showing its negation is . So there is nothing new to learn: write down the logical negation, then prove that statement by whichever of the strategies above fits its shape. The negation rules are what turn the disproof into a proof, and they say which shape we end up with.
Disproving a universal claim therefore means proving an existential one, and the object we produce is the counterexample we met when the quantifier was introduced. Exhibiting a single one settles the matter, however many objects satisfy the claim.
Example 2.56 (A Universal Claim).
Disprove: for all prime numbers , the number is odd.
Discussion.
Disproving a universal claim means proving its negation, which here is the existential claim that some prime fails to be odd, so one prime is all we have to produce. An even number has the form , and any makes a product of two whole numbers each at least , hence composite; that leaves as the only candidate, and it works.
Disproof.
The number is prime, and is even. Thus it is not true that all primes are odd.
Disproving an existential claim is the harder direction, since its negation is universal: every single object must fail, and there is no shortcut through exhibiting one of them.
Example 2.57 (An Existential Claim).
Disprove: there exists a real number such that .
Discussion.
Disproving an existential claim means proving its negation, and that negation is universal: every real number must satisfy , so no single well-chosen will settle it and the argument has to cover all of them at once. What stands in the way is the sign of , which we are not told and which decides how the inequality behaves under multiplication, so we split on it and run the two cases separately.
Disproof.
We show that for all real numbers , . Every real number falls into one of two cases, or . If , multiplying the inequality by itself preserves the sign, so , that is, . If , multiplying through by flips the inequality to ; multiplying by itself then gives , so and in particular . Either way , so the claim is false.
Disprove: for every real number , .
Disprove: there is a real number with .
The Law of Excluded Middle
Theorem 2.58 (Law of Excluded Middle).
For any proposition , is a tautology.
Discussion.
To call something a tautology is to say it is equivalent to , so the claim is the single equivalence . The Complement axiom asserts almost exactly that, but with the disjunction written in the other order, so the statement follows from the axiom by Commutativity. In this system the law of excluded middle is an axiom with its arguments swapped.
Proof.
By the Complement axiom, . By the Commutativity axiom, . Therefore .
The Law of Excluded Middle (LEM) asserts that every proposition is either true or false; no third possibility exists. In proofs, LEM is what allows us to split into the exhaustive cases and without knowing which of them actually holds, and a conclusion reached in both cases is established without our ever finding out.
Let and be whole numbers. If is even, then is even or is even.
Discussion.
Our statement is the conditional whose hypothesis is ” is even” and whose conclusion is the disjunction ” is even or is even”. The hypothesis says nothing about on its own and no computation extracts it, so we appeal to LEM and split on whether is even. One case gives the conclusion immediately. In the other is odd, and we show that an odd would make odd against the hypothesis, which leaves even.
Proof.
Suppose is even. By LEM, either is even or is odd.
Case 1. If is even, the conclusion holds immediately.
Case 2. Suppose is odd, so for some whole number . If were also odd, say , then so would be odd, contradicting the hypothesis that is even. Therefore is even.
In both cases at least one of , is even.
Using the Law of Excluded Middle, prove that for all whole numbers , the number is even.
Look again at the proof above. Where was the Law of Excluded Middle used, where was contradiction used, and what was the contradiction? Prove the same result twice more: once using contradiction without LEM, and once using LEM without contradiction.
Ex Falso Quodlibet
The principle ex falso sequitur quodlibet (“from falsity follows whatever you like”) states that from a contradiction, any proposition may be derived:
Its validity rests on the tautology : since is identically false, the conditional holds for every by vacuous truth.
Example 2.60 (Consequences of a Contradiction).
Suppose we accept the false premise . Adding to both sides gives , a false consequence. Squaring both sides gives , a true consequence. From a single contradiction, both true and false statements follow. Once a contradiction enters, the proof system can no longer distinguish truth from falsehood, and every proposition becomes derivable.
We rarely invoke Ex Falso directly, but every indirect proof above rests on it: if assuming the negation of our claim produces a contradiction with our true premises, then that negation cannot coexist with those premises, and the claim must hold.
Using Assumptions in Proofs
When we state a theorem it usually has hypotheses and a conclusion, and those hypotheses are ours to use: we add them to our toolkit for the duration of the proof, along with whatever facts we develop along the way.
A disjunction means cases. Suppose that at some point we have assumed or deduced . Knowing the disjunction holds means at least one of , holds, so we may consider each separately and argue as follows.
Strategy (Using a disjunction).
Because , we have two cases.
Case 1. Suppose holds. Then …
Case 2. Suppose holds. Then …
As long as the goal is reached in both cases, the deduction stands; this is the disjunction elimination rule. There is no need for a third case in which both hold, since it might not arise at all, and reaching the goal from one or the other on its own shows that assuming both was never necessary.
Remark (Without Loss of Generality).
It sometimes happens that two cases are identical up to a relabelling of variables. We then handle one case and dismiss the other with the phrase “without loss of generality” (abbreviated WLOG). For instance, to prove by contrapositive that “if and are whole numbers and both and are even, then and are both even,” we must show that if or is odd then or is odd. Since the hypotheses are symmetric in and , we may assume WLOG that is odd; the remaining case follows by swapping and .
“There exists” is not “let such an be given”. Writing in the middle of a proof asserts only that the line is true: that some element of with the property is out there. It does not introduce one. If we go on to refer to afterwards, the step is not valid, since nothing has been named; several such elements might exist, and a reader cannot be left to guess whether we mean all of them or one in particular. To bring one into play, say so: let such an be given. Thereafter names an element with that property and may be used like any other object. Several at once are introduced the same way: “and so we deduce that there exist whole numbers , , such that holds. Let such , , be given.”
"" is not ”, therefore ”. Writing on the page asserts that the implication holds; it does not assert . To deduce we must make it clear that we also have , and that we are using Modus Ponens on the two.
Strategy (Using a conditional).
because …
Also, holds because …
Therefore holds.
Remark (Mistakes in Proofs).
A chain of equalities is valid only if every step is. Consider the “proof” that :
The error is in the third step: the law requires . Each step in a proof must be a valid inference rather than a plausible manipulation.
Finally, Quantifiers can also conceal errors. The formula is a propositional tautology (verify this by truth table). Substituting predicates = ” is odd” and = ” is prime,” one might reason: “for every , either oddness implies primality or primality implies oddness.” Yet neither nor is true. The resolution is that is not the same as . The universal quantifier does not distribute over disjunction. The first formula is indeed true (for each fixed , one of the two conditionals holds), but the second is false.
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.
Each expression below is built from predicates over a fixed universe. Say what it is.
Membership and the bounded quantifiers.
Let . Which holds?
Some object lies outside . Which of these is then true, whatever is?
Negate each statement, leaving no negation in front of a quantifier and no “it is not the case that” anywhere.
Every multiple of is even.
There is a real number such that and .
If is prime, then is odd.
Take the conditional “if is a multiple of , then is a multiple of ”, with ranging over the whole numbers.
The converse and the inverse are:
The contrapositive is:
Whatever conditional we had started from, at most how many distinct truth values can the four statements carry between them?
Let be the whole numbers and let denote ” is even”.
For , which witness works?
Let and be predicates over an arbitrary universe. Classify each statement.
Each argument form below is invalid. Give an assignment at which every premise holds and the conclusion fails.
Push each negation inward until it stands in front of the predicate alone.
The shape of a claim decides the shape of its proof.
Take the claim: for every real number , if then . A proof of it by contrapositive opens by assuming:
A proof of the same claim by contradiction opens by assuming:
A proof of that produces a witness and stops there has established:
To disprove :
Counterexamples, over the whole numbers in the first part and the real numbers in the second. Two whole numbers are said to have the same parity if they are both even or both odd.
If is even, then is even.
If , then .
For whole numbers and , the sum is even exactly when:
Let and be real numbers and consider the equation .
Suppose , so that the equation has exactly one real solution. Which step of the uniqueness half of that proof is the one that uses ?
If :
A whole number is a difference of two squares if it can be written as for whole numbers and .
Which pair of squares has difference ?
Which whole numbers are a difference of two squares?
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 ⟨ ⟩.
The last sheet gave us three tactics, intro, exact and apply, and with them the implication, , and negation. What is missing is the rest of the connectives. Each of , and comes with two questions: how to prove one, and what to do with one we have been handed. The quantifiers wait for the next sheet.
Conjunction
constructor
A conjunction is proved by proving both halves. If the goal is ⊢ p ∧ q, then constructor replaces it with the two goals ⊢ p and ⊢ q. A tactic acts on the first goal only, so from here on we write each goal’s proof under a focus dot ·, indented; the dot takes the first goal and the block under it must finish that goal off.
Example.
Put the caret on the constructor line and then on the line below it to watch one goal become two.
A conjunction may also be built in one term: ⟨hp, hq⟩ is the proof of p ∧ q made from a proof of each half. Type \< for ⟨ and \> for ⟩.
Taking one apart
If h : p ∧ q then h.1 is a proof of p and h.2 is a proof of q; they may also be written h.left and h.right.
Example.
The projection is a term, so it goes where any other proof would.
obtain
Where both halves are wanted, it reads better to take the hypothesis apart once and for all. obtain ⟨hp, hq⟩ := h replaces h : p ∧ q with hp : p and hq : q.
Example.
The same brackets take a conjunction apart on the left and build one on the right.
Two assumptions make their conjunction.
The order of a conjunction carries no information.
Nor does the bracketing.
Two hypotheses taken in turn, against the two taken together.
No statement holds alongside its own negation.
Disjunction
left and right
A disjunction is proved by proving one half and saying which. With the goal ⊢ p ∨ q, left changes it to ⊢ p and right changes it to ⊢ q. The choice is ours to make and cannot be deferred, so making the wrong one leaves a goal that cannot be closed. In term form the two are Or.inl and Or.inr, each applied to a proof of the half it names.
Example.
Nothing is known about , so the right half is the one to go for.
rcases
A disjunction we have been handed is weaker than a conjunction: it says that one of the two holds without saying which, so anything we conclude from it has to be concluded twice. rcases h with hp | hq splits h : p ∨ q into two goals, the first with hp : p and the second with hq : q, and the bar is what marks the split.
Example.
The goal is the same in both branches; only the hypothesis differs.
The order of a disjunction carries no information either, but here we must first find out which half we were handed.
Nor does the bracketing of a disjunction.
Conjunction distributes over disjunction.
One of De Morgan’s laws.
Half of the defining equivalence of the conditional.
And the other half.
Equivalence
Both directions
p ↔ q is the conjunction of p → q and q → p, and it behaves like one. On a goal ⊢ p ↔ q, constructor leaves the two implications as separate goals; ⟨h, k⟩ builds the equivalence from a proof of each direction.
Example.
The two goals arrive in the order the equivalence is written.
If h : p ↔ q then h.mp is the forward implication and h.mpr the backward one, so h.mp hp is a proof of q and h.mpr hq a proof of p. obtain ⟨f, g⟩ := h takes the two apart as it does for a conjunction.
Example.
An equivalence is used in whichever direction the goal asks for.
An equivalence may be read from either end.
Equivalence is transitive.
A statement conjoined with itself says no more than the statement.
Equivalent statements may be swapped for one another inside a disjunction.
No statement is equivalent to its own negation.
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 |
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 |
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 |
Lesson 3
Naive Sets
Taught
Sets
In the last chapter, we introduced predicates, quantifiers, and (most importantly) sets, attempting to characterise our mathematical discourse around them as well-defined; although we now possess the necessary tools to work with them directly, we will still set out a formal framework: a system of axioms for sets, just as we established for logic in Chapter 1. The result will be a somewhat overcomplete collection of axioms (a style not typically used when teaching set theory); some of these axioms can be used to deduce others.
Axioms
The previous definition of the set as nothing more than a collection of objects, although circular as collection is merely a set under a different name, is useful and intuitive enough that to form a collection of object is to abstract from the intrinsic nature of the items themselves.
The logicians have in any case turned this into a method by asking where an object sits rather than what it is. A set, in this picture, is a “primary” box holding other “secondary” boxes, its elements, which may contain further boxes in their turn, and so on as far down as one cares to follow; the composition of the box never matters, only the arrangement of which box lies within which, so that two boxes with the same contents are the same box. The picture asks two things of us:
There exists a set with no elements, : called the empty or null set, written as or .
If is a set, then is also an object. In particular, a box is itself an object and an object may go inside a box , and therefore it is meaningful to ask whether is also an element of .
Remark.
Georg Cantor built set theory on that move somewhere between 1870 and 1890, taking the totality of objects sharing a given property to be one new object. The subject so founded divides into two: a first-order study of the sets themselves, and a higher-order study that turns upon the first to ask how far such knowledge can reach, where it shades into metamathematics, (we wont study this far). Many of his contemporaries objected, since such an object might be infinite.
Using our picture, we summarise the two relations used to build up set theory. The first, introduced last chapter, is the membership relation : if is an object and is a set, then is either true or false (it is well defined, which we come to in a second); note that if is not a set then does not make sense, like saying . The second is the equality relation : and name the same object, and its negation is written or . The equality relation obeys the three laws one expects: reflexivity, ; symmetry, if then ; and transitivity, if and then . The two relations, and , obey axioms we will state as we need them; when the objects named are sets, the axiom of extension below tells us how to recognise that sameness.
Remark (Substitution).
Given any two objects and with , the statements and are equivalent for every property depending on . This is customarily taken as the axiom of substitution, but we are not assuming anything new: a predicate had its truth value fixed by the objects assigned to its variables rather than by the terms naming them, and says those two terms name one object, so and are the same assignment twice over.
If two sets and have the same elements, then they are equal,
From the axiom we know that sets are unordered, as the biconditional shows, and that repetition does not count, as the box picture makes plain. There is no point in dropping two secondary boxes and into when, opened all the way down, they hold the same contents; they are not distinct objects, however distinct they may look.
The sets and are equal.
From these axioms, we prove that the notion of equality for sets given by extensionality obeys them as well.
Remark.
From here on there are two natural styles for writing such a proof. The first chases the element through in prose, spelling out what each membership means as it goes; the second works directly on the predicates, transforming "" into "" by the laws tabulated in the first chapter. Both are correct, and tastes differ; I prefer the logical style, but I will give both throughout for completeness, and you should be able to read each.
Theorem 3.5 (Equality of sets is an equivalence relation).
Let , and be sets. Then ; if then ; and if and then .
Since is the statement , we prove it just as proving universal claims taught us to prove any universally quantified biconditional: take an arbitrary , and show that and stand or fall together.
Discussion.
Every one of the three claims has the same form once extensionality is applied: We first note that the biconditional splits into its two constituents, , so each law fixes an arbitrary object , proves two implications about its membership. For reflexivity, , or ; there is no hypothesis to argue from, so we read the implication through the defining equivalence of the conditional as , which Complement makes , and a conjunction of two such is again. For symmetry we assume , or, ; by Commutativity of , gives us which is . For transitivity we assume and , which give four implications between three memberships: is the chain of with by hypothetical syllogism, and is the chain of the other two the same way.
Proof (element style).
Let be an object.
For reflexivity, we must show that lies in exactly when it lies in . If then , and if then , so the two memberships stand or fall together whichever way falls. As was arbitrary, Axiom 3.3 gives .
For symmetry, suppose . Then by substitution. If then that biconditional puts in , and if it puts in , so . As was arbitrary, Axiom 3.3 gives .
For transitivity, suppose and . Then and by substitution. If , the first carries it into and the second into ; if , the second carries it back into and the first into . So , and as was arbitrary, Axiom 3.3 gives .
The axiom of extensionality also tells us that the empty set is unique.
Proposition 3.6 (Uniqueness of the empty set).
There is exactly one set with no elements.
Discussion.
By Axiom 3.1 , we know there is at least one set with no elements, so uniqueness is the claim that any two such sets are equal. Suppose is a different set that doesnt have any elements. By definition must equal , which by Axiom 3.3 , is the statement , for an arbitrary object . Neither set , and has elements, so both of its sides are , and is by biconditional.
Proof.
Let and both be sets with no elements, and let be an object. Since has no elements, , and since has no elements, ; both and are therefore . By the biconditional, is , so . As was arbitrary, Axiom 3.3 gives . Any two sets with no elements are equal, so there is only one, and we are entitled to speak of the empty set.
If a set is not equal to the empty set we call it non-empty. The following is a small statement, but one we will lean on often.
Proposition 3.7 (Single choice).
Let be a non-empty set. Then there exists an object such that .
Discussion.
The statement is existential, and proving existential claims asks for a witness, which the hypothesis does not name. We prove it by contradiction: denying the conclusion makes false for every object , and is false by Axiom 3.1 , so is by the biconditional and Axiom 3.3 gives , against the hypothesis.
Proof.
Suppose, for contradiction, that no object satisfies . Let be an object. Then , and by the axiom of existence . Both memberships are false, and as was arbitrary, (by Axiom 3.3 as is true), contradicting being non-empty, so some object satisfies .
Remark.
Firstly The emptyset is not the same thing as the number 0. One is a set; and the other a number. Secondly Proposition 3.7 is what licenses the word “choose”: given a non-empty we may pick out an element of it and give that element a name, and it is the hypothesis that earns us the right to do so. Taking one element from each of finitely many non-empty sets at once is a further step, and we will take it when we need it. Taking one from each of infinitely many is a different matter again: nothing we have assumed so far reaches that far, and it takes an axiom of its own, the axiom of choice, which we will keep running into.
Let and be sets. Show that if and only if there is an object belonging to one of them and not to the other.
Set-Builder Notation
We go back to last chapter, where we combined sets with predicates. To describe a set by a defining characteristic, or by carving a condition into a larger set, we use set-builder notation; a set so described takes the form
read ” is the set of all such that is true”, with "" meaning such that (note that some people use "" over ”|”) and a predicate.
This right now sounds like the well-defined set we spoke of earlier, but it isnt. As written the notation is unrestricted, and Russell’s paradox is what that costs us. Define
We can ask a few questions, like what the elements of are. Any of the sets we have discussed so far would be one: the empty set contains no elements, so it certainly does not have itself as an element, and . But what about itself?
- Suppose . The defining property of tells us that each of its elements is a set which does not have itself as an element, so .
- Suppose . Then is a set which does not have itself as an element, and that is the defining property, so .
Each assumption gives us its own negation, so . No statement is equivalent to its own negation, so the fault is with the notation that produced : we let the predicate range over everything at once.
Is a paradoxical set? Say why or why not; (b) does it have any elements?
So currently written our set-builder notation isnt safe. The axiom below is what makes it safe, and it carves into a set we already have.
For every set and every predicate there exists a set whose elements are exactly the elements of for which holds, .
The predicate no longer ranges over everything; it ranges over the elements of a set we are holding already, so Russell’s is never formed. What we may write down instead is , which is a perfectly ordinary set, and asking whether it belongs to itself gets an ordinary answer.
Proposition 3.9 (The carved set is unique).
Let be a set and a predicate. There is exactly one set such that if and only if and .
Discussion.
Axiom 3.8 supplies at least one such , so uniqueness is the claim that any two are equal. We prove this directly: We assume there is a second set satisfying the same membership condition. By Axiom 3.3 , is the statement , and the work is that one biconditional at an arbitrary object . Both sets carry the same membership criterion, so each side of it is equivalent to , and the two sides are joined through that.
Proof.
Let and both satisfy the criterion, and let be an object. Then and , so by the transitivity of equivalence. As was arbitrary, Axiom 3.3 gives .
Since there is only one such set, we may name it.
Definition 3.10 (Set-builder notation).
Let be a set and a predicate. The unique set such that if and only if and is written .
The criterion settles membership one object at a time: given any object , whether holds is decided by whether and do, and both of those have a truth value already.
Definition 3.11 (Well-defined set).
A set is well defined when has a truth value for every object .
We note that every set Axiom 3.8 builds is well defined, since is a predicate and a predicate has a truth value once its variable is assigned.
Let and be sets. Show that the set of objects lying in and not in exists.
We said at the outset that our collection of axioms would be somewhat overcomplete, and here is one instance of it: Axiom 3.1 asks for a set with no elements, but comprehension will produce one from any set at all.
Proposition 3.12 (Existence from comprehension).
Suppose some set exists. Then there is a set with no elements.
Discussion.
The hypothesis names a set but says nothing about its elements, so we can neither point at an object in it nor rule one out. What Axiom 3.8 lets us do is carve that set by any predicate we please, so we pick one no object can satisfy: fails for every object by the reflexivity of equality, and the set it carves out is then empty whatever we started from.
Proof.
Let be a set. By Axiom 3.8 , is a set, and for every object . Since for every object, is , and . As was arbitrary, has no elements.
Restricting the notation avoids the paradox. The cost is that there is no set of everything.
Proposition 3.13 (No set of all sets).
There is no set such that every set is an element of , that is, , with ranging over sets.
Discussion.
The claim is a negative existence statement, so we prove it by contradiction: we assume such a exists and use it to build a set that cannot exist. Axiom 3.8 applied to and the predicate ” is not an element of itself” produces , which is where Russell’s argument runs again, this time inside the axiom rather than outside it. The question is whether , and the membership criterion is a biconditional, , so either answer forces the other.
Proof.
Suppose is a set containing every set. By Axiom 3.8 , is a set, and since contains every set, . If , then by the membership criterion satisfies the defining predicate, so ; if , then and both hold, which is the criterion, so . Each alternative gives its own negation, so no such exists.
Pairs
Were these the only axioms we had, set theory would be a paper thin subject: Axiom 3.1 gives us the empty set, and Axiom 3.8 only ever carves into a set we are already holding, so every set we could name would be empty. The axioms below build new sets.
For any two objects there is a set containing exactly those two, .
Definition 3.15 (Pair and singleton).
Let and be objects. The set given by pairing them is written , and we write for , the singleton of .
Remark.
The axiom asserts that such a set exists; that there is only one comes from Axiom 3.3 , by the argument of Proposition 3.9 . Two sets answering to the same membership criterion agree on every object, so they are equal; the same holds for every set we name from here on.
Since is an abbreviation rather than a further axiom, no separate axiom for singletons is needed: pairing an object with itself produces one.
Proposition 3.16 (Pairs are unordered and absorb repetition).
Let and be objects. Then , and if and only if , for every object .
Discussion.
The first claim is an equality of sets, so by Axiom 3.3 it is a biconditional at an arbitrary object , and the membership criterion of Axiom 3.14 rewrites each side as a disjunction: on the one side and on the other, which the axiom of Commutativity exchanges. The second claim is not an equality of sets, since is by Definition 3.15 another name for ; what has to be shown is that the pair criterion collapses, reducing to by Idempotence, so that the singleton holds the one object and nothing else.
Proof (element style).
Let be an object and suppose . By Axiom 3.14 , or . In the first case is the second of the two objects paired to form , and in the second case it is the first, so either way. Interchanging and throughout carries an element of back to . As was arbitrary, Axiom 3.3 gives . For the singleton, is . If , then by Axiom 3.14 or , and both alternatives say the same thing, so . Conversely, if then the first alternative holds, so , which is .
Proof (logical style).
The empty set is a set, hence an object by Axiom 3.2 , so pairing it with itself gives the singleton . That in turn is an object, so we may form , and pairing the first two gives .
Show that , , and are four different sets.
Every set we can build so far holds at most two elements; to grow them we take a set whose members are themselves sets and pool everything they contain.
Given any set of sets, there is a set containing precisely those objects which are members of some set in the collection, .
Definition 3.19 (Union of a system of sets).
Let be a set. The unique set such that if and only if for some is written .
Definition 3.20 (Union of two sets).
Let and be sets. Then denotes the set .
Two axioms are at work in that second definition: pairing gathers and into one collection, and union pools what they hold. Membership in the result reads as a disjunction.
Proposition 3.21 (Membership in a union).
Let and be sets. For every object , .
Discussion.
is , so Axiom 3.18 reads its membership as , an existential claim about which member of the collection holds . The collection has only two members, since Axiom 3.14 gives , so the witness can only be or and the existential claim collapses into the disjunction of those two cases.
Proof (element style).
Let be an object and suppose , which is to say . By Axiom 3.18 some set has and , and by Axiom 3.14 that is either or . In the first case and in the second , so or .
Conversely, suppose or . If , take to be : then , and by Axiom 3.14 , so is a witness and . If instead , take to be and argue the same way. Either way .
Proof (logical style).
Let be an object.
The fifth step is the distribution of an existential over a disjunction from the last chapter, and the last discharges each witness by substitution, since a with may be replaced by throughout.
The “or” is the disjunction of the first chapter, inclusive as always, so an object lying in both sets lies in the union too.
Proposition 3.22 (Union is well defined).
Let , and be sets with . Then .
Discussion.
An operation on sets should not depend on how we happened to name its arguments, and the criterion of Proposition 3.21 ensures this here: membership in is decided by membership in and in , and makes membership in and in the same question. So the two unions meet the same criterion at every object, and Axiom 3.3 gives the equality.
Proof (element style).
Let be an object and suppose . By Proposition 3.21 , or . If , then by substitution, since ; if , there is nothing to change. Either way or , so by Proposition 3.21 .
For the converse, by the symmetry of equality established in Theorem 3.5 , so the same argument run with in place of carries an element of into . As was arbitrary, Axiom 3.3 gives .
Proof (logical style).
With membership in a union settled, the basic properties of the operation follow from the corresponding properties of .
Proposition 3.23 (Basic properties of unions).
Let and be objects and let , and be sets. Then
- ;
- ;
- ;
- .
Discussion.
Every claim is an equality of sets, so by Axiom 3.3 each is a biconditional at an arbitrary object , and Proposition 3.21 turns each side into a disjunction of memberships. What is left is a propositional identity in each case: Commutativity of for the second claim, Associativity for the third, and for the fourth, Idempotence for together with the axiom of Identity for the two involving , since is by Axiom 3.1 . The first claim uses earlier results: Axiom 3.14 gives on the left, and Proposition 3.16 reads each singleton on the right as a single equation, so the two sides meet at the same disjunction.
Proof (element style).
Let be an object.
For the first claim, suppose . By Axiom 3.14 , or . In the first case by Proposition 3.16 , and in the second , so either way by Proposition 3.21 . Conversely, if then or , so or , and .
For the second, suppose . Then or , which is to say or , so . The same argument with and interchanged gives the reverse.
For the third, suppose . Then or . If , then , and so . If instead , then or ; in the first case at once, and in the second and hence . So every element of lies in , and a similar argument gives the reverse.
For the fourth, says or , which says . And says or , where the second alternative is impossible by Axiom 3.1 , so it says ; the same holds for .
In each case was arbitrary, so Axiom 3.3 gives the four equalities.
Proof (logical style).
Let be an object, and write , , for the propositions , , .
We note that goes the same way after Commutativity. In each case was arbitrary, so Axiom 3.3 gives the equalities.
Because of associativity, we do not need to use the brackets: names one set regardless of how we group it ( or , both mean the same thing), and likewise for and longer strings.
Definition 3.24 (Triples and longer).
Let , , be objects. We write for , and for , and so on for any string of objects written out in full.
The set holds those objects lying in , or in , or in both, which are , and . So .
The phrase “and so on” cannot yet be justified. Writing a set of objects for an unspecified means iterating the construction times, and we have not said what iterating a construction a given number of times amounts to; a set of infinitely many objects is further out of reach still. Later axioms will build sets that large.
Let be a set. Show that .
Subset
Comparing sets, we can see that some sit inside others, and we say the smaller one is a subset of the bigger. We write for this throughout, whether or not the two sets happen to be equal.
Let and be sets. We say is a subset of , written , if every element of is an element of . If moreover , we call a proper subset of and write .
In logical language this is a universally quantified implication between predicates,
and this reading will drive every subset proof we write: to prove we take an arbitrary , assume , and reach .
The empty set is a subset of every set . The implication has a hypothesis no object can satisfy, and an implication with a false hypothesis holds automatically; a promise never invoked is never broken. So , vacuously.
The definition uses nothing but and , and both obey substitution, so the subset relation does too: if and , then .
Proposition 3.28 (Subsets are transitive).
Let , and be sets. If and , then .
Discussion.
The conclusion is itself a universally quantified implication, so we assume for an arbitrary object and must reach . The definition of subset is the only tool needed: trades membership in for membership in , and trades membership in for membership in , so is carried into and then into .
Proof (element style).
Let . By the definition of subset, gives , and gives . As was arbitrary, .
Proof (logical style).
For any object ,
so holds for every , which is .
Mutual inclusion is the other way of saying two sets are equal, which is what we should expect: the obvious way to define equality of sets is to say they contain exactly the same elements, and that is two implications rather than one.
Proposition 3.29 (Mutual inclusion is equality).
Let and be sets. If and , then .
Discussion.
By Axiom 3.3 the conclusion is a biconditional at an arbitrary object , and by the defining equivalence of the biconditional that biconditional is the conjunction of two implications. Those two implications are exactly what the two inclusions say, so the hypotheses give the conclusion once both sides are unfolded into their logical form.
Proof.
Let be an object. By the definition of subset, gives , and gives . The two together say that lies in exactly when it lies in , so . As was arbitrary, Axiom 3.3 gives .
Proposition 3.30 (Proper subsets are transitive).
Let , and be sets. If and , then .
Discussion.
A proper inclusion is two claims, so the conclusion is two claims. The inclusion is Proposition 3.28 applied to the two inclusions we are given, which leaves . For that we need an object separating them, and supplies one: were every element of in we would have , and with that makes by Proposition 3.29 , against . That object lies in but not in , so it cannot lie in either.
Proof.
From and we get by Proposition 3.28 , so it remains to show . Since , some object lies in but not in : otherwise every element of would be an element of , giving , and with that would make by Proposition 3.29 . Now suppose . Then by substitution, and gives , contradicting . So , and with this is .
Is for every set ?
Let . Which of , and are true?
More Set Operations
Swapping the “or” for an “and” gives the intersection, whose members must belong to both sets at once.
Definition 3.31 (Intersection).
Let and be sets. The intersection is the set , so that for every object ,
The intersection needs no new axiom: Axiom 3.8 carves it out of , a set we are already holding. And since it is defined from and alone, both of which obey substitution, so does the intersection. The same remark applies to the definitions that follow, and we will not mention it again.
Proposition 3.32 (Inclusions for union and intersection).
Let and be sets. Then and , while and .
Discussion.
Each of the four is a universally quantified implication, so each takes an arbitrary , assumes the left membership and reaches the right. The two for the intersection unfold into a conjunction on the left, and Simplification extracts either conjunct. The two for the union unfold into a disjunction on the right, and Addition weakens a known truth to a disjunction.
Proof.
Let be an object. If , then and ; Simplification gives from that conjunction, and equally . As was arbitrary, and .
If instead , then Addition gives or , which is by Proposition 3.21 . As was arbitrary, , and the argument for is the same.
Just as pooled a whole collection of sets, we can meet a whole collection; here the union supplies the set to carve from, so no further axiom is needed.
Definition 3.33 (Intersection of a system of sets).
Let be a set. The intersection of the sets in is
the set of those objects lying in every member of .
The definition carves out of , which makes it legitimate: an object lying in every member of lies in some member, so it was in to begin with. It also settles the case . Every object vacuously lies in every member of , so “the objects lying in every member of ” would be everything there is, which Proposition 3.13 forbids; carving out of gives instead.
Prove that last sentence.
Proposition 3.34 (Meeting a pair).
Let and be sets. Then .
Discussion.
This is the counterpart of : Axiom 3.3 makes it a biconditional at an arbitrary , and Axiom 3.14 says the only members of are and . So the bounded universal claim has just two instances, and a universal quantifier over two cases is the conjunction of them, which is the criterion for . The membership in that the definition also demands is automatic, since anything in both sets is in one of them.
Proof (element style).
Let be an object and suppose . Then for every ; taking to be and then , both of which lie in by Axiom 3.14 , gives and , so .
Conversely, suppose , so and . Any is or by Axiom 3.14 , and lies in both, so by substitution. Since we also have by Proposition 3.21 , which is the set being carved, so . As was arbitrary, Axiom 3.3 gives the equality.
Remark.
Honestly for this proposition, this is one of those ones where the logical explanation makes way more sense.
Proof (logical style).
Let be a non-empty set and let . Show that .
Two sets and are disjoint if .
Remark.
Being disjoint is not the same as being distinct. The sets and are distinct, since each holds an element the other does not, but they are not disjoint, since their intersection holds and . Meanwhile and are disjoint but not distinct.
Let be a set. What is ?
Theorem 3.36 (Characterising the empty set).
Let be a set. The following are equivalent.
- for every set ;
- for every set ;
- has no elements;
- for every set .
Discussion.
Four statements would ordinarily need twelve implications, but a loop is enough: we prove the chain , and every statement then reaches every other by going round. Step is an equality of sets, so it is two inclusions, one of which we already have from Proposition 3.32 . Step has no object to point at, so it goes by contradiction, using the case . Step is again two inclusions, and the work is splitting the “or” in , where the second alternative is ruled out by the hypothesis. Step is a single inclusion, read off Proposition 3.32 and the hypothesis.
Proof.
. Assume . We have by Proposition 3.32 . For the reverse inclusion take ; then since , so and , which is . Hence , and Proposition 3.29 gives .
. Suppose, to the contrary, that has an element . Taking in the second statement gives . But nothing belongs to , since anything in it would lie in and Axiom 3.1 forbids that, so has no elements and has none either. This contradicts .
. Assume has no elements. We have by Proposition 3.32 . For the reverse inclusion take ; by Proposition 3.21 either or , and the second is impossible, so . Hence , and Proposition 3.29 gives .
. Let be a set. We have by Proposition 3.32 , and by the fourth statement, so by substitution.
Complements of Sets
If , the complement of in is the set of all elements of that are not in .
Let . The complement of in is the set
so that for ranging over , .
Other texts write , but we will stick with . Notice that a complement means nothing until the ambient set is understood.
The complement removes one set from another only when the first lies inside the second. Dropping that assumption gives the difference of two arbitrary sets.
Definition 3.38 (Set difference).
For sets and , the difference is the set of elements of that are not in ,
with membership . The complement is the difference in the case .
. The set being removed need not sit inside the set it is removed from; the elements the two do not share are simply ignored.
With complements taken in , what are , and ? Name the logic law behind the last one.
Complements produce negative statements like , and the standard tool for proving those is proof by contradiction: to show a statement true, assume its negation and derive a contradiction; the contradiction cannot stand, so the assumption was false and the statement we wanted holds.
Proposition 3.40 (Complements reverse inclusion).
Let . If , then .
Discussion.
The conclusion is a universally quantified implication, so we take and must reach . Both memberships are negative statements by the definition of the complement, so what has to be shown is from , and that is the contrapositive of the implication hands us. Elementwise the same step is a contradiction: assume , push it through to , which contradicts .
Proof (element style).
Let , so and . Suppose . Then gives , contradicting , so . Since , this is . As was arbitrary, .
Proof (logical style).
For any in ,
so for every in , which is .
Let , with complements taken in . Prove that and .
Remark (The dictionary).
By now a dictionary has emerged: complement is , intersection is , union is , subset is , and equality is . Any equivalence built from , and alone translates through it into an identity of sets, so the table of laws in the first chapter doubles as a table of set identities.
Before taking complements of combinations we should check they may be taken at all. If and are subsets of , then so are and : an element of lies in or in and so in either way, and by Proposition 3.32 and Proposition 3.28 . Complements of both are therefore defined in .
Translating De Morgan’s laws through the dictionary gives their form for sets: the complement of a union is the intersection of the complements, and the complement of an intersection is the union of the complements.
Theorem 3.41 (De Morgan's laws for sets).
Let and be subsets of an ambient set. Then
Discussion.
We prove the first; the second is identical work with the roles exchanged. Equality of sets is two inclusions by Proposition 3.29 , and both read the same way through the dictionary. For in the ambient set, membership in is the negation of the disjunction ; the disjunctive De Morgan law rewrites that negation as the conjunction , which by the definitions of complement and intersection is membership in . Each inclusion is one half of this biconditional, and the logical proof writes the whole equivalence down at once.
Proof (element style).
For the first inclusion, assume , so by the definition of the complement: it is not true that or . By De Morgan’s laws this means and , that is, and . Belonging to both, belongs to their intersection, so and .
For the second inclusion, assume , so and , meaning and . By De Morgan’s laws again, ” or ” is false, so by Proposition 3.21 , and hence . Thus , and the two inclusions give the equality.
Proof (logical style).
The set law is the logic law translated through the dictionary, and the logical proof is that translation.
The Distributive Laws
Union and intersection also distribute over each other. For numbers, multiplication distributes over addition but not the other way round; for sets each operation distributes over the other.
Theorem 3.42 (Distributive laws for sets).
Let , and be sets. Then
Discussion.
We prove the first. It is an equality of sets, so two inclusions. For we assume ; a union assumption is an “or”, so we split into the cases and , and in each we must put in both and . For the reverse inclusion we assume , which hands us two “or” statements at once; we split on whether , since if not, each “or” is forced to its other option. The logical proof needs only the axiom of Distributivity applied to the membership predicates.
Proof (element style).
For the first inclusion, assume , so or . If , then and , so lies in their intersection. If instead , then and ; the first puts in , the second puts in , and again lies in the intersection. Either case gives , so .
For the second inclusion, assume , so and ; that is, or , and at the same time or . If , then and we are done. If , then the first “or” forces and the second forces , so and again . Either way , and with both inclusions the sets are equal.
Proof (logical style).
The elementwise proof of the second inclusion needed an idea, splitting on whether , while the logical proof used only the table.
Theorem 3.43 (The algebra of intersection).
Let , and be sets. Then
- ;
- ;
- ;
- and ;
- if and only if if and only if .
Discussion.
The union halves of the first three are Proposition 3.23 , and these are the same rows of the table read with in place of : idempotence, commutativity and associativity are the logic laws of those names, and each is one chain of equivalences. The fourth mixes the two operations, and is absorption. The fifth is different in kind, since it is not an identity but a comparison: the equivalences and each say exactly that implies , so we check it elementwise, with two inclusions inside each of the two biconditionals.
Proof (logical style).
Let be an object and write , , for the propositions , , .
Each chain is a biconditional for every , so Axiom 3.3 gives the corresponding equalities.
Proof (element style).
For the fifth part, suppose first that . Since by Proposition 3.32 , we get . Conversely, suppose . We have by Proposition 3.32 , and if then , so ; hence , and Proposition 3.29 gives .
For the other equivalence, suppose . Then by Proposition 3.32 and substitution. Conversely, suppose . We have by Proposition 3.32 , and if then or , and in either case ; hence , and Proposition 3.29 gives . Both equivalences hold, so the three statements are equivalent.
Remark.
These identities, together with the complement laws, are what it means to say that the subsets of a fixed ambient set form a boolean algebra: the same structure the connectives , and were shown to have in the first chapter, met a second time with sets in place of propositions.
Power Sets
Sets collect objects, and nothing forbids those objects from being sets themselves: here we collect all the subsets of one set into a single set.
Collecting the subsets of is not a case of comprehension, since it does not carve out of a set already in hand: the subsets of are not among the elements of , and there is no larger set on the table to cut them from. So the set has to be supplied.
For every set there exists a set whose elements are exactly the subsets of : for all sets , .
Let be a set. The power set of , written , is the unique set whose elements are exactly the subsets of : for every set , . We also write it .
Remark.
That last notation is the unrestricted form we rejected earlier, and it is safe here only because the axiom has already produced the set. The braces are naming a set we hold; writing with no axiom behind it would lead us back to Russell.
Let with . Then . The elements of are sets, so we write because , while is simply false.
Proposition 3.47 (Power set of the empty set).
.
Discussion.
The claim is an equality of sets, so Proposition 3.29 lets us prove the two inclusions. For it is enough to check that is a member of the power set, which Definition 3.38 reduces to . For the reverse inclusion we take an arbitrary ; the same definition converts that membership into , and since the empty set is a subset of every set we have as well, so mutual inclusion forces . The logical proof collapses the same chain into biconditionals: membership in the power set is the subset relation, which against is equality with , which is membership in .
Proof (element style).
() Since , Definition 3.38 gives , and hence .
() Conversely, let . Then , and since as well, Proposition 3.29 gives , so . Thus , and the two inclusions give the equality.
Proof (logical style).
Theorem 3.48 (Power-set laws).
Let and be sets. Then
- ;
- if and only if ;
- ;
- .
Discussion.
Every claim reduces to Definition 3.38 : a set belongs to a power set exactly when it is a subset of the set in question. The first is immediate from and . The second is a biconditional, so it splits: forwards, an has and , and Proposition 3.28 chains them; backwards, the first part puts itself into , so an inclusion of power sets hands us , which is read back through the definition. The third is one inclusion only, since a subset of or of is a subset of either way, and the reverse fails in general, as the example after the proof shows. The fourth is an equality, so both inclusions, and it holds because being a subset of both and is the same thing as being a subset of .
Proof.
For the first claim, and , so and by Definition 3.38 , and therefore .
For the second, suppose and take . Then , and with this gives by Proposition 3.28 , so . Hence . Conversely, suppose . The first claim gives , so and therefore .
For the third, let , so or by Proposition 3.21 . If then , and every element of then lies in and so in ; if the same argument runs through . Either case gives , that is, .
For the fourth, let . Then and , so every element of lies in and in , hence in . Thus and . Conversely, let . Every element of lies in and so lies in , and equally in , giving and . Hence belongs to both and , and therefore to their intersection.
The inclusion in the third claim really can be strict. Let and with . Then , so , but is a subset of neither nor and so lies in neither nor .
Let be a set and let be an object with . Describe in terms of .
Can ever be the power set of some set? Prove your answer.
Find a necessary and sufficient condition on and for , and prove that your condition works in both directions.
Replacement
Everything we have built so far either cuts a set down or pools sets together. Nothing we have assumed lets us take a set and change what is in it. Suppose we hold and want the set holding one more than each of those, : comprehension carves out of a set we are holding, and none of , , lies in , so there is nothing to carve them from. The axiom below closes that gap by letting a statement pair each element with its replacement.
Let be a set, and let be a statement about an object and an object such that for each there is at most one making true. Then there exists a set whose elements are exactly those partners: for any object ,
The condition that each have at most one partner is needed: if one could have many partners, the axiom could produce arbitrarily large collections and we would be back with the unrestricted notation and its paradox. With at most one partner each, every object in the new set is the partner of an element of .
Take and let be the statement . Each in has exactly one partner, so the axiom applies, and the set it hands back is .
Take again, and let be the statement . Each in still has exactly one partner, but it is the same partner every time, so the set produced is . The axiom may return something smaller than what we started with, since nothing forces distinct elements to have distinct partners.
Axiom 3.3 makes that unique, so we may name it, and we write it . As with the power set, those braces carry no carving set and are safe for the same reason: the axiom produced the set before the notation named it. When the partner of is written we abbreviate further, to or .
We promised at the outset that our axioms would be overcomplete.
Proposition 3.53 (Comprehension from replacement).
Let be a set and a predicate. Then replacement alone produces a set whose elements are exactly the elements of for which holds.
Discussion.
Replacement builds a set by transforming elements, while comprehension builds one by selecting them, so we use a transformation to do the selecting. We transform each element into itself, and only when holds of it: the statement saying ” and ” pairs an element satisfying with itself and leaves an element failing with no partner at all. The at-most-one condition holds because each element has one partner or none, and the set of partners is exactly the set of elements we wanted to keep.
Proof.
Let be the statement ” and ”, and let . If holds, the only with is itself; if fails, no satisfies . Either way there is at most one such , so Axiom 3.50 applies and produces a set with exactly when holds for some .
Suppose . Then some has and , so by substitution, and likewise. Conversely, if and , then is itself a witness, so . Hence for every object , which is the criterion of .
So Axiom 3.8 could have been left out. We keep it anyway, by choice: the discussion of Russell’s paradox turned on carving into a set we already hold, and it is the axiom we reach for constantly. The two also combine, so to build we first form by comprehension and then apply replacement to it.
Remark.
Replacement is a schema, as comprehension is: one axiom for each statement , not a single statement quantifying over all of them.
Regularity (Optional)
Our set-builder notation was rejected for producing a set that could not exist. Unrestricted, the notation also gives the collection of every object at once, and since sets are objects by Axiom 3.2 , such a collection would contain itself. The box picture has no place for a box that holds itself.
The intuition that keeps this from happening is that objects come in stages. At the bottom sit the objects that are not sets at all, such as the number . Above them sit the sets built only from those, like and . Above those sit the sets built from everything so far, like , and so on upward. A box at any stage holds only boxes opened at earlier stages, so no box ever ends up inside itself.
Writing that hierarchy down properly is a good deal of work, and we will not do it. We take instead the one consequence of it we need.
If is a non-empty set, then at least one element of is either not a set, or is disjoint from .
Read against the hierarchy, the axiom says that some element of sits low enough to hold none of the others. It asks this of one element only, not of all of them.
Let . Its first element holds neither of the elements of , since neither nor lies in , so it is disjoint from and the axiom is satisfied. The second element sits a stage higher and does hold an element of , namely , which the axiom permits.
Show that the unrestricted notation of the set-builder section, had we assumed it rather than rejected it, would imply Axiom 3.8 , Axiom 3.14 , Axiom 3.18 , Axiom 3.44 and Axiom 3.50 , and would therefore have spared us most of this chapter.
Use regularity, together with Axiom 3.14 , to show that for every set . Show further that for any two sets and , either or , or both.
Show, assuming the other axioms, that the unrestricted notation is equivalent to postulating a set containing every object: if the notation is permitted then such an exists, and if such an exists then the notation is legitimate.
Problem 3.17 is worth a second look once it is done. It says that for any set there is always an object outside , namely itself, so we may always add one more element and form the larger set . It also gives a second route to Proposition 3.13 , since a set holding every object would hold itself, which regularity forbids. We proved that proposition from comprehension alone, so the two arguments use different axioms.
(REALLY OPTIONAL). Taking a further look into to : if we start from the empty set and apply it over and over we get
each set holding exactly those before it, with no two of them equal, since each holds an object the previous ones do not. Of course every one of these is a set our axioms produce (by pairing and union), and a good use for them is to attach a semblance of counting: is because it doesnt contain anything, the next is because it contains one thing (the empty set), and so on. However, what our axioms do not yet produce is a single set holding all of them at once: the list is generated by a construction repeated an unspecified number of times, and we have already noted, when writing and longer, that we cannot yet say what repeating a construction that way amounts to. This is the same gap seen from the other side, and closing it takes an axiom asserting that some set is closed under the step (we see that soon).
Remark.
One may fairly ask whether we need this axiom, since it is less intuitive than the others. For analysis we do not: the sets we meet are all low in the hierarchy, sets of ordinary objects or sets of those, and nothing later in these notes depends on regularity. It matters for set theory pursued for its own sake, and we state it here so the list is complete.
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.
Each construction below is licensed by exactly one axiom. Name it.
From two objects and , the set .
From a set and a predicate , the set of those elements of satisfying .
That and are one and the same set.
From a set whose elements are sets, the set of every object belonging to one of them.
Set-builder notation, and the restriction that makes it safe.
The statement says exactly:
The set is:
Let be any set and put , which comprehension makes a set. Running Russell’s argument on now establishes:
Let and , with complements taken in .
is:
is:
is:
Write , and for the statements , and , with ranging over an ambient set containing all three. Give the membership condition of each set below.
, written with and nothing else.
An identity of sets fails as soon as one object falls on different sides of it, so a counterexample is a choice of which of the sets that object lies in. Write , , for , , , and place one in each case.
against .
against .
Power sets, counted.
For distinct , , , the set has how many elements?
is:
And has how many elements?
Replacement, and the condition it imposes.
Take and let be the statement . The set replacement returns is:
Which of these statements does replacement refuse?
For sets and , the symmetric difference is
the set of objects belonging to exactly one of the two.
An object lies in exactly when it belongs to:
Write that condition in , , . Spelling the four cases out with , and counts, and so does the short answer, which uses and one pair of brackets and nothing else. Then try the other bracketing of that short answer, and say what the two verdicts together tell you about .
Each condition below holds for some pairs of sets and not others. Say for which.
:
:
:
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 ⟨ ⟩.
The last two sheets were about statements. This one is about objects, and about the sets that hold them.
The editor has one type, Obj, and its terms are the objects of this chapter. Sets are objects too by Axiom 3.2 , so a set and its elements are terms of that same type, and x ∈ A is a statement about any two of them. Nothing marks off the objects that are sets from those that are not, and every exercise below is about sets.
The notation is typed with the backslash abbreviations: \in for ∈, \nin for ∉, \sub for ⊆, \cup for ∪, \cap for ∩, \emptyset for ∅ and \powerset for 𝒫. The difference A \ B is a plain backslash.
Inclusion
An inclusion is not a new kind of statement. A ⊆ B is ∀ x, x ∈ A → x ∈ B written short, so it is proved the way an implication is, by intro, and used the way an implication is, by applying it: with h : A ⊆ B and hx : x ∈ A, the term h x hx proves x ∈ B. A goal ∀ x, p x behaves the same way, intro x fixing an arbitrary x and leaving p x.
Example.
An inclusion applied to an object and to a proof that the object lies in the smaller set.
The operations are nothing more than their membership criteria. x ∈ A ∪ B is the disjunction x ∈ A ∨ x ∈ B, not merely equivalent to it, so left, right and rcases work on a membership in a union as they do on any disjunction. x ∈ A ∩ B is the conjunction x ∈ A ∧ x ∈ B, so ⟨_, _⟩ builds one and .left and .right take one apart.
Example.
The first intro fixes the object, the second assumes it lies in .
Example.
Half of a conjunction, reached through the criterion for the intersection.
Both criteria at once: take the conjunction apart, then choose a side of the disjunction.
Subsets are transitive.
A set containing both and contains their union.
And a set contained in both is contained in their intersection.
Equality
Two sets are equal when they have the same elements, and Set.ext is that axiom: handed ∀ x, x ∈ A ↔ x ∈ B it returns A = B. So apply Set.ext turns a goal A = B into that biconditional, intro x fixes the object, and constructor splits the biconditional into its two directions.
Example.
Idempotence of the intersection, which is idempotence of underneath.
Mutual inclusion says the same thing, and Set.subset_antisymm is Proposition 3.29 . Applying it leaves the two inclusions as separate goals, which is often the shorter road, since neither of them mentions the biconditional.
Example.
Absorption. The harder inclusion splits on the union; the other one is a line.
have
A proof that needs a step of its own records it with have. Writing have h : p := … adds h : p to the context, and what follows := is either a term or by with a block indented under it.
Example.
The intermediate membership is named, and then taken apart.
The order of a union carries no information.
The distributive law left unproved in Theorem 3.42 .
Difference
x ∈ A \ B is x ∈ A ∧ ¬(x ∈ B), a conjunction whose right half is a negation, which is to say a function into False.
Example.
The negative half, taken out of the conjunction.
And x ∈ ∅ is False itself. There is nothing to do with such a hypothesis but close the branch, which h.elim does, proving whatever the goal happens to be.
Example.
Nothing lies in the empty set, so this branch never arises.
Taking out of first costs the union nothing.
De Morgan’s second law, with the complement written as a difference.
Its companion.
Symmetric difference
For sets and , the symmetric difference is , the set of objects belonging to exactly one of the two. The editor has no notation for it, so the statements below carry it written out.
An equation between sets is used with rw: from h : A = B, rw [h] replaces by in the goal, and rw [h] at k does it inside the hypothesis k.
Example.
Substitution, which is what an equation is for.
.
.
.
If is empty then and are the same set.
Power sets
X ∈ 𝒫 A is X ⊆ A, which is a ∀ again, so a membership in a power set opens with intro like any other inclusion.
Example.
Every set is a subset of itself, and so an element of its own power set.
Half of Theorem 3.48 , part two.
And part four of it.
Since is , this is the inclusion .
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 |
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 |
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 |
Lesson 4
Functions
Taught
More Sets
Once the axioms of set theory are in place, we can review some elementary albeit very useful constructions that these axioms enable.
Ordered Pairs
We often need to pair two elements while retaining their positions, and an ordinary two-element set cannot do this, since ; something more is needed if one element is to be marked as coming before the other. We could simply declare that the notation is ordered, but what does ordered mean in terms of sets?
Before choosing a set to represent , we state the property any such choice must have: whenever and are ordered pairs,
In particular, the two coordinates must be recoverable from the pair.
Definition 4.1 (Ordered pair).
Let and be objects. The ordered pair is the set
where is its first coordinate and its second coordinate.
The sets used to encode the pair, and , are supplied by the pairing axiom of the last chapter, and the set on the right exists by that same axiom applied once more, to those two. The construction is due to Kuratowski. Does it satisfy ?
Proposition 4.2 (Equality of ordered pairs).
For objects , , and , if and only if and .
Discussion.
Our statement is a biconditional. The reverse implication, and implies , is a direct substitution into the definition of the ordered pair. For the forward implication we assume and must recover the coordinates from the set; the argument splits into the cases and , because in the first case the pair collapses to the singleton while in the second its two elements are distinct and can be chased through the equality one at a time. The logical proof avoids the split: it expands each ordered pair, rewrites set equality as the two inclusions by mutual inclusion, and lets the distributive and absorption laws of the first chapter reduce the resulting disjunctions to the conjunction .
Proof (element style).
Let , , and be arbitrary objects. For the reverse implication, suppose and . Then and ; hence .
For the forward implication, suppose . By the definition of set equality, every element of either ordered pair belongs to the other; we divide the argument into two cases, and .
If , then . Both and belong to , so each must equal ; hence and . Since as well, we obtain and .
If , then ; consequently has two distinct elements. Since , either or . The latter equality would give , so would have only one element; this contradicts , since has two. Therefore , and hence .
Similarly, since , either or . The former equality would give , contradicting ; therefore . It follows that or ; but , so and hence . Thus and .
Remark.
This logical proof is dumb and covoluted lol but why not.
Proof (logical style).
Let , , and be arbitrary objects. By the definition of set equality,
Corollary 4.3 (Swapping coordinates).
For objects and , if and only if .
Proof.
If , then Proposition 4.2 gives by comparing first coordinates. Conversely, if , then .
Kuratowski’s is not the only possible choice, and the next problem looks at a shorter one.
Some authors define the ordered pair by the shorter set
- Prove that this also satisfies , so that if and only if and . You may use the axiom of regularity from the last chapter, and in particular the conclusion of its second problem.
- Show that regularity is genuinely needed, by identifying the step of your argument that fails without it, and say why the same step does not arise for Definition 4.1 .
Nesting ordered pairs builds longer ordered tuples.
Definition 4.4 (Ordered triples and longer).
Let , , and be objects. The ordered triple and ordered quadruple are
and further tuples are assembled the same way.
Remark.
We have now overloaded the parenthesis symbols once again: they are used not only to group operators and arguments, but also to enclose ordered pairs. This is usually not a problem in practice, as one can still determine from context which usage is intended.
Cartesian Products
With ordered pairs in hand we can collect all of them at once. The collection has to come from somewhere, and the power set supplies it.
Proposition 4.5 (Where ordered pairs live).
Let and be sets, let and . Then .
Discussion.
An ordered pair is a set of two sets, so it sits two power sets up from whatever holds its coordinates, and the set holding both coordinates is . We go up one power set at a time: show each of and is a subset of , which puts both in , and then that having both as elements makes a subset of , which is what membership in the next power set asks for.
Proof.
Since we have , and since we have . Every element of is , and every element of is or , so both and , that is, both belong to .
The elements of are exactly those two sets, so , which is .
Definition 4.6 (Cartesian product).
Let and be sets. The Cartesian product is the set of all ordered pairs with first coordinate in and second in ,
so that for every object , exactly when for some and some .
The product needs no axiom of its own. The proposition above puts every candidate pair inside , a set we are already holding, and comprehension carves the product out of it.
Let and . Then . Order matters here in a way it did not for unordered pairs: while , and the two products are different sets.
Let and be sets. Show that if and only if or .
Membership in a product is a conjunction, which adds another line to the dictionary:
Order matters, and in general . With and we have , which is not the earlier set: the element lies in but not in , since .
For any set , both and are empty. A pair in would need its second coordinate from , which has nothing to give; through the dictionary, .
Products of three or more sets work the same way, collecting the triples with , and , and so on upwards. There is a subtlety here.
Remark (Order of operations).
The definition takes two sets at a time, so for three sets there are two readings, and they are not the same set. Applying it twice, the elements of are the pairs , which unfold to
while the elements of are the pairs , which unfold to
Both should intuitively be the set of all triples , and they do describe the same object once we identify them. Using a term we introduce below, the identification amounts to checking that
is a bijection from the first set onto the second, so the product is associative up to that correspondence. Once bijections are in hand this is a short piece of work, and the problems below ask you to do it; from then on we drop the brackets and write .
We said that in general. Find every case in which they are equal.
Indexed Families
It is often convenient to give each set in a collection a label.
Definition 4.10 (Indexed family).
Let be a set. An indexed family consists of one object for each , and is written . The set is the index set and is an index. Different indices may label the same object.
Let , and be sets, take , and declare , , and . The family has four entries, and the equality removes neither of them: the labels and are different even though the sets they label are equal. The braces in the notation are a convention, since what we are holding is an assignment of an object to each index, and that assignment records more than the plain set of members , which does not record that occurs twice.
Definition 4.12 (Indexed unions and intersections).
Let be an indexed family of sets with non-empty. Its union and intersection are
so that exactly when for some , and exactly when for every .
Neither needs an axiom beyond those we have. Replacement turns the index set into the set of members, since each has exactly one partner , and the union axiom pools what those members hold. The intersection is then carved out of that union by comprehension, exactly as the intersection of a system of sets was in the last chapter, and for the same reason: an object lying in every member lies in some member, so nothing is lost by looking only inside the union.
By the bounded quantifier convention of the last chapter, the two membership tests unabbreviate to for the union and for the intersection.
For the new symbols hand back the old ones, and . With quantifiers doing the work, the negation rules settle what it takes not to belong:
So is outside the intersection if it misses a single , but outside the union only if it misses every .
Let and let be the set of whole numbers with . Determine and .
Let be a non-empty set, let be a statement not involving , and let be a predicate on . Prove the two exchange laws
Where does the non-emptiness of enter? Show that if one of the two equivalences survives and the other fails.
Proposition 4.13 (Set difference over indexed families).
Let be a set and let be an indexed family of sets with non-empty. Then
- ;
- .
Discussion.
Both are equalities of sets, so we compare membership on the two sides, and each comparison admits two readings. Elementwise, an element of sits in and misses some , so it sits in and hence in the union of the differences; conversely, belonging to one difference already keeps the element out of the intersection. The second identity is the same argument with “some” replaced by “every”. The logical route says this through the dictionary: the definition turns membership in the intersection into a universal quantifier and membership in the union into an existential one, the negation rules swap for and back, and the exchange laws of the problem above push the fixed condition through the quantifier.
Proof (element style).
For the first, suppose . Then , but does not belong to every , so for some . Hence , and therefore . Conversely, suppose belongs to that union. Then for some we have , so and . It follows that , whence .
For the second, suppose . Then and for every , so for every , that is, . Conversely, membership in that intersection gives for every , so and no holds , which puts in .
Proof (logical style).
For any ,
and likewise
Corollary 4.14 (De Morgan's laws for indexed families).
Let be an indexed family of subsets of an ambient set , with non-empty. With every complement taken in ,
Proof.
Take in the two parts of the proposition. Each difference is the complement , and the identities follow.
Let be a set and an indexed family of sets with non-empty. Prove that if and only if for every , and that if and only if for every .
Let be an indexed family of sets with and non-empty. Decide which inclusion between
holds for every such family, and whether equality is forced. (Harder.)
Functions
In order to do analysis it is not particularly useful to have only the notion of a set; we also need the notion of a function from one set to another. Informally, a function is an operation which assigns to each element, or input, in a single element, or output, in . Formulas, rules and graphs are convenient ways to describe the pairing of inputs with outputs, but the set of pairs itself is the function.
Let and be sets. A function from to is a subset such that for every there is exactly one with . We write , call the domain of , written , and the codomain, and write for the unique paired with , so that for any and ,
The condition on is sometimes called the vertical line test: exactly one pair of stands above each point of the domain. It is two demands at once, existence and uniqueness, and either can fail on its own.
We also write for the pairing. The object is the image of , and is a preimage of , one of possibly several. Functions are also called maps, mappings or transformations, depending on the context.
Remark.
A function is often handed to us as a property rather than a set of pairs. Let pertain to and , and suppose that for every there is exactly one making true. Then
is a set by comprehension, and the hypothesis on is exactly the vertical line test, so is a function from to with precisely when holds. No further axiom is needed to turn a property into a function; the ones we already have build the set of pairs for us.
Assuming you know what the real numbers are, take both domain and codomain to be them. The declaration assigns nothing at , so existence fails there and is not a function on that domain. The condition offers two candidates whenever , namely and , so uniqueness fails and is not a function either.
Remark (Informal examples).
Several examples below assume you know the real numbers and the whole numbers, which we have not built yet. In those we write for the real numbers and for the whole numbers, and we borrow the rules of school algebra openly. Nothing in the theory rests on them; they are there because familiar objects make the definitions easier to read.
A rule that meets both requirements, assigning a unique value in the codomain to every element of the domain, is said to be well defined. One common way to present a function is to specify its domain, its codomain, and how the output is generated from each input; this is an explicit definition.
Remark.
Functions obey substitution: if then , since was defined as the unique paired with , and and name the same object. Equal inputs give equal outputs. Unequal inputs need not give unequal outputs, as a constant map shows.
Three functions occur often enough to deserve names.
Definition 4.17 (Inclusion, identity and constant maps).
Let . The inclusion map is defined by . When this is the identity map on , written . For sets and and a fixed , the constant map with value is given by for every .
There is a function from to any set , namely the empty set of pairs. Neither requirement can find an element of on which to fail, so both hold vacuously. We shall see below that it is the only one from to .
When the domain and codomain are sets of real numbers we can plot the pairs of in the Cartesian plane to draw its graph; for this yields the familiar parabola. An arbitrary domain might admit no geometric picture, but the underlying set of pairs remains. Drawn this way, the identity on is the diagonal, since it pairs each with itself, and a constant map is a horizontal line.
Proposition 4.19 (Equality of functions).
Functions and are equal if and only if they have the same domain and for every in it.
Discussion.
We prove the two implications of the biconditional. Suppose first that . Equality of the sets of ordered pairs gives equality of their first coordinates, hence equality of the domains; for an arbitrary element of the common domain the pair belongs to , and the uniqueness clause of Definition 4.15 gives . Conversely, assume the domains agree and the two functions have the same value at every point of the common domain. By mutual inclusion it is enough to prove the two inclusions. An arbitrary has in the domain and , so the hypotheses put in ; the reverse inclusion follows symmetrically.
Proof (element style).
Suppose first that . The domain of a function consists of the first coordinates of its elements, so and have the same domain. For any in it the pair belongs to , and since we have , which gives by the uniqueness of images in .
Conversely, assume the domains agree and for every in the common domain. If , then lies in that domain and ; since we have , so . Hence . A symmetric argument gives , so .
Proof (logical style).
If , then for every ,
and for in this common domain , so uniqueness gives . Conversely, for every ordered pair ,
Remark.
The codomain does not enter the criterion, because under Definition 4.15 a function is simply its set of ordered pairs. Consequently the set defines the identity map , but for any with it equally defines the inclusion map . The set of pairs is identical; the declared codomain matters when we ask whether every element of the target is reached.
There is only one function from to a given set . Any two have the same domain, namely , and agree at every point of it, since there are none, so the proposition makes them equal.
Definition 4.21 (Restriction and extension).
Let be a function and let . The restriction of to is the function given by . The function is called an extension of to .
Consider
By the proposition, : the domains agree, and the rules of school algebra give for every real number. The function is a different object entirely. Its domain is , so it cannot equal or , even though its values agree with theirs at every whole number. It is their common restriction, . Equality of functions depends on domains, not on formulas.
Remark.
Definition 4.15 builds a function as a set of pairs, and the domain and codomain are read off the notation rather than carried by the set. A tidier alternative is to package all three, taking a function to be the ordered triple of a domain, a codomain and a set obeying the vertical line test. Nothing in what follows depends on the choice, and the problems below ask you to check that the two accounts agree.
Let and . Which of the following are functions from to ? Justify each answer.
- ;
- ;
- .
Give sets and for which is a function from to . What is , and what are the preimages of ? Is your choice of and the only one?
Let and be non-empty sets. Prove that is a function from to if and only if has exactly one element.
Let be a function and define its graph to be the subset of .
- Show that two functions are equal if and only if they have the same graph.
- Conversely, let be such that for each the set has exactly one element. Show that there is exactly one function whose graph is .
- Suppose we define a function instead to be an ordered triple with obeying the vertical line test, taking the domain to be , the codomain , and the unique with . Show that this definition agrees with Definition 4.15 , in the sense that every choice of domain, codomain and property obeying the vertical line test produces a function in this sense with all the properties the earlier definition requires.
Images and Preimages
Definition 4.23 (Image of a set).
Let be a function and let . The image of under is . The image of the whole domain is the range of , written .
The range is a subset of the codomain, and it may be a proper one. In terms of the ordered pairs of Definition 4.15 ,
Definition 4.24 (Preimage of a set).
Let be a function and let . The preimage of under is . In particular is the set of all preimages of .
The notation does not assume that has an inverse function; the definition applies to every function. The set may be empty, may hold one element, or may hold several.
Let and , and define by , , , . Then , and . The element belongs to the codomain but not to the range, and its point preimage is empty. In general is non-empty exactly when , and how many elements it holds records how many inputs are sent to . Here , and .
Take with , and let be the set of real numbers with . Then is the set of real numbers with : on the one hand gives , which proves one inclusion, and on the other, any such has in with , which proves the reverse. The same calculation read backwards gives .
Proposition 4.27 (Set laws for preimages).
Let be a function and let . Then
- ;
- ;
- .
Discussion.
We prove each equality by comparing membership at an arbitrary . By the definition of the preimage, membership says that and that its image has the required property. So says precisely that ; membership in means membership in at least one of and ; and membership in means membership in both. Translating those three conditions back through the same definition yields the complement, the union and the intersection we want.
Proof (element style).
If , then and , so . Conversely, if , then ; since this puts , whence .
If , then belongs to or to , so belongs to . Conversely, membership in that union puts in one of the two preimages, so and .
Finally gives both and , so ; and membership in both preimages gives , which is the reverse inclusion.
Proof (logical style).
For every ,
The middle steps distribute the conjunct across the disjunction and the conjunction, which is Distributivity and, for the third line, Idempotence. The membership conditions agree in each pair, so the corresponding sets are equal.
Preimages preserve complements, unions and intersections. Images preserve unions, but need not preserve intersections, as the problems below ask you to show.
Read as the assignments and , a function induces two maps between power sets, one from to and one from to , written and again. The two behave differently, and the proposition is the reason: the preimage map preserves all three operations, while the image map preserves only unions.
Remark.
This asymmetry is why continuity is later stated in terms of preimages rather than images: a function is continuous exactly when the preimage of every open set is open.
For the finite function above, determine , , and .
Let be a function and let . Prove that . Must always hold?
Surjections, Injections, Bijections
A function is surjective, or onto , if ; equivalently, if for every there is some with .
Every function is surjective onto its range.
The successor map given by is not surjective, since has no preimage among the whole numbers. The same ordered pairs define a surjection onto . So surjectivity depends on the declared codomain, not on the pairs alone.
A function is injective, or one-to-one, if for all , .
The contrapositive of that implication says distinct inputs have distinct images. To show a function is not injective it is enough to give two distinct inputs with the same image; to show it is not surjective it is enough to give an element of the codomain with no preimage.
Proposition 4.31 (Point preimages).
Let be a function.
- is injective if and only if holds at most one element for every ;
- is surjective if and only if is non-empty for every .
Discussion.
For the first part we compare the definition of injectivity with the assertion that two members of coincide. In one direction two such members have equal images; in the other, equal images make the two inputs members of one point preimage. For the second part, the definition of the preimage says is non-empty exactly when some satisfies , which is what surjectivity asks.
Proof.
Suppose is injective. If , then , so . Conversely, suppose every point preimage holds at most one element. Whenever , both and belong to , and hence they are equal. This proves the first part.
The second is the surjectivity condition rewritten: is non-empty exactly when some satisfies .
For a real number , the translation given by is injective and surjective. If , then , and adding to both sides gives . For surjectivity, take any and put ; then , so every element of the codomain has a preimage.
The squaring map with is neither injective nor surjective: , and lies outside its range because every square is non-negative.
The product map with is surjective, since for every whole number . It is not injective, since while by Proposition 4.2 .
For the finite function of the previous section, decide whether it is injective and whether it is surjective, justifying each answer from the definitions.
Let be non-empty and let have exactly two elements. How many functions from to are not surjective?
A function is a set of ordered pairs, so its pairs may be reversed to form the set . Call the set of first coordinates of a set of pairs its domain.
- Determine of the set of Problem 4.8 and of the function of Problem 4.9 , and say which of the two is a function.
- Prove that if is not injective, then is not a function.
- Prove that if is injective but not surjective, then is a function whose domain satisfies .
Bijections
A function is bijective, or a bijection, if it is both injective and surjective. A bijection from to is also called a one-to-one correspondence between them.
Surjectivity asks for at least one preimage of each point of the codomain and injectivity permits at most one, so a bijection has exactly one.
Proposition 4.36 (Unique preimages).
A function is bijective if and only if for every there is a unique with .
Discussion.
We use the two parts of Proposition 4.31 . If is bijective, surjectivity gives a preimage of each and injectivity shows no second preimage is possible. Conversely, existence of a preimage for every gives surjectivity, and its uniqueness gives injectivity. The same criterion is what will let us reverse the ordered pairs of a bijection later.
Proof.
Suppose first that is bijective. Surjectivity supplies, for each , an with . If and both have this property, then , so injectivity gives .
Conversely, suppose every has exactly one preimage. Existence makes surjective. If , both and are preimages of the same element of , so uniqueness gives and is injective as well.
For finite sets, an injection from to needs at least as many elements in as in , and a surjection needs at least as many in as in ; a bijection therefore forces the two to have the same number of elements. Comparing sets by functions rather than by counting is what will extend this to infinite sets, where counting is no longer available.
With and as above, take . Each member of appears once as a first coordinate and each member of once as a second, so is a bijection. The function of the previous section is neither injective nor surjective: is hit twice and is not hit at all.
Proposition 4.38 (An injection onto its range).
If is injective, then the function from to with the same ordered pairs is bijective.
Discussion.
The new function has the same ordered pairs as , so injectivity carries over unchanged, the definition mentioning only inputs and their images. For surjectivity, take in the new codomain ; the definition of the image provides an with , which is the preimage required.
Proof.
Changing the codomain from to does not alter the ordered pairs, and injectivity is a condition on those alone, so the new function is injective. Every is for some by the definition of the image, so it is also surjective.
Every translation is a bijection, by the example above, and so is the identity map , since each is its own unique preimage. The squaring map and the product map are not, each having already failed one of the two conditions.
Let be bijective and let . Prove that the restriction is bijective.
For each of the following, exhibit sets and , a subset and a function meeting the condition, or show that none exists.
- is surjective and is surjective.
- is surjective and is not.
- is injective and is injective.
- is injective and is not.
Let be injective and let . Prove that .
Let , and be sets. Prove that
is a bijection from onto , so that the two readings of a triple product agree up to that correspondence. Show also that the two sets are not in general equal, by exhibiting an element of one which is not an element of the other.
Composition
Definition 4.39 (Composition).
Let and be functions. Their composition is the function given by .
The notation is read from right to left: acts first and second. The codomain of must be the domain of , so that every value of can serve as an input of .
For the squaring map and the translation above, while . At these take the values and , so by Proposition 4.19 . Composition is not commutative.
Theorem 4.41 (Associativity of composition).
Let , and be functions. Then .
Discussion.
By Proposition 4.19 we must check that the two functions have the same domain and agree at every input. Both are functions from to , so only the values are in question, and at an arbitrary the definition of composition evaluates either side by applying , then , then .
Proof.
Both sides have domain . For every , so Proposition 4.19 gives the equality.
Associativity lets us write without brackets. The identity maps satisfy the identity laws one expects.
Proposition 4.42 (Identity laws).
If , then and .
Discussion.
Again Proposition 4.19 reduces each identity to a comparison of domains and values. Both sides of each have domain , and at an arbitrary the definitions of composition and of the identity map reduce both composites to .
Proof.
For every we have and . Each pair of functions has the same domain, so Proposition 4.19 applies.
Theorem 4.43 (Composition and bijections).
Let and be functions.
- If and are injective, then is injective;
- If and are surjective, then is surjective;
- If and are bijective, then is bijective.
Discussion.
For the first part the definition of injectivity asks us to start from an equality of composite values; expanding the composition, injectivity of gives equality of the -values, and injectivity of then gives equality of the inputs. For the second, take an arbitrary , choose with , then choose with , and evaluate the composite at . The third is the first two together with the definition of a bijection.
Proof.
Suppose , that is, . Injectivity of gives , and injectivity of then gives , which is the first part.
For the second, take . Since is surjective, some has ; since is surjective, some has . Then . The third part follows from the other two.
Let and . Prove that if is injective then is injective, and that if is surjective then is surjective.
Construct finite sets , , and functions , for which is bijective although is not surjective and is not injective.
Inverse Functions
Definition 4.44 (Inverse function).
Let and be functions. The function is an inverse of if and . A function which has an inverse is called invertible.
The first equation returns each element of after applying and then ; the second does the same for . The problems below examine what each equation achieves on its own.
Theorem 4.45 (Invertibility and bijections).
A function is invertible if and only if it is bijective, and when an inverse exists it is unique.
Discussion.
Suppose first that is an inverse of . To get injectivity, apply to an equality and use ; to get surjectivity, use as a preimage of an arbitrary and use . Conversely, Proposition 4.36 gives exactly one reversed pair for each , so the set of reversed pairs passes the vertical line test and is a function from to ; the two inverse identities are then those pairs read in the two directions. For uniqueness, two inverses are compared by sandwiching between them, where associativity and the identity laws collapse the composite in two ways.
Proof.
Let have an inverse . If , then , so is injective. Given , put ; the second identity gives , so is surjective.
Conversely, suppose is bijective and set . For each , Proposition 4.36 gives a unique with , so is a function from to . Reading the pairs in each direction gives for and for , that is, and .
For uniqueness, let and both be inverses of . Associativity and the identity laws give
The unique inverse of a bijection is written . The construction in the proof gives
Remark.
The symbol also denotes the preimage of a set. The two uses are distinct: is an element of produced by the inverse function, and exists only for a bijection, while is a subset of and is defined for every function. For a bijection they are related by , the preimage of a point being the singleton of its inverse image.
Reversing the pairs of the bijection gives . Also for any set .
The translations invert one another: , since for every real number .
Proposition 4.48 (The inverse is a bijection).
If is bijective, then is bijective and .
Discussion.
The two equations defining an inverse are symmetric in and , so they say equally that is an inverse of . That makes invertible, and the theorem above turns invertibility into bijectivity; its uniqueness clause then names as the inverse of .
Proof.
The identities and also say that is an inverse of . So is invertible and hence bijective by Theorem 4.45 , and uniqueness of its inverse gives .
Theorem 4.49 (Inverse of a composition).
If and are bijections, then .
Discussion.
Put . Rather than compute we show directly that meets the definition of an inverse of : evaluate at an arbitrary and at an arbitrary , where associativity and the inverse identities cancel the adjacent pairs. Since is bijective, uniqueness of inverses then identifies as the one.
Proof.
Put . For and ,
So is an inverse of , which is bijective by Theorem 4.43 , and uniqueness in Theorem 4.45 gives the formula.
Corollary 4.50 (Cancellation by a bijection).
Let be bijective and let . Then implies . Likewise, if is bijective and , then implies .
Proof.
For the first, compose on the left with and use associativity:
For the second, compose on the right with :
Let and be real numbers with . Prove that given by is bijective, and determine .
Let be bijective and let . Determine the inverse of .
Let and . Prove that forces to be injective and to be surjective, while forces to be surjective and to be injective.
Left and Right Inverses
Definition 4.51 (Left and right inverses).
Let and be functions. The function is a left inverse of if , and a right inverse of if . When it is both, it is an inverse in the earlier sense.
The names record the side on which sits in the composite. The last problem above gave two implications: a left inverse makes injective, and a right inverse makes surjective. The next theorem combines them.
Theorem 4.52 (Bijections via one-sided inverses).
Let be a function. Then is bijective if and only if it has both a left inverse and a right inverse; when both exist they coincide, and their common value is .
Discussion.
One direction is immediate: a bijection has , which is a left and a right inverse by definition. For the other, the left inverse gives injectivity and the right inverse gives surjectivity, so is bijective and exists. To identify the one-sided inverses with each other we evaluate the triple composite in its two groupings: associativity and the identity laws collapse the middle pair either way, leaving . The same calculation with in place of either names their common value.
Proof.
Suppose has a left inverse and a right inverse . If , then , so is injective. For , the element satisfies , so is surjective. Hence is bijective and exists by Theorem 4.45 . Associativity and the identity laws give
so the two agree; and since is itself both a left and a right inverse of , the same computation identifies their common value with .
Conversely, if is bijective then is a left and a right inverse by definition.
Theorem 4.53 (Injections and left inverses).
Let be non-empty. A function is injective if and only if it has a left inverse.
Discussion.
If a left inverse exists, injectivity is the implication already noted. For the converse, an injective is a bijection onto its range by Proposition 4.38 , so it has an inverse there. On the range a left inverse is forced to be that one, since determines at every point of ; on the rest of we are free, and non-emptiness of lets us send all of to one fixed element. That freedom is why left inverses are rarely unique. The hypothesis on cannot be dropped: the function from to is injective, but a function from to exists only when is empty.
Proof.
Suppose first that . If , then , so is injective.
Conversely, assume is injective. By Proposition 4.38 the function from to with the same pairs is bijective; let be its inverse, which exists by Theorem 4.45 . Fix , which we may do since is non-empty, and define by for and for . For every the point lies in and , so and .
For surjections the situation is different. A right inverse forces surjectivity, as we have seen; the converse, that every surjection has a right inverse, is a claim of a different kind. A right inverse must choose, for every at once, one element of , and when is infinite nothing among our axioms says such a simultaneous choice can be made. That is what the axiom of choice provides.
Let be non-empty and injective. Show that any two left inverses of agree on . For the inclusion map from to , exhibit two left inverses and say where they differ.
General Cartesian Products
With functions in hand we can take the product of an arbitrary collection of sets, not just two. First, the informal indexed family of the earlier section can now be said properly.
Remark.
An indexed family of subsets of a set is formally a function , with . It is the function itself, not its range: the range is the plain set of members, which forgets the labels, as in the earlier example, while remembers which member sits at which index. Since is a subset of , it is a set by the axioms of the last chapter, and that is why we ask that all the be subsets of one set .
Definition 4.54 (General Cartesian product).
Let be a set and let be an indexed family of sets, all of them subsets of a given set. The Cartesian product of the family is
The notation is easier to read once we recall that a function from to is by Definition 4.15 a subset of . So every candidate lies in the power set displayed above, a set we are already holding, and comprehension carves the product out of it. An element of the product picks one member from each , all at once.
The definition subsumes the earlier one. A function defined on the two-element set is determined by the pair of values , so the functions with and correspond to the pairs with and . This identifies with the general product for , and , and we will not distinguish between the two readings from here on.
Definition 4.56 (Cartesian power).
Let and be sets. The Cartesian power is the product of the constant family,
Let , and be sets, with the Cartesian power of Definition 4.56 .
- Prove that if , then .
- Prove that for every non-empty , and that for every .
- Prove that whenever , and deduce that and are disjoint.
Let be a set. For each , the characteristic function of is the function with for and for ; so and when and .
- Give the formulas for and .
- Express in terms of , where is the complement of in .
- Prove that if and only if , for all .
- Prove that and for every .
Keep the characteristic functions of the previous problem.
- Prove that every function is for exactly one .
- Suppose has elements. Determine the number of elements of , and use the first part to count .
Let be a set.
- Prove that no function is surjective.
- Deduce that there is no bijection from to , and decide whether there can be a surjection from to .
The product of two non-empty sets is non-empty, witnessed by any pair with and , and the same argument covers three sets, four, and any collection we can write out in full. Once is infinite the argument fails for the reason we met in the last chapter: we have no way to string an unspecified number of such choices together. Closing that gap takes another axiom.
The Axiom of Choice
Let be a non-empty set and let be an indexed family of sets with for every . Then there exists a function with and for every . Equivalently, a non-empty family of non-empty sets has non-empty product.
Such an is a choice function for the family. The point is the order of the quantifiers: the hypothesis grants each set an element of its own, while the conclusion assembles one selection from every set into a single function.
Remark.
The axiom is independent of the others, in the sense that neither it nor its negation follows from them. In sets carrying some structure a distinguished element can often be picked out constructively, and no axiom is needed; the axiom supplies one in full generality, where no rule for choosing is available. Mathematicians find it rather less comfortable than the rest, so it is good practice, which we will follow, to say plainly whenever it is used.
Theorem 4.58 (Every surjection has a right inverse).
Let be surjective. Then has a right inverse .
Discussion.
Surjectivity says, through Proposition 4.31 , that every point preimage is non-empty. That is exactly the hypothesis of the axiom of choice applied to the family of point preimages indexed by , and what the axiom returns is a function picking one element out of each. The union of the point preimages is , and says precisely that , which is the right-inverse identity. The axiom is needed here: each preimage alone has an element, and the theorem needs one choice per preimage assembled into a single map.
Proof.
If is empty then so is , since every element of would have an image in , and the empty function is a right inverse; so assume is non-empty. For every the set is non-empty by Proposition 4.31 . Applying the axiom of choice to the family gives a function from to with for every . Each point preimage is a subset of , so that union is and . Finally is equivalent to , so and is a right inverse of .
Corollary 4.59 (Surjections and right inverses).
A function is surjective if and only if it has a right inverse.
Proof.
One direction is the theorem. For the other, a right inverse gives for every , so is a preimage of and is surjective.
Let and let be a family of non-empty sets. Show that is non-empty without appealing to the axiom of choice. Where would the argument break down for an index set that cannot be written out in full?
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.
Let and .
The only pair belonging to both and is:
is:
Write and for the statements and , and and for and . Give the condition on the pair for membership in each set below.
The two sets are different. Place one pair that separates them.
Which two products does the second set leave out?
Now the condition of the first part again, written as a disjunction of conjunctions.
Let , and , with , and take as the ambient set.
is:
is:
Let be a positive whole number, let , and let be a family with whenever .
and are:
A family is disjoint if , and pairwise disjoint if whenever .
The family , , is:
For families of three sets:
Counting.
and each have three elements. The number of functions from to is:
has three elements and has two. The number of injections from to is:
And the number of surjections from to is:
With those same and , the number of injections from to is:
Cartesian powers.
The number of elements of is:
For every non-empty set , the power is:
For every set , the power is:
Take the real numbers on trust and let be given by .
is:
is:
is:
A function satisfies for every exactly when it is:
And holds for every exactly when is:
Injective, surjective, both or neither.
given by is:
given by is:
The inclusion map of a set with is:
A constant map , where and both have at least two elements, is:
The function from to a non-empty is:
Keeping the real numbers, let , and be the maps given by , and , where is when and otherwise.
The function is:
The composites and are:
The function is:
Inverses, one-sided and two-sided.
Let and be bijections. The composite is defined:
A function with a left inverse but no right inverse is:
The statement that cannot be proved without the axiom of choice 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 ⟨ ⟩.
The last sheet gave the checker a universe of objects and the algebra of sets. This one adds the constructions of this chapter: the ordered pair, the product, the indexed family and the map.
A pair is typed as it is written, (a, b), and longer tuples nest to the left exactly as Definition 4.4 says, so (a, b, c) is ((a, b), c). The product is ×, typed \x, and it binds like ∩. A map is written f : Obj → Obj and applied by juxtaposition, f x; the domain and codomain of Definition 4.15 are carried by the statement being proved rather than by the arrow.
One piece of the last chapter is written out here for the first time as well: a set listed by its members, {x} and {x, y}. Its membership criterion is the equation the pairing axiom gives, so y ∈ {x} is y = x, and the later exercises use it to name a set with a single point in it.
Ordered pairs
The pair itself is opaque: the checker knows nothing about , only what Proposition 4.2 established about it. That proposition is Set.pair_eq, a biconditional, so .mp reads coordinates off an equality of pairs and .mpr builds one.
Example.
The forward direction turns the equality into a conjunction; the first half of it is the first coordinate.
Corollary 4.3 , in one direction.
Coordinates read off one pair and put back into another.
A triple is a pair of a pair, so its middle coordinate takes two steps to reach.
Products
Membership in a product is the dictionary line of the chapter: (x, y) ∈ A × B is x ∈ A ∧ y ∈ B, in the way that x ∈ A ∩ B was a conjunction on the last sheet, so ⟨_, _⟩ builds one and .left and .right take one apart.
Example.
Two memberships, one pair.
An arbitrary object is not written as a pair, and for it the criterion says the rest of Definition 4.6 : p ∈ A × B is
∃ a, ∃ b, p = (a, b) ∧ a ∈ A ∧ b ∈ Bso a membership hypothesis about an unknown hands over two coordinates, an equation and two memberships. obtain takes all five at once, and the equation is what rw then uses to turn into a pair everywhere it is needed.
Example.
Once has been rewritten, the goal is about a pair and the criterion applies to it.
The coordinates change places and so do the factors.
Nothing can serve as a second coordinate.
The product respects inclusion in each factor.
Products distribute over intersections.
And over unions.
An intersection of products is a product of intersections.
The inclusion that never fails.
The equality the last exercise fell short of, with the two mixed products restored.
Indexed families
A family is a map from indices to sets, written B : Obj → Obj, and its union and intersection are ⋃ i ∈ I, B i and ⋂ i ∈ I, B i, typed \bigcup and \bigcap. Their criteria are the two the chapter gave: membership in the union is ∃ i, i ∈ I ∧ x ∈ B i, and membership in the intersection is ∀ i, i ∈ I → x ∈ B i. So an intersection is used by applying it to an index and a proof that the index belongs to , and a union is built with use.
Example.
The intersection applied at one index.
Example.
use supplies the index; what remains is that the index is one of ours and that lies in its set.
An object outside an intersection misses some set, but we are not given its index: all we hold is that no index can be a witness. Getting the index out is the classical step, and by_contra twice is what does it.
Example.
The first by_contra denies the index we want; the second turns that denial into membership at every index, which contradicts the hypothesis.
A set lies inside the intersection exactly when it lies inside every member.
And the union lies inside a set exactly when every member does.
The first part of Proposition 4.13 .
The second part. The hypothesis hj is the non-emptiness of , and one of the two inclusions cannot be had without it.
The inclusion between the two mixed families, in the direction that holds.
Maps
For a map f : Obj → Obj, the image and preimage of a set are f '' S and f ⁻¹' U, typed as two apostrophes and as \preimage. Their criteria are those of Definition 4.23 and Definition 4.24 : y ∈ f '' S is ∃ x, x ∈ S ∧ f x = y, and x ∈ f ⁻¹' U is f x ∈ U. Composition is g ∘ f, typed \o, and (g ∘ f) x is g (f x). Finally Injective f and Surjective f are the two conditions of Definition 4.30 and Definition 4.28 , ∀ x y, f x = f y → x = y and ∀ y, ∃ x, f x = y, so both are opened with intro.
Example.
The witness is the point itself, and the equation it has to satisfy is an identity.
The preimage passes membership straight through to , which is why it preserves the operations: both sides of each law are the same statement about .
Example.
Part three of Proposition 4.27 , which follows from the criterion.
Images preserve unions.
Every point of is sent into the image of .
And the image of a preimage is no bigger than the set it came from.
The first part of Theorem 4.43 .
Its second part.
Only the first map need be injective for the composite to be.
And only the second need be surjective.
A left inverse, written out pointwise, makes injective.
A right inverse makes it surjective.
Images preserve intersections exactly when the map is injective.
The inclusion two exercises above becomes an equality for an injective map.
And the other inclusion becomes an equality for a surjective one.
An image loses no more than the part removed.
Injectivity closes the gap.
The converse of the exercise three above: only an injection returns every set unchanged.
And nothing but a surjection.
A map carries two maps between the power sets with it, sending to and sending to . The checker has no power set to quantify over, so each of the four statements below says what injectivity or surjectivity of or of amounts to at the level of the sets themselves.
is injective exactly when is.
And surjective exactly when is.
The other pairing: is injective exactly when is surjective.
And surjective exactly when is injective.
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 |
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 |
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 |
Lesson 5
Natural Numbers
Taught
Natural Numbers
The Set of Natural Numbers
The starting point of our journey shall be the counting numbers, and so on. We are all convinced that such a collection exists, and yet a little reflection leads quickly to thoughtfulness. Do not some cosmological theories hold that our universe is finite? If so, and if every elementary particle occupies a non-vanishing, indivisible volume, must not the number of particles be finite? Where then is room for this obviously infinite set? Or, much more primitively, how does one so much as name
Following preliminary work by Dedekind, it was Peano who in 1889 codified our notion of the counting numbers as a successive progression from an origin. Rather than say what a number is, he left the first number and the successor rule undefined, and asked instead which conditions would force the resulting system to hold exactly the objects we want. We follow him, taking the distinguished first element to be .
The Axiom of Infinity
At the close of the last chapter we watched the passage from to generate
and noted that our axioms build each of these but no set holding all of them at once. To close the gap we name the property such a set would have. Throughout we write and call it the successor of .
Definition 5.1 (Inductive set).
A set is inductive if and for every .
An inductive set exists: .
The notation is meaningful by the pairing and union axioms. Note that what it asserts is also new: every earlier axiom builds a set from sets already held, and none guarantees the existence of a set with infinitely many members. An inductive set may be far larger than the chain above, holding all manner of things besides; in our case we want the chain, so we take the smallest inductive set there is.
Definition 5.3 (The natural numbers).
Let be an inductive set. We write for the intersection of all inductive subsets of ,
and . The elements of are the natural numbers.
The collection being intersected is a set by comprehension applied to , and it is non-empty, since is one of its members, so its intersection is defined. Writing , , and so on, we have
Remark (Where to start).
Whether counts as a natural number is a matter of convention rather than of mathematics, and both choices are in use. We keep as the first natural number, which is the older habit and the one that makes “natural number” mean “counting number”, and carry the zero explicitly when we need it. Peano’s system needs a distinguished element with no predecessor, so it is rather than that the axioms below describe.
Proposition 5.4 (Zero belongs to ).
.
Discussion.
Membership in is membership in every inductive subset of , so we take an arbitrary such subset and check what being inductive says about it. The first clause of that definition puts in it, and since the subset was arbitrary the conclusion follows for the intersection.
Proof.
Let be an arbitrary inductive subset of . Then by the definition of an inductive set. Since was arbitrary, belongs to every inductive subset of , and so .
Proposition 5.5 (Closure under successors).
If , then .
Discussion.
The same argument, now for the successor. Assuming and taking an arbitrary inductive subset of , the definition of the intersection puts in , and the second clause of inductiveness carries it to . As was arbitrary, lies in every inductive subset, which is membership in .
Proof.
Suppose and let be an arbitrary inductive subset of . Then , and so by the definition of an inductive set. Since was arbitrary, belongs to every inductive subset of , hence .
The two propositions together say that is itself inductive, and by its very definition it lies inside every inductive subset of . So is the smallest inductive subset of .
Theorem 5.6 (Induction for sets).
Let with and whenever . Then .
Discussion.
We prove the equality by two inclusions, and one of them is the hypothesis. The two conditions on are word for word the definition of an inductive set, so is one of the subsets being intersected, and the intersection is contained in each of them; that gives and finishes it.
Proof.
The two hypotheses say precisely that is inductive, and , so is an inductive subset of . The intersection defining is contained in each set intersected, so . With from the hypothesis, mutual inclusion gives .
The theorem speaks about a subset, but an induction proof usually begins with a predicate. The two describe the same problem: membership in a fixed set is a predicate, and conversely a predicate determines the subset , so proving of every natural number is proving that this subset is everything.
Theorem 5.7 (Induction for predicates).
Let be a predicate on with true and for every . Then holds for every .
Discussion.
We pass from the predicate to the set it cuts out and apply the previous theorem. Put , a set by comprehension. The first hypothesis is and the second is closure of under , which are the two conditions the previous theorem asks for, so ; and that says holds everywhere.
Proof.
Let . By the first hypothesis . If , then holds, so holds by the second hypothesis and . The previous theorem forces , which says that holds for every .
Let and be inductive sets.
- Show that is inductive.
- Would your argument work for three inductive sets? For a thousand? For a family indexed by an arbitrary non-empty set?
The definition of began by choosing an inductive set , and nothing so far says the answer does not depend on that choice. It does not, because is contained in every inductive set, not only in the inductive subsets of .
Proposition 5.8 (The least inductive set).
is inductive, and for every inductive set .
Discussion.
That is inductive is the two propositions above read together, one supplying and the other closure under . The second claim is harder, since an arbitrary inductive need not be a subset of and so is not among the sets we intersected. The problem above gets around this: is inductive, and it is a subset of , so it is one of the sets intersected and therefore holds . Being inside puts inside .
Proof.
The propositions above give and closure under , which is what it means for to be inductive.
Now let be any inductive set. By the problem above is inductive, and , so is an inductive subset of and hence one of the sets whose intersection defines . An intersection is contained in each set intersected, so .
Corollary 5.9 (The construction does not depend on the choice).
Let and be inductive sets, and let and be built from them as above. Then .
Proof.
Both are inductive by the proposition, and both are contained in every inductive set, so and . Mutual inclusion gives the equality.
One more fact about the successor: nothing lies strictly between and .
Proposition 5.10 (The successor is the next set up).
For every set we have , and there is no set with .
Discussion.
The inclusion is immediate, since is a union with as one of its parts. For the second claim we take any with and show it must be one of the two ends, which is the same thing as saying nothing sits strictly between them. Either adds nothing to , in which case the two inclusions make ; or it holds something outside , and that element must be itself, since the only element of outside is . Then , and with already in hand every element of lies in .
Proof.
Since , every element of lies in , so .
Now let satisfy . If , then with we get . Otherwise some has ; since , this forces , so . Together with this puts every element of in , that is, , and so . Hence is or , and no satisfies .
Peano Systems
Definition 5.11 (Peano system).
A Peano system is a set together with a distinguished element and a map , called the successor, satisfying
- ;
- whenever ;
- if , then ;
- for every ;
- if , , and whenever , then .
We write it .
The first two conditions are what it means for to be a function from to with a member of the domain; the third says is injective, and the fourth that lies outside its range.
In any Peano system we write , , , and so on, the symbols recording positions in the successor chain and nothing more.
The first two conditions let us start at and keep taking successors, producing , , , and so on. The last two prevent repetitions among what is produced: were two of them equal, repeated use of the third condition would strip successors from both sides until the fourth was contradicted. So holds infinitely many distinct elements. What we do not yet know is whether it holds anything else.
Reading the construction back gives the familiar symbols as sets:
and so on, each of these sets holding exactly its predecessors.
The fifth condition cannot be dropped. Take to be the real numbers with , with the usual and . The first four conditions all hold, yet lies in and is reached by no finite string of successors from . It is the fifth that fails: the subset consisting of and the counting numbers holds , and holds whenever it holds , yet .
The fifth condition is the principle of induction, and Peano made it one of the axioms for the numbers, rather than a proof technique applied to them from outside. Its predicate form follows in any Peano system as it did above, by passing from a predicate to the subset it defines.
Theorem 5.14 (The natural numbers form a Peano system).
is a Peano system.
Discussion.
Four of the five conditions are already in hand. The first two are the two propositions above, and the fifth is induction for sets. What is left is the third and fourth, and neither follows from minimality alone: they are claims about the particular successor , not about smallness. The fourth is quick, since always holds and so is never empty. The third asks that force , and the proof goes through the fact that every element of is also a subset of it, which is itself proved by induction. Both are left to the problems below.
Proof.
The first condition is the proposition that , the second is closure under successors, and the fifth is induction for sets. The third and fourth are the two problems below.
Show that for every set , which is the fourth condition for .
Call a set transitive if every element of is also a subset of .
- Prove by induction that every element of is transitive.
- Deduce that if for , then , which is the third condition.
Let with distinguished, and define , , and . Which of the five conditions does this system satisfy? For each one that fails, exhibit the failure.
The numerals are nothing but names for positions in the chain, so even the most obvious facts about them have to be proved from the five conditions.
Proposition 5.15 (Three is a natural number).
.
Discussion.
We walk along the chain. The first condition puts in , and the second carries membership from any element to its successor, so we apply it three times, at , at and at .
Proof.
By the first condition . By the second, . By the second again, , and once more, .
Proposition 5.16 (Four is not zero).
.
Discussion.
Do not laugh. Because of the way has been defined, as the successor of the successor of the successor of the successor of , it is not true a priori that it differs from , however obvious that looks; a system in which the chain closes back on itself would have , and the problems below give one. What rules it out here is the fourth condition, which says no element of has as its successor. To apply it we need to be an element of , which is the previous proposition.
Proof.
By definition , and by the previous proposition. The fourth condition gives , that is, .
Proposition 5.17 (Six is not two).
.
Discussion.
Here the fourth condition does not apply directly, since neither number is . Instead we work backwards down the chain with the third condition, which strips a successor from both sides of an equation: assuming gives , hence , hence , hence . That is what the previous proposition forbids, so the assumption cannot stand. This is the argument sketched after the definition: repeated use of the third condition reduces any equality to a contradiction with the fourth.
Proof.
Suppose, for contradiction, that . Then , so the third condition gives . Then , so the third condition gives , contradicting the previous proposition. Hence .
Predecessors
In a Peano system, . Consequently every element other than is the successor of exactly one element.
Discussion.
We prove the equality by two inclusions. The fourth condition gives at once, since no successor is . For the reverse inclusion we cannot chase an element directly, since being non-zero says nothing about where an element came from; instead we put and use induction. This holds by construction and is closed under because every lies in , so the fifth condition forces , and every non-zero element is therefore a successor. The uniqueness of the predecessor is then the third condition.
Proof.
Let . Then , and if then , so by the fifth condition. Thus every lies in , while does not by the fourth, and so .
If , then by the third condition, so the element producing is unique.
So can be inverted. Regarded as a map onto , the successor is surjective by the theorem and injective by the third condition, so it is a bijection, and invertibility supplies an inverse
the predecessor map, satisfying and . This shortens the axiom list: in place of the second, third and fourth conditions we may simply demand that be a bijection.
Corollary 5.19 (No element is its own successor).
In a Peano system, for every .
Proof.
Let . By the fourth condition , so . Suppose . If , then by the third condition, contradicting ; hence . By the fifth condition, .
Induction Without Order
In the counting numbers we expect every non-empty subset to have a least element, but least is an order notion and a Peano system carries no order. The property can still be stated without an order: a non-empty subset should hold an element that is not the successor of any of its elements.
Theorem 5.20 (Induction without order).
Let be a set with an element and let be a bijection. Then the following are equivalent.
- The only subset of holding and closed under is itself.
- Every non-empty subset holds an element with .
Discussion.
We prove both implications by contradiction, since each hypothesis is a statement about all subsets and gives us nothing to construct from. Suppose the first holds and the second fails. Then some non-empty satisfies , and we pass to the complement : the codomain of excludes , which puts in , and injectivity shows is closed under , so the first condition makes and empty. Conversely, suppose the second holds and some proper holds and is closed under . The complement is non-empty, so it has a starting element , which is not and is therefore for some by surjectivity. Whether lies in or in , we get a contradiction.
Proof.
Suppose the second statement fails for the non-empty set , so , and put . If , then , which is impossible since the codomain of is ; hence . Let and suppose . Then , so for some , and injectivity gives , contradicting . Thus holds and is closed under , so by the first statement and , a contradiction.
Conversely, let hold and be closed under , and suppose . Then is non-empty, and the second statement provides with . Since we have , so surjectivity gives for some . If , then , against the choice of ; if , then by closure, against . Neither is possible, so no such exists.
Note that
Guess the general law suggested here and prove it by induction.
Note that , that , and that . Guess the general law suggested here and prove it by induction.
Note that , that , and that . Guess the general law suggested here and prove it by induction.
For every with , guess a general law which simplifies the product
and prove it by induction.
Recursion
In what sense are the natural numbers unique? The elements of two Peano systems may look completely different, but the conditions determine everything except the names. Any two are linked by a relabelling that respects the only structure present, the zero and the successor:
Whatever the relabelling is, it must send to , hence to , and so on down the ladder. What the picture does not show is that the instruction “start at and keep applying ” defines a map on all of . Turning such an instruction into a function is called recursion, or inductive definition.
One piece of language first. Given maps , , and , we draw
and call the square commutative if , that is, if the two routes from to agree. A larger diagram, like the ladder above, is commutative when every square inside it is.
Theorem 5.21 (Recursion theorem).
Let be a Peano system, let be a set with an element , and let . Then there is exactly one map with and ; that is, exactly one sending to and making the square
commute.
Discussion.
Pointwise the commuting square says , so the map is prescribed at and prescribed one step at a time thereafter. We must prove both uniqueness and existence, and they need different tools. Uniqueness is induction: for two candidates, the set where they agree holds and is closed under , so the fifth condition makes it all of . Existence cannot be induction, since there is no map yet to induct on; instead we build the map as a set of pairs. Call admissible when it holds and sends each to , and let be the intersection of all admissible subsets, which is admissible in its turn and sits inside every one of them. By the definition of a function it remains to show that each occurs in exactly one pair of , and both halves of that are inductions. The second half uses a deletion argument: a pair not forced by the closure rule can be removed, leaving a smaller admissible set, which contradicts the minimality of ; the fourth and third conditions justify the two deletions.
Proof.
For uniqueness, let and both satisfy the two requirements and put . Since we have , and if then , so . By the fifth condition , that is, .
For existence, call admissible if and whenever . The whole of is admissible, so the admissible sets form a non-empty collection, carved from by comprehension; let be its intersection, which is admissible in turn and lies inside every admissible set. We claim each appears in exactly one pair of ; by the definition of a function the claim makes a function , and admissibility then reads and .
That each appears in some pair is an induction on : admissibility puts , so , and if then , so is closed under .
That no appears twice is an induction on . In both steps, a pair not forced by the closure rule may be deleted from , leaving a set which is still admissible yet strictly smaller than the smallest admissible set, a contradiction.
For the base step, suppose with , and delete it. The set still holds , and it is still closed, since every pair the rule produces has first coordinate , which is never by the fourth condition. Hence no such exists and .
For the inductive step, let appear only in the pair , suppose with , and delete it. Again survives, by the fourth condition. For closure, take a surviving pair ; the rule demands , and this survived too: if it is not the deleted pair, while if then by the third condition, so by the choice of and . The same contradiction forbids , so appears only in and . By the fifth condition, .
Theorem 5.22 (Uniqueness of Peano systems).
Let and be Peano systems. Then there is exactly one bijection with making the square
commute.
Discussion.
Apply the recursion theorem with , and . It gives a unique map with and , and any bijection meeting the requirements must be that map, so only bijectivity is left to prove. We get it by producing an inverse rather than by checking injectivity and surjectivity separately. Applying the theorem again with the two systems exchanged gives , and the composite sends to and commutes with , so it solves the same recursion problem on as the identity does; uniqueness identifies the two. The same argument on the other side finishes it.
Proof.
Applying the recursion theorem with , and gives exactly one map with and ; it remains to prove bijective. Exchanging the systems gives likewise a unique with and .
Put . Then , and associativity of composition lets us compute without brackets:
So solves the recursion problem on with and ; so does ; and by the uniqueness clause . The same argument with the systems exchanged gives . Hence is an inverse of , and is bijective by invertibility.
The condition is in fact automatic: any bijection with already sends to . Otherwise surjectivity would provide some with , the theorem on predecessors would write , and then would exhibit as a successor in , against the fourth condition.
So there is, up to relabelling, only one system of natural numbers. Whether we take the Hindu-Arabic symbols , the Roman ones augmented with a zero, or the nested empty sets of the example above, the arithmetic that follows is the same.
Arithmetic
The recursion theorem lets us define arithmetic inside any Peano system, with no arithmetic assumed from outside.
Any addition should satisfy , should be associative, and should have as an identity. These requirements determine it, since the first two give
which determines for every once is fixed. That some operation satisfies them is a separate question, settled by the recursion theorem.
Let be a Peano system and let . The recursion theorem applied with , and yields exactly one map with and . We write , so that
In particular . The defining clauses deal with a or an on the right of a sum; for the laws of addition we also need them on the left.
Proposition 5.24 (Addition from the left).
For all , we have and .
Discussion.
We induct on the right-hand variable in both, since that is the position the defining clauses are about. For the first, the base case is the clause read at , and the step uses the other clause: . For the second, fix and take the statement . Its base case reduces both sides by the first clause. For the step, apply the successor clause on the left, replace by using the hypothesis, and apply the clause once more. As was arbitrary throughout, the result holds for all and .
Proof.
Let . Since we have , and if then , so . By the fifth condition .
Now fix and let . Since we have . If , then
so . By the fifth condition , and since was arbitrary the identity holds throughout.
Theorem 5.25 (Laws of addition).
For all , we have and .
Discussion.
Both are inductions on the variable sitting in the right-hand position of a sum, where the definition applies. For associativity, fix and and take the statement ; its base case reduces both sides by , and its step rewrites the left as , applies the hypothesis, and uses the successor clause twice to arrive at . For commutativity, fix and take ; the base case is , which needs the first identity of the preceding proposition, and the step turns into , applies the hypothesis, and then uses the second identity to reach . Neither induction would close without that proposition, since both steps have to move a successor across to the left of a sum.
Proof.
Fix and let . Both and equal , so . If , then
so , and by the fifth condition.
Next fix and let . The preceding proposition gives , so . If , then
using that proposition again at the last step, so . By the fifth condition , and since was arbitrary the identity holds throughout.
Definition 5.26 (Positive elements).
An element of a Peano system is positive if .
Proposition 5.27 (Positivity is absorbing).
If is positive and , then is positive.
Discussion.
We induct on , since the defining clauses of addition are about the right-hand variable. The base case is , which is positive by hypothesis. For the step, the successor clause turns into , and the fourth condition says no successor is , so the conclusion needs nothing from the inductive hypothesis at all.
Proof.
Let . Since and is positive, . If , then , which is not by the fourth condition, so . By the fifth condition .
Corollary 5.28 (A sum is zero only when both parts are).
If satisfy , then and .
Proof.
Suppose . Then is positive, so is positive by the proposition, contradicting . Hence , and by commutativity the same argument gives .
Define multiplication in a Peano system by the clauses and . Show that these clauses do define a map from to .
Using the previous problem, prove that for all :
- ;
- ;
- ;
- ;
- .
Proposition 5.29 (Positive elements are closed under addition and multiplication).
Let and be positive elements of a Peano system, with multiplication as in the two problems above. Then and are positive.
Discussion.
The sum is Proposition 5.27 read at a positive , which puts no condition on . The product needs one more step. Being positive, is not , so the theorem on predecessors writes it as for a unique , and the second clause of the multiplication problem turns into . That is a sum whose left part we know nothing about and whose right part is positive, which is the case Proposition 5.27 covers, once commutativity puts the positive part in front. No induction is needed, since writing as a successor lets us apply the second clause once.
Proof.
That is positive is Proposition 5.27 , since is positive.
For the product, , so the theorem on predecessors gives for some . Then by the second clause of the multiplication problem, and by commutativity of addition. Since is positive, Proposition 5.27 makes positive, so is positive.
Write for the positive elements of a Peano system, and recall . Show that every with is for some . Why does the argument need , and not merely ?
Let . Use the recursion theorem, with a starting element and a map of your choosing, to produce a unique map satisfying
written for . Prove directly from the clauses that , and, writing , compute , and from the definitions alone.
Let satisfy . Prove that for every . No commutativity is needed.
Let .
- Prove that if , then .
- Deduce that implies .
- Show that if with positive, then .
Prove that for all , and that the map sending to is the unique one with , and for all .
Sums
Some recursive definitions do not fit the recursion theorem as it stands.
Imagine defining the running totals , the sum of everything up to . Once is found, the next total should be : the old total is kept and the next term added. That update needs both the previous value and the index, whereas the recursion theorem applies a fixed map to the previous value alone and never sees where it is. The fix is to carry the index along.
Proposition 5.30 (Parametrised recursion).
Let be a Peano system, let be a set with an element , and let . Then there is exactly one map with
Discussion.
In the recursion theorem the next value is computed from the previous value alone, while also needs the index. So we make the previous value carry its own index: apply the theorem on rather than on , starting at and stepping by . That gives a map , and an induction shows its first coordinate at is always itself, so the second coordinate is the we want. Uniqueness goes the same way in reverse: any rival can be paired with its index to give a rival , which solves the same recursion problem on and is therefore by the uniqueness already proved.
Proof.
Apply the recursion theorem with target set , initial element , and the map sending to . It gives a unique with and whenever .
Let be the set of for which for some . Since we have ; and if with , the displayed equation gives , so . By the fifth condition .
For each write . Then , and the defining equation for reads .
If is another map with these two properties, let . Then and , so solves the same recursion problem as ; the uniqueness clause of the recursion theorem gives , and comparing second coordinates gives .
Before using sums we should say what the dots are doing. In
they leave the middle terms to the pattern made visible by the terms around them. This is a convention for readers, not a definition: determines nothing without further context. We replace the convention by a recursion, so that the expression has a meaning whether or not the pattern is visible.
Proposition 5.31 (The summation symbol).
Let be a Peano system with addition, and let be a map, written for . Then there is exactly one map with
We write for , so that the two clauses read
Discussion.
The update needs the index as well as the running total, since it is the index that says which term comes next, so this is parametrised recursion rather than the plain kind. We take , initial element , and , which is a map from to because addition is. The two clauses of the proposition are then exactly the two the previous result delivers, and its uniqueness clause gives ours.
Proof.
Apply parametrised recursion with , initial element , and given by . It supplies exactly one map with and , which are the two clauses asserted.
The limits carry no order with them: nothing here says that runs through the elements between and , only that the recursion starts at and steps by . Once an order is available the notation will mean what it looks like it means.
The index is bound by the symbol and may be renamed at will, so that
while may not be renamed, since the value depends on it. The value is the empty sum, worth keeping both because it starts the recursion and because it spares us a separate case whenever a sum is allowed to run out of terms. Notice too that the clauses fix one reading of , the one that brackets from the left; that any other bracketing gives the same element is a consequence of the laws of addition, and we leave it to a problem.
Show that there is exactly one map with and for every , where multiplication is as defined in the problems above, and write for . Which clause takes the place of the empty sum, and why is that the right choice?
Argue from the defining clauses alone.
- Let for every . Prove that and for every .
- Let for every , so that the sum is the running total of everything up to . Prove that
Prove that
stating carefully what the second sum on the right means as a recursion in its own right. Where do the laws of addition enter?
Let and be Peano systems, each carrying the addition of Definition 5.23 and the multiplication of Problem 5.9 , and let be the bijection of Theorem 5.22 . Prove that and for all .
Let be a Peano system with multiplication.
- Produce a map with and for every .
- Show that there is no with for every , and deduce that Theorem 5.21 taken with cannot produce .
Let be a non-empty set and let . Taking for the set of all maps from to itself, use Theorem 5.21 to produce the iterates of , characterised by and for every .
- Suppose for some . Determine and , with proof.
- Suppose instead that . Determine , with proof.
- Find a map with , , and .
- Decide whether there is a map with , and .
Let be maps, written for and for , and let . Prove that for every :
- ;
- ;
- if for every , then .
Let denote the statement .
- Prove that if holds for some , then holds.
- Criticise the statement: “by induction it follows that holds for every ”.
- Determine which , if any, satisfy .
Work in a Peano system with addition, multiplication and the powers of Problem 5.12 .
- Prove that for every .
- Deduce that .
The Fibonacci numbers are , each after the second being the sum of the two before it.
- Produce exactly one map with and for every , writing for .
- Prove that for every exactly one of
holds, and that which of the two holds changes at every step.
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.
The numerals, read back as the sets they were built from.
The set is:
The number of elements of the set is:
Of the two statements and :
Inductive sets.
The set of natural numbers proper is:
And is:
Let be any inductive set. Then is:
Each line below alters in one place. Say which of the five conditions the result fails.
The successor is replaced by .
The carrier is cut down to , keeping , with distinguished in place of .
The successor is left alone except at , where .
Starting elements. Work in an arbitrary Peano system .
The elements that are not successors are:
Induction without order gives every non-empty an element with . For that element is:
And for :
What the recursion theorem produces. Take throughout, with the addition and multiplication of the chapter.
With and , the map is:
With and , it is:
Relabelling. Let and be Peano systems.
Let satisfy and . Then is:
Drop the condition at . The number of maps with is then:
And the number of those that are bijections is:
Arithmetic in a Peano system.
The product is:
Suppose with positive. Then:
Sums.
The result that defines is:
With , the element is:
In the expression :
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 ⟨ ⟩.
The last sheet gave the checker pairs, products, maps, and the sets the pairing axiom lists. This one adds a Peano system to compute in.
The successor
A listed set is typed as it is written, {x} and {x, y}, and its membership criterion is the one the axiom gives: y ∈ {x} is y = x, in the way that x ∈ A ∩ B was a conjunction on an earlier sheet. So the successor needs no notation of its own; it is x ∪ {x}.
Example.
The membership and the equation are one statement, so nothing has to be done to pass between them.
Example.
A union is a disjunction, and its right half is an equation that holds of itself.
The first half of Proposition 5.10 .
The fourth Peano condition for .
Two inductive sets, and their intersection.
Transitivity passes to the successor, which is the step of the induction that makes every element of transitive.
The second half of Proposition 5.10 : a set between and its successor which reaches outside is the successor.
And the third Peano condition, which transitivity was proved for.
A Peano system
ℕ is now read as the carrier , with 0 its distinguished element and succ its successor. Nothing about the sets and survives the change: what a proof may use is the five conditions and nothing else. Two of them have names, Nat.succ_inj for the third and Nat.succ_ne_zero for the fourth. The fifth is a tactic.
induction
induction n with k ih is the fifth condition applied to the set of at which the goal holds. It leaves two goals: the goal at 0, and the goal at succ k with ih recording it at k. Prove them under focus dots, as with any pair of goals.
Addition and multiplication arrive as their defining clauses, Nat.add_zero and Nat.add_succ, Nat.mul_zero and Nat.mul_succ. A clause may be cited bare: rw [Nat.add_succ] finds the first ?m + succ ?n in the goal and reads the two off it, and rw [Nat.add_succ m n] names them.
Example.
Two clauses, in the order the sum is peeled: the successor first, then the zero underneath it. rw closes what is left when both sides come out the same.
Example.
The first half of Proposition 5.24 . It is listed below as Nat.zero_add, along with the rest of what the lecture proved, so the exercises may lean on it.
One is not zero.
A successor may be moved from one side of a sum to the other.
Addition cancels.
Nothing but zero can be added without moving.
A map commuting with the successor is a translation. No commutativity is needed.
Multiplication from the left, at zero.
And one is an identity on the right.
Multiplication from the left, at a successor. The two clauses only ever act on the right, so this one takes more work.
Multiplication distributes over addition.
And it commutes, once both sides can be peeled.
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 |
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 |
Lesson 6
Relations and Order
Taught
Relations and Order
People classify: we decide which things belong together, and mathematics does this on every page. This chapter covers relations in general, then the two most important kinds, orders and equivalences, and finally the way an equivalence cuts a set into pieces.
Relations
A relation records, for each pair of elements, whether the two stand in a given relationship. Since a pair with an order to it is an ordered pair, and the set of all of them is a Cartesian product, no new definitions are needed.
Definition 6.1 (Binary relation).
A relation on a set is a set of ordered pairs of elements of , that is, a subset . We abbreviate to , and say is related to by ; if we write .
Putting the symbol between the two elements is infix notation; writing instead is prefix notation. For equivalence relations we usually take a symbol such as or , and for strict orders the symbol .
Two relations are distinguished exactly by the pairs belonging to one and not the other, since a relation is its set of pairs. At the two extremes, is the universal relation on and is the empty relation. Neither is of much interest: if everything is related to everything then being related is no mark of distinction, and if nothing is related to anything there is nothing to say.
Definition 6.2 (Reflexive, symmetric, transitive).
Let be a relation on a set . Then is
- reflexive if for every ;
- symmetric if for all ;
- transitive if for all .
From a familiar children’s game, let and let , read “beats”, be
This is none of the three: rock does not beat itself, rock beats scissors while scissors does not beat rock, and rock beats scissors and scissors beats paper while rock does not beat paper.
Definition 6.4 (Equivalence relation).
A relation is an equivalence relation if it is reflexive, symmetric and transitive. When is an equivalence relation and , we say and are equivalent with respect to .
On the relation is symmetric and transitive but not reflexive, since . Adjoining exactly what is missing gives , which is reflexive, inherits symmetry and transitivity, and is therefore an equivalence relation. We call the reflexive closure of : it adds to only the pairs that reflexivity requires.
Transitivity is the condition that most often fails. Let be the partially exposed stones in a stream you wish to cross, and for let mean that you can step directly from to without getting wet. This is reflexive, since once on a stone you can hop on the spot, and symmetric, since a step you can take one way you can take back. It is not generally transitive: that you can reach from and from says nothing about reaching from in one step.
Check that the relation above is symmetric and transitive, working from the definitions rather than from the picture.
Let and be sets. Many texts call a subset a relation from to . Show that every such is a relation on in the sense of Definition 6.1 .
Let be a symmetric and transitive relation on a set , and put . Show that implies , and that is an equivalence relation on .
Order Relations
Orders are the second of the two kinds of relation we shall need. We isolate the properties an order has, so that when we later build one on the natural numbers out of addition alone we know exactly what has to be checked.
Definition 6.7 (Strict linear order).
A strict linear order on a set is a relation, commonly written , satisfying
- the transitivity law: for all , if and then ;
- the trichotomy law: for all , exactly one of , , holds.
When holds we say is strictly less than . Strict linear orders are also called strict total orders, in contrast with the partial orders of the next section. The word exactly in the trichotomy law says two things: any two elements can be compared, and no two of the alternatives hold at once. Proofs use the second far more often than the first, so we isolate it.
Proposition 6.8 (Anti-reflexivity).
Let be a strict linear order on a set . Then for every .
Discussion.
The statement is a universally quantified negation, so we fix an arbitrary and rule out . Only the trichotomy law says anything about a single pair, so we apply it to the pair and . It offers three alternatives, , and , and exactly one of them holds. The middle one holds, since equality is reflexive, which rules out the other two; and each of those is the statement we wish to deny.
Proof.
Let . Trichotomy applied to and says that exactly one of , , holds. Since holds, neither occurrence of can, so .
Trichotomy can be traded for the weaker demand that at least one alternative hold, provided we also assume anti-reflexivity.
Proposition 6.9 (Characterising strict linear orders).
Let be a relation on a set such that
- for all , if and then ;
- for all , ;
- for all , .
Then is a strict linear order on .
Discussion.
The definition asks for two laws, and the first is the first hypothesis verbatim, so only trichotomy needs proof. It splits in two: that at least one alternative holds is the second hypothesis, again verbatim, and it remains to show that no two hold together. There are three possible pairs, the two strict comparisons together or either strict comparison alongside , and we take them in turn. Two opposite strict comparisons feed into transitivity and produce ; a strict comparison alongside an equality lets us substitute one letter for the other and produce again. Each case gives , which the third hypothesis forbids.
Proof.
The first hypothesis is the transitivity law. For trichotomy, let . The second hypothesis gives at least one of , , .
If both and held, transitivity would give , against the third hypothesis. If and held, substitution gives ; and with gives likewise. So no two of the alternatives hold together, exactly one holds, and that is the trichotomy law.
A strict order says which of two elements comes first. For bounds, minima and induction it is more convenient to use the relation that also allows equality.
Definition 6.10 (Associated non-strict order).
Let be a strict linear order on a set . The associated non-strict order is defined by: holds if and only if holds. When we say is less than or equal to .
Proposition 6.11 (Laws of the associated order).
Let be a strict linear order on with associated . For all :
- ;
- if and then ;
- if and only if ;
- if and only if .
Discussion.
All four come from the list of three alternatives in trichotomy, so in each we go through the list and see which entries remain. The first is a disjunction and every entry produces one of its halves: gives , gives , and gives both. The second is a conditional whose conclusion is an equality, so we suppose and derive a contradiction: the definition turns both hypotheses into strict comparisons, transitivity gives , and anti-reflexivity forbids it. The last two are biconditionals, proved by crossing entries off the list. Denying deletes the first two entries and leaves ; conversely deletes those same two, since trichotomy allows only one. Denying deletes just the first entry, leaving or , and that pair is what abbreviates.
Proof.
For the first, trichotomy gives , or , and in each case the definition gives or .
For the second, suppose and , and suppose . Then the definition gives and , so transitivity gives , contradicting anti-reflexivity. Hence .
For the third, if then neither nor holds, so trichotomy leaves . Conversely excludes both and , so .
For the fourth, trichotomy says holds precisely when or , which by the definition is precisely .
From transitivity of we get two further transitivity laws, one for each way of mixing the two relations.
Proposition 6.12 (Mixed transitivity).
Let be a strict linear order on with associated , and let . Then
- if and then ;
- if and then .
Discussion.
Each part has one strict hypothesis and one non-strict one, and the definition of splits the non-strict hypothesis into two cases, so each part has two cases. In the equality case no order reasoning is needed at all: the conclusion is the strict hypothesis with one letter renamed. In the strict case both hypotheses are strict, so the transitivity law applies.
Proof.
For the first, if then is the hypothesis with written for ; and if then transitivity gives .
For the second, if then is the hypothesis with written for ; and if then transitivity again gives .
Corollary 6.13 (Transitivity of the non-strict order).
Let be a strict linear order on with associated . If and then .
Proof.
If and then . If and then ; if and then ; and if and then mixed transitivity gives . In every case the definition of gives .
Definition 6.14 (Reverse orders).
Let be a strict linear order on . We write to mean , and say is strictly greater than ; and to mean , and say is greater than or equal to .
Since and are transitive, so are and .
The notation abbreviates , and similarly for , and , for more than three terms, and for mixtures: abbreviates .
By transitivity, gives .
What is the difference between the trichotomy law and the weak trichotomy law? Which of the two implies the other?
Show that a strict linear order is not symmetric on any set with at least two elements, and decide whether the associated can ever be symmetric.
Partial Orders and Extrema
The order relations of the previous section were strict and linear: transitive and trichotomous, with the non-strict built afterwards. There is a second tradition, equally common, which takes the non-strict relation as primitive and weakens trichotomy so that incomparable pairs are allowed. That is the language of partial orders, and it is what one wants for inclusion of sets.
Definition 6.16 (Partial order).
A relation on a set is a partial order, and is then ordered by , if is
- reflexive: for every ;
- antisymmetric: and imply ;
- transitive: and imply .
We usually write for , and then for , with and as before.
Definition 6.17 (Comparable elements and total orders).
Let be partially ordered. Elements are comparable if or . The order is a total order, or linear order, if every two elements are comparable.
The power set is partially ordered by , and also by the reverse inclusion. It is not totally ordered as soon as has two elements and , since and are incomparable: neither contains the other. The natural numbers will turn out to be totally ordered, once we put an order on them below.
Remark (Partial versus strict).
The two languages agree on total orders. If is a strict linear order and is the associated relation, then is a total order in the present sense: reflexivity is immediate, antisymmetry is one of the laws proved above, and transitivity is its corollary. Conversely, from a total order the relation is a strict linear order. What partial orders add is the possibility that some pairs are incomparable.
Definition 6.19 (Minimal and maximal elements).
Let be partially ordered and non-empty. An element is minimal in if no element of is strictly smaller, that is, ; and is maximal in if no element of is strictly larger.
A bound of a set need not lie in the set; a minimum or maximum must.
Definition 6.20 (Bounds, minima, maxima).
Let be a subset of a partially ordered set .
- An element is a lower bound of if for every , and is an upper bound if for every .
- An element is a minimum, or least element, of if for every ; and is a maximum, or greatest element, if for every .
The difference is membership: a minimum is a lower bound that happens to lie in . Not every subset has either, as the natural numbers will shortly illustrate: they have a least element and no greatest one.
Proposition 6.21 (A bound inside the set is an extremum).
Let be a subset of a partially ordered set. If is a lower bound of and , then is a minimum of ; and if is an upper bound of with , then is a maximum.
Discussion.
The two halves are dual, so it is enough to plan the first and reverse the inequalities for the second. What we are given is a lower bound of that also lies in . The bound hypothesis is for every , which is the inequality a minimum must satisfy, and the membership is precisely the extra clause the definition of a minimum asks for. Together these are the claim; the two definitions differ only by that clause.
Proof.
If is a lower bound of then for every , and by hypothesis; those two together are the definition of a minimum. The argument for maxima is the same with the inequalities reversed.
Existence may fail, but uniqueness does not.
Proposition 6.22 (Uniqueness of extrema).
Let be a subset of a partially ordered set. The minimum of , if it exists, is unique, and likewise the maximum.
Discussion.
Suppose two elements are both minima. Each, being a minimum, is below every element of , and each, being a minimum, lies in ; so applying the defining property of the first to the second and of the second to the first gives the two inequalities antisymmetry needs. The argument for maxima is identical with the inequalities reversed. The proposition does not say that a minimum exists, only that there cannot be two. Bounds outside are under no such restriction, since a set may have many lower bounds.
Proof.
Let and both be minima of . Then , since is a minimum and ; and for the same reason with the roles exchanged. Antisymmetry gives . The argument for maxima is identical.
For ordered by inclusion, identify the minimum and the maximum. In , show that every singleton is minimal, and decide whether there is a minimum.
Let and be totally ordered sets and let be a bijection with whenever . Show that whenever , and deduce that has the same property.
Partitions
Consider a three-piece jigsaw. How many states of assembly are there, counting two states as different when one has two pieces interlocked that the other does not? The answer is five. Representing each cluster of interlocked pieces by the set of its numbers, each state becomes a family of such sets:
Each is a family of non-empty sets whose union is , no two of which share an element.
Let be a non-empty set. A partition of is an indexed family of non-empty subsets of with
The are the blocks of the partition.
The set has as its only one-block partition, and seven with two blocks:
It has six with three blocks, and its only four-block partition is .
A partition is how we get a handle on a large set: cut it into blocks, deal with the blocks one at a time, and put the pieces back together. The blocks are usually chosen by a shared feature.
Assuming you know the real numbers, let be a set of them and suppose a calculation requires that we treat numbers differently according to sign. Take the three blocks
This is a partition only if holds a positive number, a negative number and zero, since blocks are required to be non-empty. Without that requirement every family of conditions would partition every set.
List the six three-block partitions of .
Equivalence Classes
Fix an equivalence relation on a set . We cut into pieces by grouping together everything related to a given element.
Definition 6.26 (Equivalence class).
Let be an equivalence relation on a set and let . The equivalence class of is
and the set of all equivalence classes is
called modulo , or the quotient of by .
On with the equivalence relation above, , and . Distinct classes here do not meet, and the next proposition shows this always happens.
Proposition 6.28 (Characterising equivalence classes).
Let be an equivalence relation on a set and let . The following are equivalent.
- ;
- ;
- .
Discussion.
Three statements would ordinarily need six implications, but a cycle is enough: we prove and let each statement reach every other by going round. For we assume and aim at an equality of sets, so we chase an element: means , and the chain closes by transitivity, with symmetry supplying whichever direction the chain needs; the reverse inclusion is the same argument with and exchanged. For reflexivity puts in , so if the classes agree then itself witnesses that they meet. For a shared element gives and , and symmetry with transitivity gives . Only the three defining properties are used.
Proof.
. Suppose and let , so . With transitivity gives , that is ; hence . Symmetry gives , and the same argument with and exchanged gives . So .
. Reflexivity gives , so . If then , which is therefore non-empty.
. Let . Then and . Symmetry gives , and transitivity with gives .
Remark (Disjoint decomposition).
It follows that is the union of the classes and that distinct classes are disjoint:
An equivalence relation therefore breaks into pairwise disjoint non-empty pieces. Some authors write for a union whose parts are known to be disjoint.
Let be an equivalence relation on . Show that for every , and that if then .
Assuming you know the real numbers and the whole numbers, let mean that is a whole number. Check that is an equivalence relation on the real numbers, and describe and .
Let be a map and declare on when . Show that is an equivalence relation, and that is in bijection with the image .
From Equivalence Relations to Partitions
An equivalence relation gives a partition, and a partition gives an equivalence relation. We prove each direction in turn.
Theorem 6.29 (Equivalence relations induce partitions).
Let be an equivalence relation on a non-empty set . Then the family of its equivalence classes is a partition of , called the partition induced by .
Discussion.
We check the three conditions in the definition of a partition: blocks non-empty, blocks pairwise disjoint, blocks covering . Non-emptiness is immediate, since reflexivity puts in . Disjointness is the previous proposition read contrapositively: if two classes meet they are equal, so distinct classes cannot meet. For the cover, the same reflexivity observation puts every in the block , while the reverse inclusion is automatic because every class is a subset of . One class may have many labels, since whenever , so we index the family by the distinct classes and do not count one block twice.
Proof.
Write the distinct classes as an indexed family .
Each is non-empty: if then by reflexivity. If then , so by the previous proposition. Every is a subset of , so the union of the is contained in ; and if then by reflexivity, and is one of the , so lies in the union. Hence the union is , and the family is a partition.
The relation on induces the partition , which is the list of classes computed above.
Theorem 6.31 (Partitions induce equivalence relations).
Let be a partition of a set , and for declare to mean that and lie in the same block of . Then is an equivalence relation on , and the partition it induces is itself.
Discussion.
There are two claims. For the first, the three properties come from the three conditions on a partition. Reflexivity uses the cover, since every lies in some block. Symmetry is immediate, since “same block” does not depend on which element is named first. Transitivity uses disjointness: if and share a block and and share a block, then lies in both, so the two blocks meet and are therefore the same block, which then holds and . For the second claim, fix and let be the block holding it. Then exactly when shares a block with , which is exactly when ; so the class is the block , and the family of classes is .
Proof.
Write , so the are non-empty, pairwise disjoint, and their union is .
For reflexivity, an lies in some by the cover, so . For symmetry, if then both lie in some , so both lie in it in the other order and . For transitivity, if and then and for some ; then , so since distinct blocks are disjoint, and gives . So is an equivalence relation.
For the second claim, let and let be the block holding , unique because distinct blocks are disjoint. Then if and only if , which holds if and only if . So , and the family of classes is exactly .
Take the partition of and write down every pair in the equivalence relation it induces. Check that you recover .
How many equivalence relations are there on a set with three elements? Count the partitions, then appeal to the two theorems.
The Order on the Natural Numbers
We now define the order on the natural numbers from addition. Throughout this section we work in , which is a Peano system under , so all five conditions and the recursion theorem apply. Addition already suggests the order: lies beyond when it is reached from by adding something positive.
Definition 6.32 (Order on the natural numbers).
For we define to hold if and only if there is a with ; in symbols,
Since , the difference is required to be positive. Admitting would make every number less than itself and break trichotomy.
Corollary 6.33 (Adding a positive element moves you up).
If and then . In particular for every .
Proof.
Take in the definition. For the second claim take , which lies in , and recall .
The definition is stated in terms of differences, so we first show that a difference is unique.
Proposition 6.34 (Uniqueness of differences).
Let . Then has at most one solution .
Discussion.
Uniqueness statements are proved by assuming two solutions and forcing them to agree, so we let be the statement that any two solutions for that coincide, and induct on . The base case is immediate, since reads by addition from the left. For the step we take ; both sides are successors, of and of , and the third Peano condition strips a successor from an equation, leaving an equation the inductive hypothesis handles.
Proof.
We induct on . For , the equation gives by addition from the left, so there is at most one solution.
Suppose the claim holds for and that . By addition from the left, , so ; the third Peano condition gives , and the inductive hypothesis gives . Induction completes the proof.
To decide whether we do not need the case split in the definition of the associated order: one difference is enough, provided we now allow it to be .
Proposition 6.35 (The associated order on the natural numbers).
For we have if and only if for some .
Discussion.
The statement is a biconditional, so there are two conditionals. Going forwards, the definition of unfolds into the two cases and , and we must produce a difference in each: the first hands us one directly, and in the second works. Going backwards we are given a difference and must decide which half of holds, so we split on whether is ; if it is then , and if it is not then and the definition of applies. Either way .
Proof.
Suppose . Then or . In the first case the definition of supplies with ; in the second, serves, since . Either way .
Conversely suppose with . If then , so . If then , so and again .
When the with is unique, by the proposition on differences, and we write it . So subtraction is defined exactly when the answer lies in .
Proposition 6.36 (Positive means greater than zero).
Let . Then if and only if . Consequently for every .
Discussion.
Both directions run through the one equation . Going forwards we must produce a difference witnessing , and satisfies the equation, lying in because that is the hypothesis. Going backwards the definition hands us a with , so and are the same element and the hypothesis transfers. The consequence follows: an element of is either , where equality serves, or lies in , where the biconditional gives .
Proof.
Suppose . Then by addition from the left, and , so by the definition of .
Conversely suppose . The definition gives with , so .
Finally, an is either or a member of ; in the first case and in the second , so in both.
The proof that is an order splits at a chosen element, and we use the same splitting later for the induction variants and for well-ordering, so we give it a name.
For we write
Theorem 6.38 (The natural numbers are strictly ordered).
The relation of the definition above is a strict linear order on .
Discussion.
The definition of a strict linear order wants transitivity and trichotomy, and the characterisation proved earlier lets us replace the second by weak trichotomy and anti-reflexivity, so there are three things to prove. Transitivity is a calculation: two positive differences add up to a single one, which is positive by closure. Anti-reflexivity follows from uniqueness of differences, since would exhibit as with positive while exhibits it with difference , and only one difference is permitted. Weak trichotomy is the main part; in terms of the cuts it is the set equation , which we prove by induction on . The base case is the proposition just proved, since every element is at least , so is everything. For the step we take an arbitrary , use the hypothesis to place it on one side of , and then place it relative to : an below stays below , an equal to falls below , and for an above the positive difference has a predecessor, which gives .
Proof.
For transitivity, suppose and with . Then by the laws of addition, and by closure; hence .
For anti-reflexivity, would give with , and uniqueness of differences forces , contradicting .
For weak trichotomy, fix and consider the cuts. We show by induction on . For , every element satisfies by the proposition above, so .
Suppose and let . If then by the corollary above, so by transitivity. If there are two cases. If then , so . If then with , and has a predecessor by the theorem on predecessors, say ; then , so and . Induction gives for every , which is weak trichotomy.
The characterisation of strict linear orders now applies.
Nothing lies strictly between and its successor. This looks obvious, but it has to be proved from the definition.
Proposition 6.39 (Nothing between n and its successor).
Let . There is no with .
Discussion.
This is a non-existence claim, so we suppose such an exists and derive a contradiction. The two strict inequalities give two positive differences, and , and we eliminate between them. Since is positive it has a predecessor, so , so the of the second equation appears inside the first. Substituting turns into , so carries the two differences and ; uniqueness forces , and a sum is zero only when both parts are, so , contradicting the choice of as positive.
Proof.
Suppose and . The first gives with , the second gives with . Since it has a predecessor, so for some . Then
So , and uniqueness of differences gives ; hence , contradicting .
Show that the only with are and .
Prove that if and only if , for all .
Let , with multiplication as in the problems of the last chapter.
- If then , and if and only if .
- If then ; and if moreover and , then .
- If then .
- If and , then .
Suppose and in . Show that .
Show that and for every , and that implies for all with .
Let .
- If and , then if and only if .
- If then .
- If then .
State the hypotheses on under which each of
is defined, and prove all three.
- Determine all for which and are both defined, and decide whether the two agree whenever both are.
- Decide whether whenever the left-hand side is defined.
Well-Ordering and Induction Variants
With the order we can prove the form of induction that starts at an arbitrary natural number.
Theorem 6.40 (Induction from an arbitrary starting point).
Let and let be a predicate on . If holds, and if for every , then holds for every .
Discussion.
Ordinary induction starts at , and the hypotheses say nothing below , so we enlarge the set where holds until the fifth Peano condition applies. Let be that set and put , adding everything strictly below the starting point. We may assume , since at ordinary induction already applies, and then settles the base case without appealing to at all. For the step we take and compare with , which trichotomy resolves into three cases: below it lies in the padding, equal to it lies in by the base hypothesis, and above it forces itself to be at or above , so lies in and the given step applies. Induction then gives ; since the two cuts are disjoint and exhaust everything, the added part has nothing at or above , and is what remains.
Proof.
Let and put . It is enough to prove , for then and give , which is the assertion.
We may assume , since is ordinary induction. Then . Let and compare with .
If then . If then by the base hypothesis. If then , since would put strictly between and ; hence , so , and the induction hypothesis gives .
In every case , so the fifth Peano condition gives .
Theorem 6.41 (Well-ordering of the natural numbers).
Every non-empty subset has a smallest element: there is with for every . We write .
Discussion.
A non-empty may be unbounded, so we first cut it down to a bounded piece. Choose any and put , which holds and so is non-empty. A smallest element of is already smallest in , since everything in outside is at least and therefore above it. So we may assume and induct on , taking for the statement that every non-empty subset of has a smallest element. The base case can be checked directly: is , so the only non-empty subset is . For the step, take a non-empty subset of and intersect it with ; if the intersection is empty then nothing between and its successor leaves only , and otherwise the hypothesis supplies a smallest element of the intersection, which by the cutting-down argument is smallest in the whole set.
Proof.
Choose and put ; since we have , so is non-empty. If is smallest in then , while every member of is at least and hence above ; so is smallest in . It therefore suffices to show, by induction on , that every non-empty subset of has a smallest element.
For , the cut is : an cannot be positive, since would put strictly between and its successor. So the only non-empty subset of is , whose smallest element is .
Suppose every non-empty subset of has a smallest element, and let be contained in . If then every element of is at least and below , so and is its smallest element. Otherwise has a smallest element , and the argument of the first paragraph shows is smallest in . Induction completes the proof.
Corollary 6.42 (Method of infinite descent).
No non-empty subset has the property that every admits an with .
Proof.
If such an existed, well-ordering would give it a smallest element , and the hypothesis would supply with , contradicting minimality.
One cannot descend for ever through a non-empty set of natural numbers. The Greeks already used this as a proof technique, and we shall use it when we come to the numbers that are not fractions.
Theorem 6.43 (Strong induction).
Let be a predicate on with true, and suppose that for every the truth of for all implies . Then holds for every .
Discussion.
In ordinary induction the step uses only the previous case; here it may use all earlier cases at once, and we prove this from well-ordering. Instead of building up the set where holds we look at the set where it fails: assume it non-empty and let be its smallest element. The base hypothesis rules out , so has a predecessor . Minimality says holds for every , and since nothing lies strictly between and , those are precisely the , which is what the step needs at . The step therefore yields , that is , and was chosen to make fail.
Proof.
Let and suppose . Well-ordering gives it a smallest element , so fails while holds for every .
Since holds, , so the theorem on predecessors gives for some . Every satisfies , since and nothing lies strictly between; hence holds for every such . The hypothesis then gives , that is , a contradiction. So .
Deduce the fifth Peano condition from strong induction, so that the two induction principles are equivalent.
Show that strong induction can be proved without well-ordering, by applying ordinary induction to the set .
Let .
- Show that cannot hold for every .
- Show that if for every , then there is an with for every .
Let . Show that there is exactly one with .
Division with Remainder
A first use of well-ordering: dividing one natural number by another leaves a quotient and a remainder, both determined by the two numbers.
Theorem 6.44 (Division with remainder).
Let and . Then there is exactly one pair with
Discussion.
An “exactly one” claim asks for existence and uniqueness, and the two need different arguments. For existence we look for the remainder rather than the quotient: the set of numbers of the form that remain in is non-empty, since leaves itself, so well-ordering gives us its least member , and minimality forces : were at least we could subtract one more and get something smaller still. For uniqueness we assume two decompositions and show that a certain multiple of must be . Subtracting gives a multiple of equal to a difference of two remainders, and that difference is below because each remainder is; but a non-zero multiple of is at least , so the multiple is , the quotients agree, and the remainders follow.
Proof.
For existence, let . Taking gives , so is non-empty and well-ordering supplies , with for some .
Suppose . Then for some , so , putting ; and , since is positive. That contradicts minimality, so .
For uniqueness, suppose with , and take without loss. Then for some , and cancelling gives , so . If were positive then and , a contradiction; so , whence and then .
Corollary 6.45 (Remainder classes).
Let . Every has exactly one of the forms , , …, with .
Proof.
The theorem gives exactly one pair with and , and the values available to are precisely .
Taking splits into the even numbers, those of the form , and the odd ones, those of the form ; the corollary says every natural number is one or the other and none is both.
Let with positive. Show that divides , in the sense that for some , exactly when the remainder of the theorem is .
Show that divisibility orders as a partial order in the sense of Definition 6.16 , and find the minimum and the maximum, if they exist, of in that order.
Descent in Action
Here is an application of infinite descent.
Proposition 6.46 (Odd squares are odd).
Let . If is even then is even.
Discussion.
We prove the contrapositive, which is the easier direction to compute with: an odd is by the remainder classes, and squaring it and collecting terms exhibits the result as twice something plus one. Only the laws of addition and multiplication are needed; the remainder classes turn “not even” into the usable form .
Proof.
Suppose is odd, so for some by the remainder classes. Then
which is odd. So an even forces to be even.
Theorem 6.47 (Two is not a ratio of squares).
There are no with .
Discussion.
We argue by contradiction, using infinite descent, so we build a non-empty set in which every member has a smaller member. Suppose some pair works and let be the set of all admitting a partner ; the supposition puts something in . The descent comes from using parity twice. From the square is even, so is even by the proposition above; writing and substituting makes even, hence even too, say . Cancelling a factor of four leaves , which puts in as well, and because halving a positive number decreases it. Infinite descent forbids this.
In terms of fractions, which we have not built yet, this says that no fraction squares to two.
Proof.
Suppose such a pair exists and let , which is then non-empty.
Let with partner . Then is even, so by the proposition above. Substituting gives , so ; hence is even and for some . Substituting again gives , so , putting . Since with positive, we have .
So every member of has a smaller member, which infinite descent forbids. Hence no such pair exists.
Show that there are no with , and decide whether the same argument rules out .
Expansions in a Base
Writing a number in base is repeated division with remainder, and the digits are the remainders.
Theorem 6.48 (Expansion in a base).
Let with . For every there are uniquely determined and with and for each , such that
Discussion.
The digits come from dividing repeatedly: set , divide by to leave the lowest digit and a quotient , divide that to leave , and so on. Two things must be checked. It stops because makes each non-terminal quotient strictly smaller than the number it came from, and a scheme that never halted would descend for ever through , which descent forbids. The digits add back to because each equation expresses one quotient in terms of the next, so substituting upwards leaves the displayed sum. Uniqueness runs the same divisions in reverse: division with remainder determines and from , then and from , and so on, fixing the leading digit and the final index along with the rest.
Proof.
Put and apply division with remainder repeatedly:
Each line is division with remainder applied to and . Since , a non-zero quotient satisfies , so the scheme cannot run for ever without contradicting infinite descent; it therefore halts at some with .
Substituting each line into the one above it gives . Uniqueness of the quotient and remainder at each step gives uniqueness of the list of digits, and of .
We write , and call the cases and the binary and decimal expansions. The value can be recovered by a recursion which never computes a power separately:
This is Horner’s scheme for base . It uses one multiplication by at each stage, in all, where computing every power first and then forming every term uses up to twice as many.
Write in base , and write in base .
Let and let be as in the theorem. Show that .
The Maximum Principle
Well-ordering says every non-empty subset of has a minimum. The dual statement is false as it stands, since itself has no maximum, but it becomes true once an upper bound is present.
Theorem 6.49 (Maximum principle).
Let be non-empty with an upper bound in . Then has a maximum.
Discussion.
We cannot induct on , which is an arbitrary set, so we induct on the bound instead: let be the set of those such that every non-empty subset bounded above by has a maximum, and aim at ; once that is known, any upper bound of the given lies in and gives a maximum. The base case can be checked directly, since a set bounded above by can only be , every element being at least . For the step we take a non-empty bounded above by and split on whether belongs to : if it does, it is a bound lying in the set and the previous proposition finishes at once; if it does not, then is itself an upper bound, because an element strictly above and at or below but different from it would sit strictly between and its successor, which nothing does.
Proof.
Let be the set of such that every non-empty with upper bound has a maximum.
For : let be non-empty with upper bound , and take . Then , while , so by antisymmetry. Hence , and is a bound lying in , so it is the maximum.
Suppose and let be non-empty with upper bound . If then is an upper bound lying in , hence the maximum. If , we claim bounds : an element with satisfies and , so , which nothing does. So is an upper bound of , and supplies a maximum. Hence .
By induction . Given non-empty with upper bound , we have , so has a maximum.
A partially ordered set in which every non-empty subset has a minimum is called well-ordered. By the theorem above is well-ordered, and so is , whose non-empty subsets are non-empty subsets of . has two further order properties: every element beyond the minimum has an immediate predecessor, and there is no greatest element. Together with well-ordering these determine the order completely.
Theorem 6.50 (Characterisation of the natural numbers).
Let be a non-empty well-ordered set in which every element other than has an immediate predecessor, meaning an element with nothing of strictly between, and which has no greatest element. Then there is an order-preserving bijection from to .
Discussion.
The conclusion asks for the order of inside , so the plan is to build a successor map on from the three hypotheses and then check that it reaches everything. In the successor of is the least element above , and that phrase makes sense in : the absence of a greatest element keeps the set of elements above non-empty, and well-ordering gives it a minimum, which we call . The predecessor hypothesis makes behave like a successor map, since nothing is reached from below except through an immediate predecessor, so is never a value of and two elements cannot share one. With in hand the recursion theorem builds the candidate: start at and keep applying . As , the values climb, which already gives order-preservation and injectivity; the main work is surjectivity, where we take the least element never reached, which cannot exist because its immediate predecessor is reached and carries that to it.
Proof.
Write and for put , which exists because has no greatest element and is well-ordered. By construction and nothing of lies strictly between and .
An element has exactly one immediate predecessor: two of them, say , would put strictly between and . Hence is injective, since makes and both immediate predecessors of ; and is not a value of , since .
The recursion theorem, applied with and , gives exactly one with and . Since for every , induction gives whenever ; in particular is injective.
For surjectivity, let be the range of . Then , and is closed under , since . Suppose is non-empty and let be its least element. Since we have , so has an immediate predecessor ; by minimality of we have , and because nothing lies strictly between. Closure of under gives , a contradiction. Hence is a bijection.
Remark.
The proof never carries out an induction inside : surjectivity uses well-ordering through a least counterexample, and itself comes from the recursion theorem on . One may therefore take well-ordering, the predecessor property and the absence of a greatest element as axioms in place of Peano’s; the theorem says the two systems describe the same ordered set.
Let be non-empty. Prove that has a minimum by applying the maximum principle to the set of lower bounds of , rather than by appealing to well-ordering.
State and prove the maximum principle for non-empty subsets of bounded above in , starting the induction at .
Let be an ordered set in which every two-element subset has a minimum. Show that the order is total, and deduce that every well-ordered set is totally ordered.
Let be such that for every there is an with . Prove that there is exactly one bijection with whenever .
Order by declaring when , or when and . Show that this is a strict linear order in which every non-empty subset has a least element.
Theorem 6.50 asks three things of . Exhibit a well-ordered set with no greatest element in which some element other than the minimum has no immediate predecessor, and a well-ordered set in which every element other than the minimum has an immediate predecessor but a greatest element exists. For the first, name the element that has no immediate predecessor.
- Exhibit a totally ordered set with no greatest element in which every element has an immediate predecessor, and which is not well-ordered.
- Show that there is no bijection with whenever , and say where the proof of Theorem 6.50 uses the hypothesis that fails.
- Order as in Problem 6.35 . Show that the result is totally ordered but not well-ordered.
Sequences
A list is a function whose inputs are positions. The cuts defined for the natural numbers give us the positions, so nothing new is needed.
Let be a set. A finite sequence in of length is a function from to , written or , in the notation already used for tuples; the unique sequence of length is the empty function, written . An infinite sequence in is a function from to . We write
for the set of all finite sequences in , using the Cartesian power of the last chapter but one.
That is a set takes a moment. Each consists of functions from to , hence of subsets of , so all of them lie inside ; comprehension collects them and the union axiom pools them.
Remark.
Some texts say instead that a finite sequence is a function whose domain is a natural number. That is the same definition read through the construction of the last chapter, where was built as the set holding exactly its predecessors, so that . We use the cut, which says the same thing without leaning on which sets the numerals happen to be.
Restriction gives the initial pieces of a sequence: for defined on and , the restriction is the finite sequence of length , recording everything before position and nothing else.
The General Recursion Theorem
The recursion theorem of the last chapter lets the next value depend on the previous one, and its parametrised form lets it depend on the index as well. Neither is enough when the next value depends on all the earlier ones at once. With sequences we can state such a rule, and with the order we can prove that it defines a function.
Theorem 6.52 (General recursion).
Let be a set and let . Then there is exactly one with
Discussion.
The rule wants the whole history at each step, so we recurse on histories rather than on values: instead of building directly we build the sequence of its initial pieces. Let send a pair to extended by the value at position , whenever has length , and to the empty sequence otherwise; that second clause is bookkeeping only, since the case never arises. Parametrised recursion then gives a map on with the empty sequence and , and an induction shows has length exactly , so the bookkeeping clause is never reached. Each extends its predecessors, so their union is a single function on whose restriction to is , and reading the construction back gives the required identity. Uniqueness uses strong induction: two solutions agreeing everywhere below have the same restriction to , so returns the same value at , and ordinary induction would not deliver that hypothesis.
Proof.
Define by
By parametrised recursion there is a unique with and .
We claim has length . This holds at . If has length , then , whose domain is ; and , since holds exactly when or , nothing lying strictly between and . So has length , and induction gives the claim.
Each is therefore a function extending all the earlier ones, so their union is a function on with for every . Then
which is the required identity.
For uniqueness, let also satisfy the identity, and suppose for every . Then , so . Strong induction gives .
Show that the recursion theorem of the last chapter is a special case of this one: given and , exhibit a whose solution is the map with and .
Let be a set and . Show that the finite sequences built in the proof satisfy whenever , and explain where that is used.
General Associativity
We can now prove something used without proof earlier. Addition was defined for two arguments and proved associative and commutative for two and three; the notation assumes more, namely that the brackets and the order may be chosen freely. With finite sequences and induction in hand we can say what that means and prove it.
Fix a left-associated reading once and for all: for a finite sequence of length in a Peano system with addition, define
So of the sequence is , brackets to the left. A full bracketing of is either the single term, when , or a sum in which is a full bracketing of an initial piece and is a full bracketing of the rest.
Theorem 6.53 (General associativity and neighbour swaps).
Let be a finite sequence of length in a Peano system with addition.
- Every full bracketing of equals .
- If is obtained from by exchanging two neighbouring entries, then .
Discussion.
The first part is an induction on , but a bracketing may split the sum anywhere, so the step needs one auxiliary fact: the left-associated sum of the whole is the left-associated sum of the first entries added to that of the rest. That splitting identity is itself a short induction on the length of the second block, using nothing but binary associativity, and with it the step applies the hypothesis to the two halves of the bracketing and adds the results.
Once every bracketing is identified with , the second part may ignore brackets altogether. Exchanging neighbours rearranges a two-term middle and nothing else, so binary commutativity sorts that middle and the splitting identity puts the rest of the list back around it.
Proof.
We first record the splitting identity: for ,
Fix and induct on the length of the second block. If this is the defining clause of . If it holds at , then appending one more entry gives
and associativity of addition regroups this as , which is the identity at .
For the first part, induct on . The case is immediate. Let be a full bracketing of , so where brackets the first entries and the rest. The inductive hypothesis gives and , so by the splitting identity.
For the second part, let exchange the entries at positions and . The two-term identity is commutativity. If the exchanged pair is the whole sequence we are done; otherwise two applications of the splitting identity write as a sum in which that pair appears as a single middle block, and the same decomposition of differs only in that block, which commutativity identifies with it.
Brackets therefore no longer matter, and neighbouring summands may be exchanged at will. Any rearrangement of a finite list can be reached by a string of neighbour exchanges, moving each entry past its neighbours until it sits where it should, so the value of a finite sum depends on neither the bracketing nor the order of its terms.
Carry out the same argument for multiplication: define the left-associated product by the clauses and when has length , and prove both parts of the theorem for it. Which laws replace associativity and commutativity of addition at each step?
Show that any rearrangement of a finite sequence is a string of neighbour exchanges, so that the last sentence above is a theorem rather than an appeal to intuition. (Harder.)
Zorn’s Lemma
Finally, two statements equivalent to the axiom of choice, and the reason some mathematicians do not accept it.
Definition 6.54 (Chains and inductively ordered sets).
Let be a partially ordered set. A subset is a chain if the order induces on is a total order, that is, if any two elements of are comparable. The set is inductively ordered if every chain in has an upper bound in .
Remark.
An inductively ordered set is never empty. The empty subset is a chain, vacuously, so it too must have an upper bound, and an upper bound is an element of .
Every inductively ordered set has at least one maximal element.
Discussion.
We state this without proof. It is not a theorem of the axioms we have listed: on the basis of the rest, Zorn’s lemma is equivalent to the axiom of choice, so proving it would amount to deriving one from the other, and the derivation is long enough to belong to a course in set theory rather than here. Note the form of the statement. The hypothesis is about chains, which are the totally ordered pieces of , and the conclusion is about a maximal element, which need not be a maximum: nothing says the element found is comparable with everything, only that nothing strictly exceeds it. In a partial order a maximal element need not be a maximum, which is why the conclusion is stated this way.
Remark.
The result is due to Kuratowski, though it carries Zorn’s name; Zorn proved the equivalence with choice and was the first to put the statement to work on algebraic questions.
Theorem 6.56 (Well-ordering theorem).
Every non-empty set can be ordered so that every non-empty subset has a least element.
Discussion.
Again we state without proof, for the same reason: on the basis of the other axioms the well-ordering theorem, Zorn’s lemma and the axiom of choice are all equivalent to one another. Of the three it is the hardest to believe. Well-ordering of was a theorem we proved, resting on the successor structure; here the claim is that any set whatever admits such an order, however little structure it carries and however unlike the natural numbers it looks.
Remark (Informal).
Assuming you know the real numbers, they are not well-ordered by their usual order: the set of those greater than has no least element, since any candidate is beaten by something smaller still above . The well-ordering theorem nevertheless asserts that some other order on them is a well-order. No such order has ever been exhibited, and none can be described explicitly; the theorem asserts that one exists and offers no way to find it.
That gap between existence and construction is what leads some mathematicians to reject the axiom of choice. Our position is to accept it, and to say plainly when we use it.
Show that a maximal element need not be a maximum, by exhibiting a partially ordered set with two maximal elements. Show also that in a total order the two notions coincide.
Let be a set and consider ordered by inclusion. Show that it is inductively ordered when is non-empty, and identify its maximal elements.
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.
Keep and write for the relation above. In each line, the smallest relation on containing and having the stated property is:
Transitive.
Symmetric.
Reflexive. Its number of pairs is:
An equivalence relation.
Each line below is a relation on . Decide which are equivalence relations and which are strict linear orders.
.
.
.
and leave the same remainder on division by .
Let be an equivalence relation on .
Suppose has exactly three ordered pairs. Then is:
Can have exactly four ordered pairs?
The largest number of ordered pairs can have is:
For that , the induced partition is:
On take , which is an equivalence relation.
The class is:
The quotient is:
Which of these are equivalence relations?
On the set of human beings, when and weigh within one pound of each other.
On , when divides .
On , when is even.
On , when . This is an equivalence relation, and its blocks are:
On the set of solid-colour cars, when and have the same colour. This is:
The order of Definition 6.32 and the cuts of Definition 6.37 .
The cut is:
The number of elements of is:
For , the set is:
The difference :
For each subset of below, the minimum and the maximum, in the sense of Definition 6.20 , are:
.
The set of even numbers.
The set of odd numbers.
.
.
The set of multiples of .
Keep and from the last exercise, with all bounds taken in .
The lower bounds of are:
Its upper bounds are:
The lower bounds of are:
And its upper bounds are:
Let , ordered by divisibility, so that means that divides .
The minimal elements of are:
The maximal elements are:
As for a minimum and a maximum:
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 ⟨ ⟩.
The last sheet gave the checker a Peano system to compute in. This chapter needs two more things of it, and only one of them is new. A relation is a set of ordered pairs, and pairs, products and sets are all already there; the order on is not, and arrives as notation below.
Relations
A relation on is a subset of , so is typed as the membership it abbreviates, (x, y) ∈ R. The three properties of Definition 6.2 are not names the checker knows; they are written out as the statements they are, so symmetry of enters a problem as the hypothesis
hs : ∀ a b : Obj, (a, b) ∈ R → (b, a) ∈ Rand is used by applying it to two objects and a membership, left to right: hs x y h.
One piece of notation is new. The separation axiom carves a subset out of a set by a criterion, and it is written {x ∈ A | p x}, with the membership criterion the axiom gives: y ∈ {x ∈ A | p x} is y ∈ A ∧ p y, in the way that x ∈ A ∩ B was a conjunction on an earlier sheet. So ⟨_, _⟩ builds a membership and .left and .right take one apart. This is what lets an equivalence class be written down: of Definition 6.26 is {s ∈ S | (s, a) ∈ R}.
Example.
The universal relation on is reflexive. Membership in a product is a conjunction, and here both halves are the same hypothesis.
Example.
Reflexivity puts in its own class. The two halves of the criterion are the two things the class asks of .
The empty relation is symmetric and transitive.
And the universal relation is transitive.
Symmetry and transitivity give reflexivity, but only at the elements the relation already reaches.
The first half of Problem 6.3 , with written out.
Symmetry survives intersection.
Proposition 6.22 , with the order written as a relation and antisymmetry as a hypothesis.
The step of Proposition 6.28 : classes that meet come from related elements.
And the step , which is an equality of sets.
The order on the natural numbers
ℕ is the carrier of the last sheet, and the order is written ≤ and <, typed \le and <. Neither is a name in the library: they are the definitions of Definition 6.32 and Proposition 6.35 outright, so
m ≤ n is ∃ b : ℕ, n = m + b
m < n is ∃ b : ℕ, b ≠ 0 ∧ n = m + band every tactic for an existential acts on them unchanged: use supplies the difference, obtain ⟨b, hb, he⟩ takes a strict inequality apart into a positive and the equation it satisfies, and obtain ⟨b, he⟩ does the same for a non-strict one. The reverse orders > and ≥ are these two read backwards, as Definition 6.14 has them. Numerals are still spelled as the last sheet spelled them, so is succ 0.
Example.
The difference that makes an element reach itself is , and the first clause of addition checks it.
Example.
Corollary 6.33 . Once the difference is named, one half is the hypothesis and the other holds of itself.
The second half of Proposition 6.36 .
Every element is below its successor.
A positive difference is a difference.
Proposition 6.8 , proved here from uniqueness of differences rather than from trichotomy.
Transitivity: two positive differences compose into one.
Antisymmetry, which is the second law of Proposition 6.11 .
No comparison points both ways.
The first part of Problem 6.16 .
And the second, with the factor on the left so that distributivity applies as it stands.
Problem 6.15 . Both directions move a successor between the two sides of a sum.
Proposition 6.39 . (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 |
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 |
Lesson 7
Infinite Sets
Taught
Finite Sets
To count a herd is to pair its animals off against and so on, and to report the number we stopped at. Nothing in that procedure asks what the counting numbers are; it asks for a bijection between the herd and an opening stretch of them. Both are now built, so we can count, and the notion of the same size that counting rests on still makes sense for sets far too large to count.
Comparing Sets by Functions
Definition 7.1 (Equinumerous sets).
Sets and are equinumerous, written , if there is a bijection . We also say that and have the same size.
The definition asks for one bijection and says nothing about how many there are; two sets of three elements are matched up in six different ways, and the definition is satisfied by any of them. It also does not mention counting, so it still makes sense for sets we cannot count.
Proposition 7.2 (Equinumerosity is reflexive, symmetric and transitive).
Let , and be sets.
- .
- If then .
- If and then .
Discussion.
Each part is an existence claim about bijections, so each is proved by producing one, and in every case the bijection we need has already been built. For the first, the identity map on is its own inverse, and a map with an inverse is a bijection by the theorem on invertibility. The second and third are conditionals, so we start from the bijections the hypothesis gives: from one bijection, the theorem that the inverse is a bijection; from two, the theorem that bijections compose. No part uses anything about the elements of the sets.
Proof.
For the first, , so is invertible and hence a bijection from to .
For the second, let be a bijection. Its inverse is a bijection, so .
For the third, let and be bijections. Then is a bijection, so .
Remark.
Those are the three properties of an equivalence relation, and yet is not one, because it is not a relation at all in our sense: a relation on is a subset of , and there is no set of all sets for to be. Fix a set , however, and restricted to is an honest equivalence relation on an honest set, so it partitions into classes of subsets of the same size. That is how the notion is used in practice, and the general statement is a convenience of language rather than a claim about a set of pairs.
Write for the cut , so that . If , and are distinct then , witnessed by , , . Any other listing of the three letters gives another bijection, and the definition does not prefer one.
Show that for all sets and , and that .
Show that implies . Which of the theorems on images and preimages does your bijection rest on?
Counting
The cuts are the sets we count against: collects the numbers below . First we record how they grow, which every induction below uses.
Proposition 7.4 (The cuts grow by one point).
, and for every ,
Discussion.
There are three assertions and each is a statement about which elements a cut holds, so each unfolds to a comparison with . That is empty is a negative claim, ruled out by the proposition that every natural number is at least zero together with trichotomy, which forbids once is known. The equation is an equality of sets, so it splits into two inclusions, and both come from asking where sits relative to : to the left, leaves the alternatives and once the proposition that nothing lies strictly between and has removed the third; to the right, or gives because and is transitive. The last assertion is anti-reflexivity read off the definition of the cut.
Proof.
An satisfies , so would violate trichotomy; hence .
Let . Trichotomy gives , or , and the last would place strictly between and , which nothing does. So . Conversely by the corollary that adding a positive element moves you up, so gives , and gives by transitivity. Hence .
Finally , so .
Definition 7.5 (Finite and infinite sets).
A set is finite if for some , and infinite otherwise.
So is finite, since , and each is finite by way of its identity map. The definition offers some , and to speak of the number of elements we must know that no two cuts are matched by a bijection. The next few results prove this. The main tool is the simplest rearrangement: a map exchanging two points and leaving the rest alone.
Definition 7.6 (Transposition).
Let be a set and let . The transposition is the function given by
When the three clauses agree and is the identity map on .
Proposition 7.7 (A transposition is its own inverse).
Let be a set and let . Then , and is a bijection.
Discussion.
Two assertions, the second following from the first. The first is an equality of functions, so by equality of functions we compare values at an arbitrary point of , and the definition splits the points into three cases, each settled by reading the definition twice. The second is then the theorem on invertibility, which makes a map with a two-sided inverse a bijection; the first assertion offers itself as that inverse, so nothing further need be built.
Proof.
Write and let . If then ; if then ; and otherwise . So , and is invertible, hence a bijection from to .
Proposition 7.8 (Bijections remove points).
Let be a bijection and let . Then .
Discussion.
We need a bijection between the two smaller sets, and the only map we have is , so we restrict it and check the two halves of bijectivity. Injectivity is inherited, since a restriction of an injective map is injective. For the values, injectivity is again what we use: a point other than cannot be sent to , so the restriction does land in ; and surjectivity of supplies, for each in that set, a preimage, which cannot be because .
Proof.
Let be the restriction of to . If then by injectivity, so takes its values in , and is injective because is.
Let . By surjectivity for some , and since . So , and is a bijection onto .
Proposition 7.9 (Removing a point from a cut).
Let and let . Then .
Discussion.
The previous proposition removes a point and its image under a bijection, so the plan is to build a bijection of with itself that carries to and then remove , where the result is the cut by the proposition on how cuts grow. The transposition of and does exactly that, and it is a bijection by the proposition just proved, so nothing needs checking. The case is the growth proposition on its own, the transposition there being the identity.
Proof.
If then by the proposition on how cuts grow, and a set is equinumerous with itself.
Suppose and let be the transposition of and on , which is a bijection by the proposition above. Since , the proposition on removing points gives
Theorem 7.10 (No cut injects into a shorter one).
For every there is no injection .
Discussion.
The claim is a universally quantified non-existence statement, so we induct on and argue each case by contradiction. At the target is empty while the source is not, and a function must name a value at every point of its domain, so there is no such function. For the step we assume no injection and suppose one is given from to . The extra point of the source is , and by injectivity no other point is sent to its value , so removing both leaves an injection from into . The previous proposition says that set is a copy of , and composing with a bijection onto gives an injection the inductive hypothesis forbids.
Proof.
We induct on . For the cut is and is empty, so a function would have to give a value . There is none.
Suppose there is no injection , and let be injective. Since , the value is defined. If then , so by injectivity; hence the restriction of to is an injection taking its values in . Composing it with a bijection from onto , which the previous proposition supplies, yields an injection , contrary to the hypothesis. So no such exists, and induction completes the proof.
Corollary 7.11 (Cuts of different length are not equinumerous).
If then .
Proof.
Suppose . Then by transitivity, and , so . A bijection restricted to is then an injection , which the theorem forbids. The same argument with and exchanged rules out , so trichotomy leaves .
Definition 7.12 (Cardinality of a finite set).
Let be finite. The unique with is the cardinality of , written , and we say has elements.
Uniqueness is the corollary, and without it the notation would not be well defined. Some authors write for the same number.
Corollary 7.13 (Cardinality classifies finite sets).
Let and be finite. Then if and only if .
Proof.
Write and , so and . If then by symmetry and transitivity, so by the previous corollary. Conversely if then .
and . A finite set has cardinality exactly when it is empty, since a bijection onto from a non-empty set would have to name an element of . If then and , since and .
Proposition 7.15 (Adjoining a point).
Let be finite and let . Then is finite and .
Discussion.
Both assertions come from one bijection, which we build and check. We hold a bijection from onto , and the set to be counted has exactly one extra point, while the cut has exactly one point more than , namely itself. So we extend by sending to . That the extension is a function uses , which stops the two clauses from disagreeing anywhere; that it is injective uses , which stops the new value from repeating an old one; and that it is surjective is the growth proposition, which says holds nothing beyond and .
Proof.
Put and let be a bijection. Define by for and . Since , every point of the domain falls under exactly one clause, so is a function, and its values lie in .
For injectivity, two points of are separated by , and a point of is separated from because while . For surjectivity, an element of is either , which is , or an element of , which is for some by surjectivity of . So .
Corollary 7.16 (Removing a point).
Let be finite and non-empty and let . Then is finite and .
Proof.
Let be a bijection, where . Since is non-empty, , so the theorem on predecessors gives for some . The proposition on removing points from bijections gives , and the proposition on removing a point from a cut gives . So is finite with cardinality , and .
Subsets and Images
Theorem 7.17 (Subsets of a finite set).
Let be finite and let . Then is finite and . If moreover then .
Discussion.
The first sentence quantifies over all subsets of all finite sets, so we induct on the cardinality, taking for the predicate at the statement that every subset of every set with elements is finite with cardinality at most . At the ambient set is empty and so is the subset. For the step we peel off a point of the ambient set, leaving a set the hypothesis governs, and split on whether belongs to the subset: if not, the subset is already inside the smaller set; if so, we apply the hypothesis to the subset with removed and put back, which raises both cardinalities by one successor.
The second sentence uses properness. A point of outside can be adjoined to without leaving , so the first sentence applies to and yields ; and forces , since and is positive.
Proof.
We first record two small facts about successors, both read off the clauses for addition. If then for some , so by addition from the left, and hence . If then , and is positive, so .
For the first assertion we induct on , proving that every subset of every set of cardinality is finite with cardinality at most . If then the ambient set is empty, so and .
Suppose the claim holds at , let and let . Since , the set is non-empty; choose and put , which has cardinality by the corollary on removing a point. If then , so the hypothesis makes finite with . If then , so is finite with cardinality ; adjoining makes finite with .
For the second assertion, let and choose . Then , so the first assertion gives , and therefore .
Corollary 7.18 (No finite set is equinumerous with a proper subset).
Let be finite and . Then .
Proof.
The theorem gives , so by anti-reflexivity, and finite sets of different cardinality are not equinumerous.
Proposition 7.19 (Images of a finite set).
Let be finite and let be a function. Then the image is finite with , and if and only if is injective.
Discussion.
The inequality is proved by induction on : remove a point from , apply the hypothesis to what remains, and observe that the image gains at most the single value , so it grows by at most one successor.
The biconditional needs no second induction, because each direction is already available. If is injective it is a bijection onto its range, so the two cardinalities agree. If is not injective, two distinct points share a value, so deleting one of them changes nothing about the image; the inequality applied to the smaller set then gives a strict drop, since a proper subset of a finite set is strictly smaller. Those two together are the biconditional, the second read contrapositively.
Proof.
For the inequality we induct on . If then and .
Suppose the claim holds for sets of cardinality and let . Choose and put , of cardinality . Since we have , and is finite with by hypothesis. If then and . Otherwise adjoining the point gives .
If is injective then is a bijection from onto , so . If is not injective, choose in with . Every value of is then already taken on , since and , so and
the second inequality because is a proper subset. So equality holds exactly when is injective.
The Pigeonhole Principle
Theorem 7.20 (Injections, surjections and size).
Let and be finite.
- If there is an injection then .
- If there is a surjection then .
Discussion.
Both parts turn the given function into a statement about the image, and then apply the two results just proved. An injection is a bijection onto its range, so and have the same cardinality, and is a subset of , which the theorem on subsets bounds by . A surjection has range all of , so is the cardinality of an image, which the proposition on images bounds by . Notice that no choice of preimages is made anywhere, so neither part appeals to the axiom of choice.
Proof.
For the first, is a bijection from onto , so ; and , so by the theorem on subsets.
For the second, surjectivity gives , so by the proposition on images.
Corollary 7.21 (Pigeonhole principle).
Let and be finite with . Then no function is injective, and no function is surjective.
Proof.
An injection would give , and a surjection would give as well; either contradicts by trichotomy.
Among thirteen people, two were born in the same month: the map sending each person to the month of their birth goes from a set of thirteen elements to one of twelve, so it cannot be injective, and two people share a value. The principle says the pair exists but gives no way to find it.
Theorem 7.23 (Injective, surjective and bijective agree on a finite set).
Let be finite and let . Then is injective if and only if it is surjective, and either condition makes a bijection.
Discussion.
The statement is a biconditional between two conditions on the same map, so we prove each direction, and the last clause follows: a bijection is by definition an injection that is also a surjection, so once the two conditions are equivalent, each one gives both.
Going forwards, injectivity makes the image as large as the whole, and a subset of a finite set with the full cardinality cannot be proper, so the image is everything. Going backwards we argue by contradiction, because failure of injectivity is what we can compute with: a repeated value lets us delete a point without shrinking the image, so the image of a proper subset would have to be all of , and the proposition on images bounds it by something strictly smaller.
Proof.
Suppose is injective. Then by the proposition on images, and , so by the theorem on subsets, since a proper subset would have strictly smaller cardinality. Hence is surjective.
Suppose is surjective and not injective, so for some . Then , and surjectivity makes this all of , so
which anti-reflexivity forbids. So is injective.
In either case is both injective and surjective, hence a bijection.
Remark.
Finiteness is needed. The successor map is injective by the third Peano condition and is not surjective, since is not a successor. So on the two conditions come apart, and the theorem cannot be extended by weakening its hypothesis.
Let and be finite with and let be injective. Show that is a bijection.
Let be finite and let satisfy . Show that if is injective, and describe what can be otherwise.
Sums and Products
Counting a union means laying one cut after another, so we first say how a cut breaks into an opening piece and a shifted one.
Proposition 7.24 (Splitting a cut).
Let and put . Then
and is a bijection from onto .
Discussion.
Three assertions, each about the position of a number relative to . The equality is a set equality, hence two inclusions. From left to right, trichotomy puts either below , which is the first part, or at or above it, in which case for a difference , and the difference is below because subtracting from both sides of leaves . From right to left, both parts are checked against directly, using that adding a positive element moves you up. Disjointness is trichotomy once more, since the members of are at least and the members of are strictly below it. The last assertion is uniqueness of differences, which says can happen only for ; surjectivity holds because was defined as the set of such values.
Proof.
Let . If then . Otherwise , so for some by the description of the associated order. From we get for some positive , by the laws of addition, so by uniqueness of differences and hence . Thus .
Conversely, , so gives by mixed transitivity. And if then with positive, so and .
If then and , which trichotomy forbids, so the intersection is empty.
Finally, is injective by uniqueness of differences and surjective onto by the definition of .
Theorem 7.25 (Cardinality of a disjoint union).
Let and be finite and disjoint. Then is finite and
Discussion.
We must exhibit a bijection from onto the cut , and the splitting proposition cuts that target into the two pieces we need. So we define the map in two clauses, counting the points of by their own bijection and the points of by theirs, shifted up by so as to land in the second piece. Disjointness of and means each point falls under exactly one clause, so we have a function. Injectivity then has three cases, two inside a piece, which the two bijections handle, and one across the pieces, which the disjointness of the split handles. Surjectivity is the other half of the split.
Proof.
Put and , and let and be bijections. Define
Since , each point of the domain falls under exactly one clause, so is a function, and its values lie in by the splitting proposition.
For injectivity, two points of are separated by ; two points of are separated by together with the injectivity of ; and a point of cannot collide with a point of , since their values lie in the two disjoint pieces of the split. For surjectivity, an element of lies either in , hence is for some , or is with , hence is for some .
So , which is the assertion.
Corollary 7.26 (Cardinality of a union).
Let and be finite. Then is finite and
Proof.
The sets and are subsets of , hence finite. Now with the two parts disjoint, so ; and with the two parts disjoint, so . Adding to the first equation and substituting the second gives
by the laws of addition.
Remark.
The familiar form of that identity subtracts the overlap, and we have written it with everything on the right instead. Subtraction is available to us only when the answer stays in , which it does here, but stating the law as an equation between sums spares us from checking that each time.
Let , and be finite. Show that
Theorem 7.27 (Cardinality of a product).
Let and be finite. Then is finite and , with multiplication as the problems of the natural-numbers chapter defined it.
Discussion.
Multiplication was defined by recursion on its second argument, with the clauses and , so we induct on following them. At the set is empty and so is the product, since a pair needs a second coordinate. For the step we split into a smaller set and a single extra point , which splits into two disjoint pieces, one governed by the inductive hypothesis and one a copy of . The theorem on disjoint unions adds the two cardinalities, and the resulting sum is the right-hand side of the second clause of the multiplication recursion.
Proof.
We induct on . If then , so and .
Suppose the claim holds for every of cardinality , and let . Choose and put , of cardinality . A pair with has either or , and not both, so
using equality of ordered pairs to read off the second coordinate. The map is a bijection from onto , again by equality of ordered pairs, so that piece has cardinality ; and has cardinality by hypothesis. The theorem on disjoint unions gives
the last step being the second clause of the definition of multiplication.
Show that a union of finitely many finite sets is finite. State the claim carefully first: it is an assertion about an indexed family whose index set is a cut.
Let be finite with . Show that , with powers as the problems of the natural-numbers chapter defined them.
Let and be finite. Show that the Cartesian power , the set of functions from to , is finite with .
Extrema of Finite Sets
Proposition 7.28 (Finite subsets of an ordered set have extrema).
Let be a totally ordered set and let be finite and non-empty. Then has a minimum and a maximum.
Discussion.
The hypothesis is about an arbitrary finite non-empty set, so the induction runs on the cardinality and starts at rather than , which is allowed by induction from an arbitrary starting point. A set of cardinality has a single element, which is both extrema by reflexivity of the order. For the step we remove a point , apply the hypothesis to what remains, which is still non-empty, and then compare with the maximum found there: the two are comparable because the order is total, and whichever of the two is the larger is the maximum of the whole. Minima are the same argument with the inequalities reversed, so we write only one of them out.
Proof.
We induct on , beginning at . Then , so for a single , and makes it both the minimum and the maximum.
Suppose every subset of cardinality has both extrema, and let . Choose and put , which has cardinality and so is non-empty. Let be its maximum. Since is totally ordered, and are comparable. If then is an upper bound of lying in , hence its maximum; if then is such a bound, hence the maximum. The argument for the minimum reverses the inequalities.
Corollary 7.29 (The natural numbers are infinite).
and are infinite.
Proof.
The order on is strict and linear, so the associated is a total order. Were finite, it would be non-empty and so would have a maximum ; but and , contradicting that is an upper bound. The same argument applies to , whose element is positive because it is a successor.
Show that a set with an infinite subset is infinite, and that the image of a finite set under any function is finite.
Comparing Sets
For an infinite set there is no counting it, so we cannot compare numbers. Injections and bijections still make sense, though, and for finite sets the next theorem matches each inequality with a condition on functions.
Comparing Finite Sets
Theorem 7.30 (Comparing finite sets).
Let and be finite sets. Then
- if and only if there is an injection ;
- if and only if ;
- if and only if there is an injection but no bijection .
Discussion.
Write and and fix bijections and ; every part is then a matter of conjugating a map between the cuts into a map between the sets, or the other way about.
For the first part, one direction is already the theorem on injections and size. The other builds the injection: gives , whose inclusion map is injective, and is then an injection , being a composite of injections. The second part is the corollary that cardinality classifies finite sets, read in both directions.
The third is the first two put together. If then the first part supplies an injection, and a bijection would force by the second, which trichotomy forbids. Conversely an injection gives and the absence of a bijection gives , and those two are what abbreviates.
Proof.
Write and , and fix bijections and .
For the first part, suppose . Then , since gives , and the inclusion is injective. So is an injection. Conversely an injection gives by the theorem on injections and size.
The second part is the corollary that cardinality classifies finite sets.
For the third, let . The first part gives an injection , and a bijection would give by the second part, contradicting trichotomy. Conversely, an injection gives by the first part and the absence of a bijection gives by the second, so .
The three right-hand sides make sense whether or not the sets are finite, so they may be taken as definitions in general. By the theorem, the new definitions agree with the old ones for finite sets.
Definition 7.31 (Comparing sizes).
Let and be sets, finite or not. We write
- if there is an injection ;
- if ;
- if there is an injection but no bijection .
For finite sets these agree with the numerical readings, by the theorem. The symbol still names a natural number only when is finite; in general the three displays above are single assertions about functions, and it is the assertion, not the symbol standing alone, that has been defined. What may be taken to name in general is settled at the end of the chapter.
Read informally, says that is roomy enough to hold an injective copy of and still has something left over, in the strong sense that every injection misses something.
Proposition 7.32 (Reflexivity and transitivity).
For all sets , , :
- ;
- if and then .
Discussion.
Both parts unfold to claims about injections, and both follow from basic facts about injections. Reflexivity needs an injection , and the identity map is one. Transitivity needs an injection out of injections and , and their composite is injective: if the composite identifies two points, the outer map identifies their images and the inner map identifies them.
Proof.
The identity is injective, so .
Let and be injections. If then by injectivity of , and by injectivity of . So is an injection and .
Prove or refute each of the following, for arbitrary sets , and .
- If then .
- .
Let be non-empty. Show that for every set .
The Schröder–Bernstein Theorem
The last proposition does not give antisymmetry. For finite sets it is immediate, since forces ; in general it is a harder theorem.
Theorem 7.33 (Schröder–Bernstein).
Let and be sets with and . Then .
Discussion.
We are given injections and and must build a bijection out of them. Neither alone will do: may miss part of and may miss part of . The idea is to use on some of and the inverse of on the rest, and the problem is to decide where the boundary falls. The points where we have no choice are those of , which have no -preimage at all, so must be used there; and then must be used at for each such , since otherwise that point would be sent back to , which is already taken. Iterating gives a family built by the recursion theorem, and their union is the region where is used.
With the boundary fixed, three checks remain. The map is defined everywhere, because a point outside is in particular outside , hence has a -preimage, unique by injectivity. It is injective on each of the two regions separately, and the two cannot collide, because a collision would carry a point of one step further along the chain and so put an element of outside . It is surjective by chasing a given backwards: if lies outside it is where comes from, and if it lies inside it lies in some with a successor, which exhibits as a value of .
Proof.
Let and be injections. The recursion theorem, applied in with the map , gives exactly one family with
and we put . The two injections run the pieces alternately into one another,
and is the whole of the top row. On it the bijection will follow the downward arrows; off it every point has a -preimage, and the bijection will run back up them. Define
The second clause makes sense: gives , so , and the preimage is unique because is injective. So is a function.
For injectivity, suppose . If both points lie in then gives ; if neither does then applying to both sides gives . Suppose then and , so and hence . Since we have for some , so , contradicting .
For surjectivity, let and put . If then by the second clause. If then for some , and because ; so by the theorem on predecessors, and gives for some . Injectivity of gives , and , so .
Hence is a bijection and .
The proof gives the bijection in two pieces, one for the chained points and one for the rest, rather than as a single formula. What the applications use is only that it exists.
Assuming you know the real numbers, write for them and consider the closed interval and the open interval . The inclusion of in is an injection one way. In the other direction is injective and carries into , since goes to and to . Schröder–Bernstein therefore supplies a bijection between the two intervals, although neither of the injections we wrote is surjective.
Schröder–Bernstein is sometimes read as saying that injections and are each bijections. Exhibit sets and with injections both ways, neither of which is surjective.
Theorem 7.35 (Transitivity for strict comparison).
Let , and be sets.
- If and then .
- If and then .
- If and then .
Discussion.
Each part asserts the existence of an injection and the non-existence of a bijection, so each splits in two, and the first half is the previous proposition in every case, since a strict comparison contains a weak one. The second half is where Schröder–Bernstein is needed, and it is used contrapositively: a bijection would let us pull an injection back to an injection , and with the injection already in hand the theorem would return , which the strict hypothesis forbids. We write out the first part and leave the other two, which run the same way, to the problems.
Proof.
For the first part, the two hypotheses supply injections and , so by the previous proposition.
Suppose and let be a bijection. Composing with an injection gives an injection , so . Since gives , Schröder–Bernstein yields , contradicting . So no bijection exists and .
Comparability
Reflexive, transitive, antisymmetric: the comparison behaves like an order. What an order on the natural numbers also had was trichotomy, and for sizes that is a separate matter, since nothing so far rules out two sets neither of which injects into the other.
Let and be sets. Then or .
Discussion.
An injection defined on all of is what we want and cannot build directly, so we build the largest injection defined on part of and show that largest one leaves nothing out. The candidates are the injective functions whose domain is a subset of and whose values lie in ; each is a subset of , so comprehension collects them into a set, which inclusion orders.
To apply Zorn’s lemma we must show every chain has an upper bound, and we take the union of the chain: it is a function because two pairs with the same first coordinate lie in a common member of the chain, since members of a chain are comparable, and it is injective for the same reason with the coordinates exchanged. The empty chain is covered by the empty function. Zorn then supplies a maximal element , and maximality is used contrapositively: if missed a point of and also missed a point of , the pair of them could be added to , giving a strictly larger candidate. So one of the two is not missed, and the two cases give the two halves of the conclusion, the second by inverting .
Proof.
Let be the set of that are injective functions whose domain is a subset of , ordered by inclusion. The empty function belongs to , and inclusion is a partial order.
Let be a chain and put , a subset of . If and lie in , they lie in members and of , which are comparable, so both pairs lie in the larger one; that member is a function, so . Hence is a function, with domain the union of the domains. The same argument with the coordinates exchanged shows is injective. So and is an upper bound of , and is inductively ordered.
Zorn’s lemma gives a maximal . Suppose and , and choose and . Then is again an injective function with domain inside , and it properly contains , contradicting maximality.
So , in which case is an injection ; or , in which case the inverse of on its range is an injection .
Corollary 7.37 (Trichotomy for sizes).
For any sets and , exactly one of , , holds.
Proof.
Comparability gives or . If both hold then by Schröder–Bernstein; if only the first holds then , and if only the second then . So at least one of the three holds. No two hold together: makes both strict comparisons fail by definition, and together with would give by Schröder–Bernstein, contradicting either.
Remark.
Comparability was proved from Zorn’s lemma, and it is in fact equivalent to the axiom of choice, so it is not a free consequence of the other axioms. Schröder–Bernstein, by contrast, used nothing but the recursion theorem. So comparability needs the axiom of choice, while Schröder–Bernstein does not.
Cantor’s Theorem
Theorem 7.38 (Cantor's theorem).
For every set we have .
Discussion.
By the definition the claim splits in two: an injection , and no bijection. The injection is the map sending a point to the set holding just that point, and it is injective because a singleton determines its element.
For the second half we take an arbitrary and produce a subset that is not one of its values, which denies surjectivity and so denies bijectivity. A set differs from as soon as it disagrees with it at one element, and the element we use is itself, so we build the subset that disagrees with at for every at once: take those that are outside their own value. Comprehension makes that a set and it is a subset of , so it is eligible to be a value. Supposing it is the value at , the question whether belongs to it has a membership criterion that turns each answer into the other, which is Russell’s argument again.
Proof.
The map sends into , and gives , so it is injective and .
Let be any function and put
a set by comprehension and a subset of , so . Suppose for some . If then the criterion gives . If then, being an element of , the criterion gives . Both are contradictions, so is not a value of and is not surjective.
In particular no bijection exists, so .
Remark.
The diagonal set is the construction that showed there is no set of all sets, used for a different purpose. There it produced a contradiction from an assumption we then dropped; here it produces one from the assumption that is a value, and what we drop is surjectivity. Nothing about was used, so the theorem applies to every set: iterating it gives
a strictly increasing chain with no top, by transitivity for strict comparison.
Show that if and and , then . Transport the injection along the two bijections.
Prove parts 2 and 3 of the theorem on transitivity for strict comparison.
Use Schröder–Bernstein, rather than an explicit pairing, to show that once you have an injection each way.
Show that implies .
Deduce from Cantor’s theorem that for every .
Infinite Sets
A set is infinite when it is not finite, which is a purely negative description: no cut matches it. Cantor found that infinite sets come in different sizes, and Cantor’s theorem above already gives a strictly increasing chain of them. We start with the smallest.
Countable Sets
Definition 7.39 (Countable and uncountable).
A set is countably infinite if , countable if it is finite or countably infinite, and uncountable otherwise.
A bijection is an infinite sequence in , so a countably infinite set is one whose elements can be written as a list
in which every element appears exactly once. Such an is an enumeration of . The list is not part of the set, and a set usually admits many.
That the two cases of countability do not overlap is the corollary that is infinite, since otherwise a finite set could be equinumerous with .
Proposition 7.40 (Dropping zero).
, so is countably infinite.
Discussion.
We must produce a bijection, and we use the successor map, checking three things against the Peano conditions. Its values are positive, since a successor is never , so it does map into . It is injective, which is the third condition verbatim. It is surjective onto , which is the theorem on predecessors: every element other than is a successor.
Proof.
Consider . Its values lie in , since by the fourth Peano condition. It is injective by the third. It is surjective, since an element of is not and is therefore for some by the theorem on predecessors. So is a bijection and .
Remark.
Since , an infinite set can be equinumerous with a proper subset of itself, which the corollary of the last chapter shows no finite set can do. Dedekind turned the observation round and took it as the definition of infinite, and we prove below that his definition agrees with ours.
Subsets of the Natural Numbers
Theorem 7.41 (Infinite subsets of the natural numbers).
Every infinite subset is countably infinite.
Discussion.
We must produce an enumeration of , and there is an obvious rule for one: list the smallest element first, then the smallest of those left, and so on. Two things must be checked before this is a definition. The rule at stage refers to everything listed before , not merely to the previous entry, so it is the general recursion theorem rather than the plain one that builds the function, taking for its rule the map sending a finite list to the least element of not on it. And that least element must exist: the elements listed so far form the image of a cut, hence a finite set, so they cannot exhaust the infinite , and well-ordering then supplies the minimum.
What remains is to check that the enumeration works. It is strictly increasing, because each entry is chosen from a smaller pool than the one before and differs from the entry just removed, and a strictly increasing map is injective by trichotomy. Surjectivity is a least-counterexample argument: if some never appears, look at the first stage whose entry overshoots . Everything listed before that stage is below , so was still in the pool at that stage, and the minimum chosen there cannot have exceeded it.
Proof.
For a finite sequence in , the range is finite, being the image of a cut. So is non-empty: otherwise would make finite. Define
which exists by well-ordering. The general recursion theorem gives exactly one with for every , that is,
Every value of lies in . The map is strictly increasing: the set from which is chosen is contained in the set from which is chosen, so by minimality, and because was removed at the later stage. Induction then gives whenever , and trichotomy makes injective.
Induction also gives : this holds at , and if then , so would place strictly between and , which nothing does; hence .
Suppose some is not a value of . Since , the set of with is non-empty, so well-ordering gives a least such . Every has and , so ; hence belongs to , and minimality of in that set gives , contradicting .
So is a bijection from onto .
Characterising At Most Countable Sets
Theorem 7.42 (Characterising countable sets).
Let be a non-empty set. The following are equivalent.
- is countable.
- There is an injection .
- There is a surjection .
Discussion.
We prove the three conditions equivalent by a cycle of implications.
From the first to the third: a countably infinite has a bijection from , which is a surjection; a finite non-empty has a bijection from a cut, which we extend to all of by parking every later index on one fixed point, and parking spoils nothing because surjectivity asks only that every point be hit.
From the third to the second: a surjection has an injective right inverse, and here we can name one without appealing to choice. Each point of has a non-empty set of preimages inside , so well-ordering picks out its least preimage, and a right inverse is injective because applying the surjection recovers the point.
From the second to the first: an injection makes equinumerous with its image, a subset of , and a subset of is finite or infinite; in the first case is finite, and in the second the theorem just proved makes it countably infinite.
Proof.
Suppose is countable. If , a bijection is a surjection. If is finite and non-empty, let be a bijection with , and define by for and for . Every point of is for some , so is surjective.
Suppose is surjective. For the preimage is a non-empty subset of , so it has a least element; let be that element. Then for every , so gives , and is injective.
Suppose is injective. Then . If is finite then so is . If is infinite then by the theorem on infinite subsets, so by transitivity. Either way is countable.
Corollary 7.43 (Subsets of countable sets).
Every subset of a countable set is countable.
Proof.
Let with countable. If is empty it is finite. Otherwise is non-empty, so there is an injection by the theorem, and its restriction to is injective, so is countable by the theorem again.
Products and Unions
Theorem 7.44 (Pairs of natural numbers).
is countably infinite.
Discussion.
By the characterisation it is enough to find one injection into , and then to observe that the set is not finite. For the injection we enumerate the pairs in diagonals: all pairs with , then those with , and so on. The th diagonal has entries, so a pair on the diagonal should be given the position
where the summation symbol is the one built by recursion in the last chapter but one. Injectivity then rests on the diagonals not overlapping, which is the inequality whenever and ; it follows from the recursion clause . Once the diagonal is known, and then are determined by uniqueness of differences. Infinitude is easy: the pairs form a copy of inside, and a set with an infinite subset is infinite.
Proof.
Write , so that and .
We first record that is non-decreasing: if then , and induction on gives the claim, since is at least , which is at least by the inductive hypothesis.
Define . Laid out with down the side and across, the values run
The boxed entries are the pairs with , and they fill the consecutive block from to . What follows is that observation for a general diagonal.
Suppose and put , . If then for some , so
Also , so for a positive and , giving ; and . Together these give , against the supposition. The same argument rules out , so by trichotomy. Then gives by uniqueness of differences, and gives likewise. So is injective and is countable.
Finally is injective, so has an infinite subset and is therefore infinite.
Corollary 7.45 (Products of countable sets).
If and are countable then so is .
Proof.
If either set is empty the product is empty. Otherwise let and be injections. Then is injective, by equality of ordered pairs, and composing it with the injection of the theorem gives an injection .
Theorem 7.46 (Countable unions of countable sets).
Let be countable and let be an indexed family of countable sets. Then is countable.
Discussion.
The characterisation lets us argue with surjections rather than injections, and a surjection onto the union is easy to describe: run over the indices with one surjection and over each set with another, so that the pair names the th element of the th set. Two points need care. Countability of says only that a surjection onto it exists, and we need one for every at once, and this needs the axiom of choice. And the domain of the resulting map is rather than , which the previous theorem fixes, since a countably infinite set admits a bijection from . Composing the two gives a surjection from onto the union, which is then countable by the characterisation.
Proof.
Discard the indices with ; the union is unchanged and the smaller index set is still countable. If nothing is left the union is empty, hence countable, so suppose and every .
By the characterisation there is a surjection . For each the set of surjections is a non-empty subset of , again by the characterisation, so the axiom of choice applied to gives a function with for every .
The map is a surjection from onto : a point of the union lies in some , and for some while for some . Composing with a bijection , which the previous theorem supplies, gives a surjection from onto the union, which is therefore countable.
Remark (Hilbert's hotel).
A hotel with a room for every natural number, all of them occupied, can still take in a new guest: move the occupant of room to room and give the newcomer room . It can take in countably many new guests at once: move the occupant of room to room and use the odd rooms, which the remainder classes say are exactly the rooms left free. It can even take in countably many coaches each carrying countably many guests, by the theorem on countable unions. Infinite sizes do not behave like finite ones, and here we have to rely on the propositions above rather than on intuition.
Remark (Informal).
Assuming you know the whole numbers and the fractions: the whole numbers are the union of the natural numbers, their negatives and zero, so the theorem on countable unions makes them countable. Every fraction is determined by a pair of whole numbers, so the corollary on products makes the fractions countable as well. Both arguments go through as soon as those systems are built.
Let be countable. Show that is countable, by induction on .
Let be countable. Show that the set of finite sequences in is countable, and that the set of finite subsets of is countable.
Show that the map of the theorem on pairs is a bijection onto , not merely an injection. Well-ordering applied to the set of with will locate the diagonal on which sits.
Let be countably infinite and let be finite and non-empty. Show that and are countably infinite.
Write as the union of a countably infinite family of pairwise disjoint countably infinite sets.
Finite and Infinite
One question is still open. We defined infinite negatively, as the failure of finiteness, and observed that has a proper subset of its own size. Whether every infinite set does is still open, and the answer needs the axiom of choice.
Theorem 7.47 (Every infinite set has a countably infinite subset).
Let be infinite. Then some subset is countably infinite.
Discussion.
The plan copies the enumeration of an infinite subset of : pick an element, then an element not yet picked, and so on. Two things we had there are missing here. There is no order on , so nothing selects an element for us, and the axiom of choice gives a rule that selects one from every non-empty subset at once. And the rule at each stage refers to all the earlier picks, so it is the general recursion theorem that turns the rule into a function. The recursion never stalls, because the elements picked so far form a finite set and is infinite, so something is always left. Injectivity is immediate from the construction, since each value is chosen outside the earlier ones, and an injective map from has range a countably infinite subset.
Proof.
Since is infinite it is non-empty. Apply the axiom of choice to the family of non-empty subsets of , indexed by itself, to obtain a function with for every non-empty .
For a finite sequence in the range is finite, so is non-empty, since otherwise would be a subset of a finite set. Define
and let be the map the general recursion theorem produces, so that
for every . If then is one of the elements excluded at stage , so ; with trichotomy this makes injective. Hence satisfies and .
Theorem 7.48 (Characterising finite sets).
Let be a non-empty set. The following are equivalent.
- is finite.
- There is a surjection for some .
- There is an injection for some .
- There is no injection .
When they hold, is the least of the second kind and equally the least of the third.
Discussion.
We run a cycle again. From the first to the second, a counting of is itself a surjection from a cut. From the second to the third, a surjection has an injective right inverse, obtained as before by sending each point to its least preimage, which well-ordering supplies inside the cut. From the third to the fourth, an injection followed by an injection would inject into , and restricting to would inject a cut into a shorter one. The last step is the theorem just proved, read contrapositively: an infinite carries a copy of , hence an injection .
The minimality clause is the two size theorems. A surjection gives by the proposition on images, an injection gives by the theorem on injections and size, and is achieved in both cases by a counting of and its inverse.
Proof.
Suppose is finite. Being non-empty, for some , and a bijection is a surjection.
Suppose is surjective. For the preimage is a non-empty subset of , so it has a least element; sending to it defines with , and is injective.
Suppose is injective and let be injective. Then is injective, and its restriction to is an injection , which no cut admits. So no such exists.
Suppose finally that is not finite. The previous theorem gives a subset equinumerous with , hence a bijection , which composed with the inclusion of in is an injection . That is the fourth condition denied, which completes the cycle.
For the last claim, a surjection gives , and an injection gives ; both bounds are attained by a counting of , which is a surjection , and by its inverse.
Theorem 7.49 (Dedekind's characterisation of finiteness).
A set is finite if and only if it is not equinumerous with any proper subset of itself.
Discussion.
One direction is much easier than the other. One of them is the corollary of the first chapter, which said that a finite set is strictly larger than each of its proper subsets, so no bijection is available.
The other is best proved contrapositively: given an infinite , we produce a proper subset equinumerous with it. The theorem above puts a copy of inside , and inside it we can shift along successors, as in . So we shift inside the copy and do nothing outside it: the points of off the copy are left where they are, and the th point of the copy is sent to the th. The result misses the initial point of the copy and nothing else, which is the proper subset we wanted.
Proof.
If is finite and then , by the corollary on proper subsets.
Suppose is infinite. The theorem on countably infinite subsets gives an injection ; write and define
Each is for exactly one , since is injective, so is a function; and its values avoid , since by injectivity and gives .
For injectivity, two points of are separated because and are injective, two points outside are unchanged, and a point of cannot collide with one outside because its value lies in . For surjectivity, a point outside is ; and a point with is for the predecessor of , hence .
So , a proper subset of .
Corollary 7.50 (Finiteness by self-maps).
A set is finite if and only if every injection is surjective, and if and only if every surjection is injective.
Proof.
If is finite, the theorem on finite self-maps gives both conditions. If is infinite, the map built in the last proof is an injection whose range omits , so it is injective and not surjective; and its inverse on that range, extended by sending to itself, is a surjection that is not injective.
Remark.
Only the second direction of the theorem used the axiom of choice, and used it twice, once to select elements and once through the recursion that strung the selections together. Dedekind took the property in the theorem as his definition of infinite, and without choice his definition and ours are not known to agree: there is no contradiction in a set that is infinite in our sense and yet admits no bijection with a proper subset. We accept choice, so for us the two notions are one.
Show that a set is infinite if and only if for every there is an injection .
Let be infinite and countable. Show that .
Uncountable Sets
Every infinite set met so far has turned out to be countable, and the closure properties above keep it that way: subsets, products and countable unions of countable sets are all countable. Cantor’s theorem already gives sets that are not, and the same diagonal argument gives an explicit one.
Theorem 7.51 (Cantor's diagonal argument).
Let be a set with at least two elements. Then the Cartesian power , the set of infinite sequences in , is uncountable.
Discussion.
Uncountable means neither finite nor countably infinite, and the characterisation of countable sets turns that into one statement: no surjection exists. So we assume a surjection, write for the sequence it puts at , and build a sequence it has missed.
The sequences are laid out as an infinite array whose th row is , and a sequence differs from the th row as soon as it differs from it in one place. The place we can always name is the th, on the diagonal of the array, so we build by walking down the diagonal and disagreeing at every step. Disagreement is possible because has a second element, and we fix two elements of once and for all rather than choosing at each step, so the axiom of choice is not needed. Then differs from every row, so it is not a value of the surjection.
Proof.
Fix with , and suppose is a surjection. Write and , so the values are laid out as
Define by if , and otherwise. Then for every , since in the second case .
Now , so surjectivity gives for some , and reading both sides at gives , which is false. So no surjection exists, and is neither finite nor countably infinite by the characterisation of countable sets.
The same diagonal argument works for an arbitrary index set.
Theorem 7.52 (A set is smaller than its sequences).
Let be non-empty and let have at least two elements. Then .
Discussion.
The claim splits into an injection and the absence of a bijection. For the injection we must attach to each point of a function on , and we use the point itself: send to the function that takes one fixed value at and the other everywhere else. Two distinct points give functions that disagree at either of them, so the assignment is injective.
For the second half the diagonal argument runs verbatim, with in place of : given , the function that disagrees with at , for every , cannot be a value of . Nothing in that used the order or the countability of the index set, so only the two fixed elements of are needed.
Proof.
Fix with . For let take the value at and elsewhere. If then while , so ; hence is an injection and .
Let be any function and define by if , and otherwise, so that for every . If for some , reading both sides at gives , which is false. So is not a value of , no is surjective, and no bijection exists.
Corollary 7.53 (Power sets as sequences).
For every set we have .
Proof.
Send to its characteristic function , taking the value on and off it. Distinct subsets differ at some point, where their characteristic functions differ, so the map is injective; and any is the characteristic function of , so it is surjective.
So Cantor’s theorem is the previous theorem read at , and the diagonal argument that rules out surjections onto is the one that rules out surjections onto .
Corollary 7.54 (An uncountable set).
is uncountable, and so is .
Proof.
has two elements, so is uncountable by the diagonal argument, and is equinumerous with it by the corollary above; a set equinumerous with an uncountable set is uncountable, since countability is defined by the existence of a bijection.
Remark (Informal).
Assuming you know the real numbers, the same argument shows there are uncountably many. List candidate decimal expansions of the numbers between and and build a new expansion differing from the th in its th digit, avoiding the digit so as not to fall foul of the two expansions some numbers have; the number it names is missing from the list. Since the fractions are countable, the numbers that are not fractions must be uncountable, for otherwise the reals would be a union of two countable sets.
The same counting argument shows something less expected. The polynomials with fractional coefficients are countable, being determined by finite lists of fractions, and each has finitely many roots, so the numbers that are roots of such a polynomial form a countable set. Uncountably many real numbers are therefore roots of no such polynomial at all, although exhibiting even one takes real work.
Let be uncountable and let be countable. Show that is uncountable.
Deduce from Cantor’s theorem that there is no surjection , for any set .
Cardinal Numbers
We have been writing for arbitrary sets without saying what names when is infinite, and so far we have not needed to: the three relations were defined as statements about functions, and the symbol never occurred alone. It can be given a meaning, using the equivalence classes from the remark of the first section.
Definition 7.55 (Cardinal number).
Fix a set . The cardinal number of a subset is its equivalence class under equinumerosity. Two subsets of have the same cardinal number exactly when they are equinumerous.
Remark.
The restriction to a fixed is needed, since the sets equinumerous with a given one do not form a set. For finite nothing is lost by reading as the natural number counting it, because the cardinal numbers of finite subsets of correspond to the cuts, one class for each with . A definition free of the ambient needs the ordinal numbers, which we have not built.
The order has the properties the notation suggests. Reflexivity and transitivity were proved directly, Schröder–Bernstein gives antisymmetry, since two subsets each injecting into the other are equinumerous and so name one class, and comparability makes any two classes comparable. So on the relation is a total order, with the strict comparison as its strict part.
Definition 7.56 (Arithmetic of cardinal numbers).
For sets and define
The tagged copies in the sum are there because and may share elements, and tagging makes disjoint copies of both without disturbing their sizes. That the three operations depend only on the classes and not on the sets chosen to represent them is the transport problem set above. On finite sets they agree with the arithmetic of the first chapter, by the theorems on disjoint unions and products and by the problem on .
Since and , the power set records an exponential:
and Cantor’s theorem reads . Writing for the smallest infinite cardinal number, the chain
climbs for ever, so there is no largest size.
Remark (The continuum hypothesis).
Nothing proved here says whether anything sits between two consecutive terms of that chain. The continuum hypothesis asserts that nothing sits between the first two: there is no set with . Gödel showed in 1938 that it cannot be refuted from the axioms we have listed, choice included, and Cohen showed in 1963 that it cannot be proved from them either, so long as those axioms are consistent at all. It is independent, in the sense the axiom of choice was said to be independent, and one may add it or its negation without introducing a contradiction that was not already there.
Remark.
Cantor’s theorem also settles again a question from the naive chapter. Were there a set holding every set, then would be one of its subsets, so
which trichotomy forbids. That is Cantor’s own argument, and it reaches the conclusion of the proposition on no set of all sets by counting rather than by self-membership.
Show that cardinal addition and multiplication are commutative and associative, and that . Each identity is a bijection between the sets involved.
Show that and , and explain which theorems of this chapter each one is.
Show that and imply .
Show that for all sets , and .
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.
Let and .
is:
is:
is:
is:
The sum equals:
Each part asks for a bijection between two subsets of .
A bijection from onto is:
Its inverse is:
A bijection from onto the even elements of is:
A bijection from onto is:
There are seven days in a week.
Among any fifteen people, the largest number that must share a day of the week is:
Among any twenty-two people, that number is:
The least for which any people must include three born on the same day of the week is:
For a function from a set of elements to a set of elements, some value is taken at least this many times:
Of the functions , the injective ones are:
A study of breakfast eaters finds that also eat lunch, floss regularly and take a morning paper. Among the lunch eaters, floss and take the paper, and do both. Four flossers neither eat lunch nor take the paper.
The number who floss and take the paper is:
The number who take the paper but neither floss nor eat lunch is:
The number who do none of the three is:
Classify each set as finite, countably infinite or uncountable.
.
The multiples of in .
.
.
The finite subsets of .
The subsets of that are infinite.
On the comparison of sizes.
Someone reads Schröder–Bernstein as saying that injections and are each bijections. Is that right?
Comparability of any two sets was proved from:
Schröder–Bernstein was proved from:
Suppose there is an injection and no injection . Then:
The pairing of the theorem on pairs of natural numbers, where .
is:
is:
The pair sent to is:
The number of pairs with is:
Finiteness by self-maps and by proper subsets.
A set is finite exactly when every injection is:
The sets equinumerous with a proper subset of themselves are:
The successor is injective and not surjective. That shows:
The theorem that every infinite set has a countably infinite subset rests on:
Cardinal numbers.
The cardinal names:
Is there a largest cardinal number?
The continuum hypothesis is:
Why is the cardinal number of defined only for subsets of a fixed set ?
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 ⟨ ⟩.
The last sheet gave the checker the order on the carrier and the sets separation carves out. This chapter counts, and counting needs two things the checker has not had: a map read between two sets rather than across the whole universe, and the natural numbers as objects of that universe, so that the cuts have something to hold.
Maps between two sets
A map has so far been an arrow f : Obj → Obj on everything at once, and Injective f and Surjective f asked their conditions everywhere. A map of this chapter has a domain and a codomain, so the same conditions are written on the sets they are asserted of, and each is the statement the definitions of a surjection and an injection make it:
MapsTo f A B is ∀ x, x ∈ A → f x ∈ B
InjOn f A is ∀ x y, x ∈ A → y ∈ A → f x = f y → x = y
SurjOn f A B is ∀ y, y ∈ B → ∃ x, x ∈ A ∧ f x = y
BijOn f A B is MapsTo f A B ∧ InjOn f A ∧ SurjOn f A BBeing those statements and not merely equivalent to them, they are opened with intro and used by applying them, in the way A ⊆ B has been since the sets sheet. A BijOn splits three ways at once, so obtain ⟨hm, hi, hs⟩ takes one apart and refine ⟨?_, ?_, ?_⟩ puts one together.
Example.
A map injective everywhere is injective on any set. The converse fails, which is why the two conditions are kept apart.
Example.
The values of on lie in , which is where is known to do its work.
A restriction of an injection is an injection.
The codomain may be enlarged freely.
The first part of the theorem that bijections compose, read on two sets.
Its second part.
Only the first map need be injective for the composite to be.
The inverse of a bijection is a bijection. The checker cannot choose preimages, so the inverse arrives as a hypothesis rather than being built; what is left is the second part of Proposition 7.2 .
Comparing sizes
Two sets are compared by the functions running between them, which is what Definition 7.1 and Definition 7.31 say, so the two comparisons are typed as the existence statements they are:
A ≈ B is ∃ f : Obj → Obj, BijOn f A B
A ≼ B is ∃ f : Obj → Obj, MapsTo f A B ∧ InjOn f Atyped \approx and \preceq. The second is ; the strict comparison is not notation of its own, being the second together with the denial of the first. A witness is supplied by use or as the first component of refine ⟨_, ?_, ?_⟩, and it is written as a function, fun x => x for the identity.
Example.
The first part of Proposition 7.2 . Each of the three conditions is read at a point, and the identity satisfies all three without any work.
The empty function.
A subset is no larger than the set it sits in.
A bijection is in particular an injection.
The second part of Proposition 7.32 .
The third part of Proposition 7.2 .
Problem 7.13 : a comparison transported along two bijections.
Problem 7.16 . The map sends a subset of to its image. (Harder.)
Cantor’s theorem
The first half of Cantor’s theorem.
And the second, which is Problem 7.26 . The diagonal set is {x ∈ S | x ∉ f x}, and it is a subset of before it is anything else.
The natural numbers as objects
The carrier ℕ of the Peano sheet is a type of its own, and the cuts are sets, so the two have to be brought together before a cut can be written down. ↑n, typed \up, is the object the number n names; ω is the set of all of them, which is ; and L n is the cut. Their criteria are the definitions:
x ∈ ω is ∃ k : ℕ, x = ↑k
x ∈ L n is ∃ k : ℕ, k < n ∧ x = ↑kso a membership is built with use or ⟨_, _, _⟩ and taken apart with obtain ⟨k, hk, he⟩. That distinct numbers name distinct objects is Num.inj, and Finite A is ∃ n : ℕ, A ≈ L n, which is Definition 7.5 verbatim.
Example.
The witness is the number itself, and the equation it has to satisfy is an identity.
Example.
A strict inequality is a positive difference, and no positive difference reaches . It is listed below as Nat.not_lt_zero, so the exercises may lean on it.
The first part of Proposition 7.4 .
Its last part.
Every cut sits inside .
And the cuts grow with their index.
The middle part of Proposition 7.4 , which every induction of this chapter turns on.
A cut counts itself.
And the empty set is counted by the cut that holds nothing.
A set with one point in it. (Harder.)
A finite set injects into , which is the easy half of the characterisation of countability.
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 ω |
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 |
Lesson 8
Permutations
Taught
Permutations
A bijection from a set to itself maps the set onto itself and may rearrange its elements. Counting was the first thing we did with finite sets, and the second is this: fix the set and ask in how many ways its points can be rearranged among themselves. The rearranging functions can be composed, and this chapter studies that composition.
Two-Row Notation
Let be a set. A permutation of is a bijection .
When is finite and non-empty a permutation is settled by naming the value it takes at each point, and there are only finitely many points to name. So the whole function fits in a table of two rows: the points along the top, their values underneath.
Definition 8.2 (Blocks and -sets).
For write
so that . A finite set with cardinality is an -set, and a subset of a set that is itself a -set is a -subset of it.
The block counts as the cut does: is a bijection from onto , injective by uniqueness of differences and surjective because every positive number is a successor. So , and an -set is exactly a set equinumerous with . We take the block rather than the cut as the standing domain here only because it makes the tables below read as they do everywhere else, starting at one.
Definition 8.3 (Two-row notation).
Let be an -set with , let be a listing of its elements, and let be a permutation of . Write
for the permutation sending each to . The columns may be reordered at will: any listing of the domain along the top, with the matching values underneath, denotes the same function.
The last sentence is equality of functions and nothing more. A table names a function by naming its value at each point, and the order in which the points are named is no part of the function.
Example 8.4 (A permutation of four points).
On the rule , , , is the permutation
the second table being the first with its columns shuffled. A two-row table fails to describe a permutation exactly when its bottom row is not a rearrangement of its top: a repeated value breaks injectivity, and a missing one breaks surjectivity.
Definition 8.5 (The symmetric group).
The set of all permutations of a set is written and called the symmetric group on . When one writes rather than .
The word group is traditional and we use it as a name only. What stands behind it is that carries a multiplication and is closed under composition and inverses: composition sends bijections to bijections, the identity map is a bijection since it is its own inverse, and the inverse of a bijection is a bijection. No abstract definition of a group is needed below; we use only the set and its composition.
Working in rather than in for an arbitrary -set loses nothing. A listing of is a bijection , and carries permutations of to permutations of , reversibly. That is what two-row notation already does silently when it writes the points in a row.
Definition 8.6 (Product of permutations).
Let . The product is the composite , so that
One applies first and second. The permutations and are the factors of the product.
Example 8.7 (Multiplying in ).
Take
in . To compute , follow each point through and then through :
so that
the second computed the same way in the other order. So : the multiplication is not commutative, though particular pairs may commute.
Remark (Authors who read left to right).
Some texts write the value of a function to the right of its argument, in place of , and then read a product left to right. We keep the order fixed for composition, so always means ” first, then ”. When reading another source, work one product out by hand before trusting its convention.
The bottom row of a two-row table for an element of is a rearrangement of , and conversely each rearrangement of is the bottom row of exactly one element of , the one whose top row runs in ascending order. So is matched point for point with the orderings of , which is why permutations are so often described as arrangements rather than as functions.
Permutations describe any situation in which objects trade places, one object to a place. Number the places through ; a process that carries whatever sits in place to place is recorded by the permutation with , and performing two such processes in turn is recorded by the product.
Every set has two permutations we already know. One is the identity, a bijection because it is its own inverse. The other is the transposition of the counting chapter, which exchanges and and fixes every other point; it is its own inverse, hence a permutation of whatever set it is defined on. So is never empty, and holds more than one element as soon as holds two distinct points.
Write out every element of and of in two-row notation, with the top row ascending, and check that you have two and six of them respectively.
With and as in the example of multiplication in , compute and , and decide whether either is the identity. Compute and and observe that they differ.
Let be a set and let be a bijection. Show that is a bijection from onto , and that it carries products to products.
Counting Permutations
The theorem on cardinality of a product already suggests how many bijections run between two -sets: values are available for the first point, then for the second once the first is used, and so on down. The shorthand for that descending product is the factorial.
Define for by the recursion
so that for . The number is the factorial of .
That the recursion defines exactly one function is the recursion theorem, applied as it was for addition. The value is the empty product, chosen for the same reason the empty sum is : it starts the recursion, and it spares us a separate case in every count below.
Theorem 8.9 (Number of bijections between -sets).
Let and be -sets for some . Then there are exactly bijections from to . In particular , and the empty set has exactly one permutation, in agreement with .
Discussion.
The claim is a counting statement about a set we have not yet named: writing for the set of bijections , we must show . The factorial was defined by a recursion on , so the proof is an induction on whose step must produce the factor . At both sets are empty and the empty function is the only function between them, so there is one, which is . For the step we split according to where a chosen point of goes: there are possible values, the pieces of the split are pairwise disjoint and cover , and each piece is matched with the bijections between two -sets by restricting to what is left of . By the inductive hypothesis each piece has elements, and the cardinality of a product gives the total , which is the recursion clause for the factorial.
Proof.
We induct on . If then , and the empty function is the only function ; it is a bijection, so there is of them.
Suppose the claim holds for all pairs of -sets, and let . Fix and, for each , let be the set of bijections with . Every bijection lies in exactly one , namely the one indexed by its value at , so the are pairwise disjoint and their union is .
Fix . Restriction to carries a member of to a bijection , by the proposition that bijections remove points; and every such bijection extends to exactly one member of , by sending to . So is matched with the set of bijections between two -sets, which the inductive hypothesis counts as , and .
The index set is an -set, so is a union of pairwise disjoint sets each of cardinality ; matching it with and applying the cardinality of a product gives
which is the claim at . Taking gives .
Example 8.10 (The sets , and ).
holds only the identity on . holds the two elements
and holds :
Without the theorem one would need care to be sure such a list is complete; with it, six is enough.
Example 8.11 (Selections and orderings).
A competition offers five water events, six running events, four cycling events and seven self-defence events. One event may be chosen from each category in ways, by the cardinality of a product applied three times. If a competitor also fixes the order in which to attempt the four chosen events, each selection admits orders, so there are full programmes.
Example 8.12 (Non-attacking rooks).
Eight rooks stand on a chessboard with no two attacking, which means no two share a row or a column, since a rook commands both. Each row holds at most one rook and there are eight rooks for eight rows, so every row holds exactly one; the same count puts exactly one in each column. Let be the column of the rook in row . The column condition says precisely that is injective, hence a permutation of by the theorem that injective and bijective agree on a finite set; and conversely each places one rook in each row, in the columns , no two equal. So the acceptable positions are matched with , and there are of them.
If the rooks are told apart, say by eight colours, choose the squares first in ways and then distribute the colours over them in ways, for arrangements.
Seven beads of distinct colours are strung on a cord whose ends are then tied, and two necklaces count as the same when one can be turned or flipped into the other. Before the knot the beads lie in a row, and there are rows. Fix one necklace and ask how many rows display it: choose which bead is to sit at the left end, then which of that bead’s two neighbours follows it, and the rest of the row is forced, so rows, all different because the colours are. Every row displays exactly one necklace, so fourteen times the number of necklaces is , and there are necklaces.
Said the other way, call two rows equivalent when one is a rotation of the other or of its reversal; that is an equivalence relation, its classes are the necklaces, and each class holds fourteen rows.
Show that for every , and that for every , with equality only at and .
Give a second proof of the theorem on the number of bijections that does not partition , but instead builds a bijection one value at a time and appeals to the product of cardinalities directly. Which of the two proofs makes the appearance of more transparent?
Let be an -set. Show that the permutations of fixing a chosen point of number , and that those moving every point of number fewer than as soon as .
Symmetries of Regular Polygons
Permutations record how labelled places trade their occupants. The symmetries of a regular polygon are an example: each rigid motion carrying the polygon onto itself shuffles the corners, and the motion is settled by the shuffle.
Remark (What is borrowed from geometry).
The plane, the length of a segment and the measure of an angle are borrowed here in the same spirit as the rules of school algebra were borrowed earlier: openly, and without being built. Two geometric facts are used and not proved: that a symmetry of a polygon carries corners to corners, and that a symmetry is settled by what it does to the corners. Everything else in this section is a statement about permutations, and is proved.
Definition 8.14 (Symmetry of a figure).
A figure is a subset of the plane. A symmetry of is a bijection of the plane onto itself such that and such that the distance from to equals the distance from to , for all points and . Briefly: a rigid motion of the plane carrying onto itself.
A polygon with corners, where , is a figure consisting of points , the corners, together with the segments joining to for , where means ; those segments are the edges. A polygon with corners is an -gon, and it is regular if all its edges have the same length and all its interior angles the same measure.
Label the corner positions of an -gon by . A symmetry then determines a permutation : let be the label of the position to which carries the corner that started at position . Distinct symmetries determine distinct permutations, since a symmetry is settled by what it does to the corners, so the map is injective and an -gon has at most symmetries. Composing symmetries multiplies the permutations: if and answer to and , then answers to , because both sides send a corner to the same place. Questions of the form “what happens if these motions are performed in turn?” therefore become products in .
Example 8.16 (Symmetries of an equilateral triangle).
Let be an equilateral triangle with its corner positions labelled , and let be the line through position and the midpoint of the opposite edge. Writing for the six symmetries of and for the permutations they determine, the dictionary is
The six permutations listed are distinct and , so the list is complete in two senses at once: the triangle has no further symmetries, and every element of comes from one.
For the triangle every permutation of the corners comes from a symmetry. For larger polygons this fails. For a square with corners labelled in order round the boundary, the permutation
holds position still while exchanging the two positions next to it, and no motion preserving distance can do that, since the two exchanged corners are at different distances from the first. For a regular -gon the count is exactly .
Proposition 8.17 (Number of symmetries of a regular -gon).
A regular -gon has exactly symmetries. Equivalently, the permutations in determined by those symmetries form a -subset of .
Discussion.
The claim is a count, and the object counted is the set of symmetries, which we have already matched injectively with a subset of ; so it is enough to count the permutations that arise. A symmetry is settled by what it does to the corners, and in fact by what it does to two neighbouring corners, so the count is a product of two choices in the manner of the cardinality of a product. The first corner may go to any of the positions, which is the first factor. Its neighbour is one edge away from it, and a motion preserving distance must leave it one edge away from wherever the first corner went, so only the two positions adjacent to that one are available, which is the second factor. That those two choices determine the rest is the geometric fact we have assumed: the remaining corners are reached by stepping round the boundary, and each step is forced once the direction and the starting position are fixed.
Proof.
Label the corner positions in order round the boundary and let come from a symmetry .
There are possible values for . The corners at positions and are joined by an edge, so carries them to corners joined by an edge, and hence is one of the two positions adjacent to : two possible values. Once and are fixed, so is the direction in which runs round the boundary, and every further corner is reached from the previous one by one edge in that direction; so are determined.
Each of the pairs of choices is realised, by a turn when the direction is preserved and by a reflection when it is reversed, and distinct pairs give distinct permutations, hence distinct symmetries. So there are exactly symmetries.
Remark.
The same can be counted a second way, by kind rather than by choice: there are turns, through none, one, …, steps round the boundary, and reflections. When is odd every reflection has its line through one corner and the midpoint of the opposite edge; when is even, half of the lines pass through two opposite corners and half through the midpoints of two opposite edges. Either way the total is .
Definition 8.18 (Dihedral group).
The set of permutations in determined by the symmetries of a regular -gon is written and called the dihedral group of degree . By the proposition, and .
Working with the motions of a regular -gon is therefore the same as computing inside , since composing motions is multiplying permutations. The triangle gives , as the example showed; for the inclusion is proper, since .
Example 8.19 (A regular nine-gon).
A regular nine-gon has symmetries. With the positions labelled through round the boundary, the two symmetries carrying position to position are
a turn through four steps and a reflection in the line through position and the centre. The reflection is recognisable from its table without any picture: it fixes and pairs off the remaining positions, which is what an involution with one fixed point looks like.
Example 8.20 (Composing motions by multiplying).
Take the six symmetries of the equilateral triangle and their permutations as listed above. The composite answers to the product
Following , and through the five factors from the right gives , and , so the product is and the composite motion is the reflection . Once the dictionary between motions and permutations is fixed, the computation needs no picture.
For the square with corners labelled round the boundary, list the eight elements of in two-row notation, and name an element of that is not one of them.
With the triangle dictionary above, compute and and read the answers as repeated turns.
Show that is closed under products and under inverses. Argue geometrically, from the fact that a composite of rigid motions carrying the polygon onto itself is one, and that the inverse of such a motion is one.
Cycles and Parity
Two-row notation is complete but bulky: it names values to describe a function that may move only two points. Cycle notation is shorter. It records a permutation by its orbits, and the order and the parity of a permutation can both be read off the same decomposition.
Throughout, is fixed unless said otherwise, and is the identity permutation of .
Inverses, Powers and Order
A permutation is a bijection, so it has an inverse, and that inverse is again a bijection of the same set: gives , with sending each back to . In two-row notation this is easy: exchange the rows, then reorder the columns so that the top row ascends again.
Example 8.21 (Computing an inverse).
If
then exchanging the rows gives
In practice one writes a blank table and, under each along the top, records the unique with ; it is unique because is a bijection.
Definition 8.22 (Powers of a permutation).
Let . Define for by the recursion
so that and is the -fold product . Write also
for , so that has its usual meaning.
Example 8.23 (Powers both ways).
If
then
Comparing the first and last tables shows to be the inverse of , which the theorem below predicts.
Theorem 8.24 (Laws of exponents).
Let and let . Then
- ;
- ;
- , that is, when is positive.
Discussion.
Three identities between permutations, each of them an equality of functions on . The powers were defined by a recursion on the exponent, so each part is an induction on one exponent with the other held fixed, and each inductive step is the recursion clause together with associativity of composition. For the first we fix and induct on ; the base is the identity law , and the step moves one factor across the bracket. The second is the same induction on , now using the first part at each step to add exponents. For the third, to say that a permutation is the inverse of is to say that it composes with to the identity on both sides, and cancels from the inside out. We induct on for that too.
Proof.
For the first, fix and induct on . At we have , by the identity laws. Suppose . Then
the second step by associativity of composition, the fourth and fifth by the recursion clauses for powers and for addition.
For the second, fix and induct on . At both sides are , since . Suppose . Then
using the first part and the recursion clause for multiplication.
For the third, induct on . At both sides are . Suppose . The first part gives , so
the second step by associativity, the third because , and the last by the inductive hypothesis. In the other order, the first part applied to gives , and
So is a two-sided inverse of , and inverses are unique.
Remark.
With the third part in hand the notation is consistent: it does not matter whether one inverts and then takes the power or takes the power and then inverts. All three laws then hold for exponents of either sign, once the statements are read with the convention ; we have written them for because that is where we have arithmetic, and a negative exponent is here an abbreviation rather than a number.
Definition 8.25 (Order of a permutation).
Let . The order of , written , is the least with , if there is one.
Proposition 8.26 (Every permutation has an order).
Let . Then for some , so is defined and lies in .
Discussion.
The claim is an existence statement, and since all we know is that is finite, we use the pigeonhole principle. We have infinitely many powers and only permutations for them to be, so two of the powers coincide. Cancelling the smaller from the larger (multiplying by an inverse, using the laws of exponents) leaves a positive power equal to the identity. Once the set of positive with is known to be non-empty, well-ordering supplies its least member, which is what the definition asks for.
Proof.
The map from to has a domain of elements and a range inside a set of elements, so it is not injective by the pigeonhole principle: there are in that block with . Write with . Composing with on the left and using the laws of exponents,
So is non-empty, and well-ordering gives it a least member, which is .
Theorem 8.27 (Powers repeat with the order).
Let with . Then are pairwise distinct, and every power with is one of them.
Discussion.
Two assertions. The second says that the list exhausts the powers, and the tool is division with remainder: writing with , the laws of exponents split into , and the first factor is the identity by the definition of the order, leaving with in range. The first assertion is a uniqueness claim and goes by contradiction: two equal powers among the first would cancel to give a positive power below equal to the identity, and the order was chosen least, so no such power exists.
Proof.
Let . Division with remainder gives with and , so by the laws of exponents
and is one of .
Suppose with and . Writing with and composing with as before gives with , contradicting the leastness of . So the powers listed are pairwise distinct.
Let
Compute until the identity appears, and state .
Show that if for some , then divides , in the sense that for some . Division with remainder is the whole of the argument.
Show that for every , and that exactly when .
Cycles and Disjoint Decomposition
Draw a point for each and an arrow from to . Because is a function, exactly one arrow leaves each point; because it is injective, exactly one arrow arrives at each. A picture of that kind can only be a collection of separate closed loops, some of them loops from a point to itself. The notation that matches the picture is the following.
Let with . A permutation is an -cycle, or a cycle of length , if there are distinct with
and for every . The set is the orbit of the cycle, written , and one writes
for this permutation. A point with is said to be moved by .
A -cycle fixes and fixes everything else, so it is the identity; in a product one leaves such factors out, since they do nothing. For the listing inside the brackets may start wherever one likes,
since all of those tables send each to the same place; and the inverse of a cycle is the same cycle read backwards,
The permutation
sends and fixes and , so , which is the same cycle as .
Definition 8.30 (Disjoint cycles).
A family of cycles in is disjoint if their orbits are pairwise disjoint: no cycle in the family moves a point moved by another.
Example 8.31 (Two disjoint cycles).
In the cycles and are disjoint, since . In two-row notation,
Products of permutations do not commute in general, but disjoint cycles do, because each acts inside its own orbit and fixes everything outside it. The argument has nothing to do with cycles, so we state it for arbitrary maps.
Theorem 8.32 (Maps with disjoint supports commute).
Let and be sets and let satisfy
- , and for every ;
- , and for every .
Then .
Discussion.
The claim is an equality of two functions with domain , so by equality of functions we compare values at an arbitrary point, and the domain is a union, so the comparison splits into the two cases and . Each case is the same short argument run with the hypotheses exchanged: one of the two maps fixes , so one composite is immediately the other map’s value at ; and that value stays in the set where the first map fixes everything, so the other composite is the same. Only the two hypotheses are used.
Proof.
Let .
If then by the second hypothesis, so ; and by the first hypothesis, so fixes it and .
If then by the first hypothesis, so ; and by the second, so fixes it and .
In both cases the two composites agree at , so they are equal.
Corollary 8.33 (Disjoint cycles commute).
If and are disjoint cycles in , then .
Proof.
Put and . Then and fixes every point of , by the definition of a cycle. Disjointness puts inside , so , and fixes every point of . The theorem applies with and .
Example 8.34 (A product of disjoint cycles).
In ,
Neither nor is moved by either factor, and the table records that by fixing them.
Every permutation is such a product.
Theorem 8.35 (Cycle decomposition).
Every permutation in is a product of pairwise disjoint cycles. The identity is the empty product, or equally a product of -cycles, which one omits from the written expression.
Discussion.
The proof is a construction together with two checks. The construction follows the arrows of the picture: start at a point, apply repeatedly, and see that the trail must return to its start. That it returns at all is the pigeonhole principle, since is finite; that it returns to the start rather than to some later point of the trail uses injectivity, and we get it by taking the first repetition and cancelling. The trail is then the orbit of a cycle on which agrees with that cycle. The first check is that a second trail, begun at a point not yet used, is disjoint from the first, which is again cancellation. The second is that the product of all the cycles obtained equals : on each orbit the product acts as the one factor that moves that orbit, by disjointness, and off all of them both sides fix every point. The process stops because each round uses at least one new point of the finite set .
Proof.
Let and let . Among the values , lying in the -set , two coincide by the pigeonhole principle. Let be least such that for some . If were positive, composing both sides with would give with , contradicting leastness. So and , and the points are pairwise distinct, again by leastness. Write
a cycle whose orbit is that set and on which agrees with .
Now build the decomposition. Put for . If every point outside is fixed by , then and we are done. Otherwise choose a point moved by and lying outside , and form . The two orbits are disjoint: if then composing with or , whichever exponent is the smaller, expresses as a power of applied to , and the theorem on powers repeating puts that power inside , contrary to the choice of .
Repeat. Each round adds at least one point to the union of the orbits, and is finite, so after finitely many rounds every point moved by lies in some orbit. Let be the cycles obtained; they are pairwise disjoint by the argument just given, applied to each pair. Their product agrees with at every point: a point in is fixed by every factor but , which sends it where does, and a point in no orbit is fixed by every factor and by . So , and the order of the factors is immaterial by the corollary on disjoint cycles.
Remark (Reading off the decomposition).
The proof is an algorithm, and it is the one used in practice. Given in two-row form, begin at any point not yet written down, apply until the starting point returns, close the bracket, and start again elsewhere. Only cycles of length at least two need be written. In the picture of arrows, the cycles are exactly the separate loops.
Remark (Uniqueness).
The decomposition is unique up to the order of the factors and up to where each bracket starts. For suppose are two products of pairwise disjoint cycles of length at least two, and let . Then , so lies in the orbit of exactly one , say after renumbering. Both and agree with on the orbit they contain in, so the two orbits are the same set — each is the trail of under — and the two cycles agree there and fix everything else, hence . Matching the remaining factors the same way shows the two collections coincide.
Example 8.36 (Three decompositions).
-
-
-
If and , the product is not written as a product of disjoint cycles, since the factors share the points and . Following each point through and then gives , which is.
Show that an -cycle has order .
Write each of the following as a product of disjoint cycles and give its order.
- , as an element of .
Let be a product of pairwise disjoint cycles of lengths . Show that exactly when every divides , in the sense of the problem on divisibility, and deduce that is the least such . Say where disjointness is used.
Show that is a transposition if and only if it is a -cycle, and that for every cycle and every .
Let and let satisfy for every . Show that . Which elements of have the same property?
Transpositions and the Sign
A -cycle exchanges and and fixes every other point of , which is exactly the transposition written in cycle notation. In particular and , which is the proposition that a transposition is its own inverse read in the new notation. Transpositions move as few points as a permutation other than the identity can, and every permutation is a product of them.
Theorem 8.37 (Factorisation into transpositions).
Let . Then every permutation in is a product of transpositions.
Discussion.
The statement is universally quantified over , and the cycle decomposition has already reduced any such statement to a statement about a single cycle: if each factor of a disjoint decomposition is a product of transpositions then so is the whole, by substitution. So there are two things to do. The identity is not covered by the decomposition, since its decomposition is empty, and it is handled separately by writing it as a transposition composed with itself. A cycle of length at least two is handled by exhibiting the factorisation outright, and the exhibited product is then checked point by point against the cycle.
Proof.
If then , which is available since .
Otherwise the cycle decomposition writes as a product of cycles of length at least two, so it is enough to factor one such cycle. We claim
Evaluate the right-hand side from the right. The point is sent to by the first factor, and is fixed by all the others, so . For , the point is fixed by every factor until sends it to , and the next factor sends to , which the remaining factors fix; so . The point is fixed until the last factor sends it to , and nothing follows, so . Any point outside the orbit is fixed by every factor. So the two sides agree everywhere.
Substituting these factorisations into the decomposition writes as a product of transpositions.
Remark (Non-uniqueness).
The transposition factors are not disjoint in general, and cannot be: a -cycle moves three points, while a product of disjoint transpositions moves an even number. The factorisation is not unique either, since may be inserted anywhere, and the order of non-disjoint factors matters, and being different permutations. What is unique is the evenness or oddness of the number of factors, and we prove this next.
To prove it we count, for a given permutation, the pairs of points whose order it reverses.
Definition 8.38 (Reversals, parity and sign).
Let and let be a -subset of , written so that . Then reverses if . Write for the number of -subsets of reversed by .
The permutation is even if is even and odd if is odd; that alternative is the parity of . The sign of is
The count exists because the -subsets of form a finite set, and each is reversed or not by the trichotomy of the order. The two values and are just labels for the parity, and the only property of the labels we shall use is that multiplying them behaves as adding parities does, with recording that two odd numbers add to an even one.
Example 8.39 (Counting reversals).
The identity reverses nothing, so and the identity is even. For
the three -subsets are , with , not reversed; , with , reversed; and , with , reversed. So and is even.
The proof uses two facts about : multiplying by a transposition of neighbours changes it by exactly one, and every permutation is a product of such transpositions. The second was set as a problem in the chapter on sequences, where it justified the claim that rearranging a sum does not change it; here it is proved, and in the language of rather than of rearrangements.
Proposition 8.40 (A neighbour swap changes one reversal).
Let , let with , and put . Then exactly one of
holds. In particular and have different parities.
Discussion.
Both and are counts over the same index set, the -subsets of , so the claim is that the two counts differ by one, and we sort the -subsets into three kinds and compare the counts kind by kind. The permutation agrees with except that its values at and are exchanged: a -subset avoiding both and sees the same two values in the same positions, so its status is unchanged; a -subset meeting exactly one of them is paired with the -subset meeting the other, and the two statuses are exchanged between the members of the pair, leaving their total unchanged; and the single -subset has its status reversed, because the two values are exchanged while the two positions are not. Summing the three kinds, the totals agree except for one, and trichotomy makes the two displayed alternatives exclusive. The last sentence is then the remainder classes at : a number and its successor never have the same parity.
Proof.
Write , so that , , and for every other . Sort the -subsets of into three kinds.
Neither point in . Both values are the same for as for , so the subset is reversed by one exactly when it is reversed by the other.
Exactly one point in . Such subsets come in pairs and with . Suppose , so that and is the smaller point in both subsets. Then reverses exactly when , which is exactly when reverses ; and reverses exactly when reverses . So the two statuses are exchanged within the pair and the number of reversed subsets among the two is the same for as for . The case is the same argument with the larger point.
The subset . Here reverses it exactly when , that is when , which is exactly when does not reverse it.
Adding the three kinds, the counts agree on the first two and differ by exactly one on the third. So is increased by one or is increased by one, and not both, by trichotomy. A number and its successor fall in different remainder classes for the divisor , so the parities differ.
Proposition 8.41 (Neighbour swaps suffice).
Let . Then every permutation in is a product of transpositions of the form with .
Discussion.
By the theorem on factorisation into transpositions the claim reduces to a single transposition with , since substituting a factorisation of each factor factorises the product. We induct on the gap between them, where . At the transposition is already a neighbour swap. For the step, conjugating a transposition by a neighbour swap moves one of its two points one place along: is , whose middle factor has a smaller gap and whose outer factors are neighbour swaps. Checking that identity is a comparison of values at the three points involved, everything else being fixed by all three factors.
Proof.
By the theorem on factorisation into transpositions it is enough to write a single transposition , with , as a product of neighbour swaps. Write with and induct on .
If then is itself a neighbour swap.
Suppose the claim holds for , and let , so that and . Put . We claim . Evaluating the right-hand side from the right: is fixed by , sent to by the middle factor, and sent to by the last, so . The point is sent to by the first factor, then to by the middle, and is fixed by the last, so . The point is sent to by the first factor, fixed by the middle, and returned to by the last, so . Every other point is fixed by all three factors. So the two sides agree everywhere.
The middle factor has gap and is a product of neighbour swaps by the inductive hypothesis, and is a neighbour swap, so is a product of neighbour swaps.
Theorem 8.42 (Properties of the sign).
Let with .
- .
- Every transposition is odd.
- If is a product of transpositions, then when is even and when is odd.
Discussion.
Three claims about the parity of . The first says that the parity of is settled by the parities of and , and we use the proposition on neighbour swaps together with the proposition that neighbour swaps suffice: writing as a product of neighbour swaps and multiplying them onto one at a time flips the parity times, so the parity of is that of shifted by ; taking to be the identity, whose count is , identifies the parity of with the parity of , and the two statements together are the claim. The second is a direct count of reversals for , sorting the -subsets by whether they meet and where their other point lies; the answer is one more than an even number. The third is then an induction on using the first two.
Proof.
For the first, write as a product of neighbour swaps. Then
by associativity, and each of the steps changes the parity of the reversal count, by the proposition on neighbour swaps. So has the parity of when is even and the opposite parity when is odd. Taking , where is even, shows that is even exactly when is even. Combining the two: has the parity of when is even and the opposite when is odd, which in the sign notation is the stated product rule.
For the second, let with , and sort the -subsets of . One meeting neither nor is not reversed, since fixes both its points. The subset is reversed, since . A subset or with is reversed exactly when lies strictly between and : if or then keeps its position relative to both, and if then is reversed because while , and is reversed because . So each such contributes two reversals and nothing else contributes, giving
which is odd.
For the third, induct on . At the claim is the second part. Suppose it holds for and let . Then , so by the first two parts
which changes the value from to or from to exactly as the parity of changes to the parity of .
Corollary 8.43 (The number of transposition factors has a fixed parity).
If are two factorisations of the same into transpositions, then and are both even or both odd.
Proof.
The third part of the theorem computes from each factorisation, giving when the number of factors is even and when it is odd. Since is one value, and cannot have different parities.
An -cycle is a product of transpositions, by the factorisation exhibited above, so
A cycle of odd length is even and a cycle of even length is odd, which reads perversely until one remembers that the length counts points and the sign counts swaps. For a product of cycles of lengths , disjoint or not, the first part of the theorem multiplies the signs together, so the product is even exactly when an even number of the are even.
Example 8.44 (Computing the sign).
For
a single cycle of length five, the sign is and is even. For
three of the four lengths are even, namely , and , so three of the four factors are odd and .
Remark (Parity as an obstruction).
Any sequence of exchanges of two of labelled objects is a product of transpositions in . If the rearrangement one is aiming at is odd, then no even number of exchanges reaches it, and if it is even, no odd number does. So parity rules out many proposed sequences of exchanges without examining the intermediate states: one only computes the sign of the target rearrangement.
Write
as a product of disjoint cycles and then as a product of transpositions, and compute in both ways.
Show that the even permutations in are closed under products and under inverses, and that the odd ones are closed under neither.
Let . Show that the even permutations in and the odd ones are equinumerous, by fixing a transposition and considering the map . Conclude that is twice the number of even permutations.
Let . Show that is a product of transpositions of the form with , and that no product of fewer such transpositions equals .
Let . Show that every permutation in is a product of transpositions of the form with , and that every permutation in is a product of factors each equal to or to .
Fifteen tiles numbered to lie in a frame with one cell empty, and a move slides into the empty cell a tile from a cell sharing an edge with it. Decide whether a sequence of moves carries the first arrangement below to the second, and prove your answer.
Binomial Coefficients
Counting the permutations of an -set asked in how many ways its points can be arranged. The remaining question of the chapter asks in how many ways they can be chosen: not how a set may be reordered, but how many subsets of a given size it has. The two questions are linked, because choosing points and then arranging them is the same as arranging of the points, and this gives the count of subsets as a quotient of factorials.
Counting Subsets
Definition 8.45 (Binomial coefficient).
Let and let be an -set. The binomial coefficient , read ” choose ”, is the number of -subsets of :
The definition names a set and the notation does not, so the first thing to check is that the count does not depend on which -set was taken. It does not: two -sets are equinumerous, and a bijection carries -subsets to -subsets in both directions, since the image of a -subset under an injection is a -subset and undoes it. The count is also finite, since the -subsets form a subset of the finite set .
Theorem 8.46 (Basic properties of binomial coefficients).
Let . Then
- and ;
- whenever ;
- whenever ;
- , and when ;
- .
Discussion.
The first four parts follow from the definition, by naming the subsets counted. For the first, the empty set is the one -subset of anything and is the one -subset of itself, both by cardinality classifying finite sets. The second is the theorem on subsets of a finite set, which forbids a subset larger than the whole. The third is an equality of two counts, so it asks for a bijection between the two collections, and complementation is one, being its own inverse. The fourth counts singletons and then applies the third. The fifth is different: it is a statement about a sum, so we partition by cardinality — the classes are pairwise disjoint and cover it, since every subset of a finite set is finite with exactly one cardinality — and add the pieces up with the cardinality of a disjoint union, the total being by the problem on power sets.
Proof.
Fix an -set .
For the first, a -subset is equinumerous with and hence empty, so is the only one; an -subset has , so by the theorem on subsets of a finite set, which makes a proper subset strictly smaller.
For the second, a -subset would give by that theorem, contradicting ; so there are none.
For the third, sends -subsets to -subsets, by the cardinality of a disjoint union applied to , and it is its own inverse, hence a bijection between the two collections. Equinumerous finite sets have equal cardinality.
For the fourth, is a bijection from onto the collection of -subsets, so ; the third part then gives .
For the fifth, every subset of is finite with exactly one cardinality, and that cardinality is at most by the theorem on subsets of a finite set, so the collections of -subsets for are pairwise disjoint and their union is . Adding their cardinalities gives
the last equality being the problem on the cardinality of a power set.
The link between choosing and arranging is made by counting the injections between two finite sets, so we count them first.
Proposition 8.47 (Counting injections).
Let be a -set and an -set with . Then the number of injections is
the product of the numbers running down from .
Discussion.
A count again. An injection is built by choosing values one point at a time, and each choice removes one candidate from the target, so we induct on , with fixed and fixed. At the domain is empty, the empty function is the only function and it is injective, and the empty product is . For the step we split the injections from a -set according to the value taken at a chosen point : the pieces are pairwise disjoint and cover, there are of them, and each is matched by restriction with the injections from a -set into a set with one point removed, which the inductive hypothesis counts. Adding equal pieces is the cardinality of a product, and the arithmetic gives the next factor down because the removed point shrinks the target from to and shifts every factor.
Proof.
Induct on , the claim being taken for all and all -sets at once.
If then , the empty function is the unique function and is injective, and the empty product is .
Suppose the claim holds for and let . Fix and, for , let be the set of injections with . Every injection lies in exactly one . Restriction to matches with the injections from that -set into , an -set: an injection cannot take the value anywhere else, so the restriction lands there, and every injection extends to exactly one member of . By the inductive hypothesis,
Summing over the values of , the number of injections is
which is the claim at .
Theorem 8.48 (Factorial formula for binomial coefficients).
Let with . Then
Discussion.
The claim is an identity between products of natural numbers, and the method is to count one set in two ways and equate the answers. The set is the collection of injections from a -set into an -set . Counted directly, the previous proposition gives the descending product. Counted by what an injection is made of, an injection is an image together with a bijection onto it: the image is a -subset of , of which there are , and the bijections from onto a fixed -subset number by the theorem on the number of bijections. Equating the two answers gives equal to the descending product, and multiplying by completes the descending product to , which is the displayed identity.
Proof.
Fix an -set and a -set , and let be the set of injections . By the proposition on counting injections,
Count a second way. Each determines its image , a -subset of , and is a bijection from onto that image, by an injection onto its range. Conversely a -subset together with a bijection determines an , and different pairs give different injections. There are choices of and, for each, exactly bijections by the theorem on the number of bijections. So
Equating and multiplying both sides by ,
the last step because the descending product and between them use each of the factors exactly once. When both sides are , so the identity holds there too.
Remark.
The identity is normally written as a quotient,
and we shall write it that way below. The division is exact by the theorem, and we allow it on the same terms as subtraction: whenever the answer lies in . For computing a single coefficient by hand the descending product is faster,
while the two-factorial form is the better one to manipulate.
Theorem 8.49 (Pascal's identity).
Let with . Then
Discussion.
The claim is that one count equals a sum of two counts, and a sum of counts comes from a partition of the set being counted. So we fix an -set , single out a point of it, and sort the -subsets of by whether they contain : two collections, disjoint and exhaustive. Those avoiding are exactly the -subsets of the -set , which is the first term. Those containing are matched with the -subsets of by removing , a map undone by putting it back, which is the second. The cardinality of a disjoint union adds them.
Proof.
Let be an -set, fix and put , an -set.
A -subset of either contains or does not, and not both. Those that do not are precisely the -subsets of , and there are of them.
Those that do are precisely the sets with a -subset of : removing from such a subset leaves a subset of of cardinality , by the corollary on removing a point, and adjoining to a -subset of returns it. So there are of them.
The two collections are disjoint and their union is the collection of all -subsets of , so their cardinalities add to .
Pascal’s identity together with the boundary values determines every binomial coefficient without any factorials at all, each from two earlier ones. Setting the values out in rows indexed by , with running left to right, gives Pascal’s triangle:
Each interior entry is the sum of the two entries above it, one directly above and one to the left of that, which is Pascal’s identity. The rows add to , which is the fifth part of the theorem on basic properties, and each row is a palindrome, which is the third.
Example 8.50 (Two small counts).
The number of -subsets of a -set is
and the number of -subsets is
Example 8.51 (Shortest routes).
On a grid of streets blocks tall and blocks wide, a shortest walk from the bottom left corner to the top right uses blocks, of which are walked upwards and across. Such a walk is settled by saying which of its steps are the ones across, so there are shortest routes. On a square grid blocks each way there are .
Compute , and from the factorial formula, and check the first two against the symmetry .
Prove the factorial formula a second time, by induction on with Pascal’s identity as the inductive step, treating and separately.
How many -subsets does a -set have? If the -set is partitioned into four -sets, how many of those -subsets lie inside a single part?
Identities and the Binomial Theorem
Let with . Then
Discussion.
An identity between two products, so again we count one set in two ways. The set is the collection of pairs in which is a -subset of an -set and is a point of — a committee together with its chair, if one likes. Choosing the committee first and then the chair from within it gives followed by , which is the left-hand side; choosing the chair first from all of and then the rest of the committee from what remains gives followed by , which is the right. Each count is an application of the cardinality of a product to a partition of the same collection, sorted the two different ways. The factorial formula gives a second proof by cancellation, and we record that as well.
Proof.
Let be an -set and let be the set of pairs with a -subset of and .
Sorting by its second coordinate, each of the possible occurs in exactly pairs, one for each of its points, so .
Sorting by its first coordinate, each of the possible occurs in one pair for each -subset containing ; those are the sets with a -subset of , as in the proof of Pascal’s identity, so there are of them. Hence .
Equating the two gives the identity. Alternatively, from the factorial formula,
Theorem 8.53 (The hockey-stick identity).
Let . Then
Discussion.
The left-hand side is a sum whose number of terms depends on , so the proof is an induction on with held fixed. At both sides are , by the first part of the theorem on basic properties. The step adds one term to the sum: the inductive hypothesis replaces everything before it by a single coefficient, and what is left is a sum of two coefficients to which Pascal’s identity applies. So the whole argument is one application of the inductive hypothesis followed by one application of Pascal, and the only care needed is in matching the indices.
Proof.
Fix and induct on . At the sum has the single term , and the right-hand side is .
Suppose the identity holds at . Then
the second line by the inductive hypothesis and the third by Pascal’s identity, applied with upper index and lower index .
Remark.
The name records the shape the summed entries make in Pascal’s triangle: they run down one diagonal and the answer sits one place off the end, like the blade at the foot of a stick.
A binomial is a sum of two terms, and expanding a power of one produces the binomial coefficients as the coefficients of the resulting terms. That is where the name comes from.
Theorem 8.54 (The binomial theorem).
Let and let . Then
Discussion.
Behind the statement is a count: multiplying out copies of produces one term for each way of taking from some of the copies and from the rest, so appears once for each -subset of the copies, which is times. That is the reason the theorem is true, but it is not yet a proof, because “multiplying out” is not among our operations. What we have is the recursion defining powers, so the proof is an induction on : multiply the inductive hypothesis by , distribute, and reassemble. Pascal’s identity appears in the reassembly: after shifting the index of one of the two sums so that both run over the same power of , the two coefficients standing in front of each term are and , which Pascal’s identity adds to the coefficient wanted at .
Proof.
Induct on . At both sides are , the left because and the right because the only term is .
Suppose the identity holds at . Then, distributing,
In the first sum put , so that runs from to :
Renaming as and separating the terms and , which occur in only one of the two sums each,
by Pascal’s identity, and the two separated terms are the cases and since .
Remark (Where the theorem applies).
The proof uses nothing about and beyond the commutative, associative and distributive laws and the recursion defining powers. So it holds verbatim wherever those laws hold — for the real numbers of school algebra, and for expressions in an unknown — and that is how it is used in practice. We have stated it in because that is the arithmetic built so far.
Corollary 8.55 (Sum of the binomial coefficients, again).
For every ,
Proof.
Put in the binomial theorem: every term is , and the left-hand side is .
That is the fifth part of the theorem on basic properties, proved a second time and by quite a different route: the first proof partitioned the power set, and this one multiplies out a product. The first proof and the corollary together give a proof that , running in the opposite direction to the one the problem asked for.
Example 8.56 (A single coefficient).
Working in school algebra, where the theorem applies by the remark above, the coefficient of in is the coefficient of in
namely . Only one term of twelve is needed.
Show that for every the binomial coefficients with even lower index add to the same total as those with odd lower index, and that each total is .
Expand in two ways and compare the coefficients of to obtain Vandermonde’s identity
for and , reading as when . Then prove the same identity by counting the -subsets of a set split into an -set and an -set.
Show that exactly when , and read off from that where a row of Pascal’s triangle attains its largest entry, treating and separately. The absorption identity compares consecutive entries of a row.
Show that
for every .
Multinomial Coefficients
A binomial coefficient counts the ways of cutting an -set into two labelled pieces of prescribed sizes: a -subset and everything else. The same works with more than two pieces.
Definition 8.57 (Multinomial coefficient).
Let , let , and let with . Let be an -set. The multinomial coefficient
is the number of -tuples of pairwise disjoint subsets of with and for each . Empty pieces are allowed, when some is .
The pieces are labelled by their position in the tuple, so two tuples listing the same pieces in a different order are different objects; the same convention was already in force for binomial coefficients, where the -subset was distinguished from its complement. Equivalently, such a tuple assigns each point of to one of labelled bins, with bin receiving points.
At the definition returns the binomial coefficient, since a pair of the required kind is settled by alone:
Theorem 8.58 (Factorial formula for multinomial coefficients).
Let with each . Then
Discussion.
Once more we count one set two ways, and the set is the collection of listings of an -set — that is, of bijections . Counted directly there are of them, by the theorem on the number of bijections. Counted by construction, a listing is assembled from a tuple of the kind the coefficient counts, together with an ordering inside each piece: read the first entries of the listing as the first piece in order, the next as the second, and so on. That correspondence is reversible, so the number of listings is the number of tuples multiplied by through , one factor for each piece by the theorem on the number of bijections again. Equating the two counts is the identity.
Proof.
Let be an -set. The listings of , meaning the bijections , number .
Given a listing , cut into the consecutive blocks of lengths and let be the image of the -th block. The blocks are pairwise disjoint and cover , so the are pairwise disjoint and cover , and since is injective. The listing also determines an ordering of each , namely the order in which its points appear.
Conversely a tuple of the required kind, together with an ordering of each , reassembles into exactly one listing, by writing the pieces out one after another. So the listings correspond to such data, and there are tuples with orderings of the -th piece for each. Hence
where a piece with contributes the factor .
Remark.
As before we write the identity as a quotient,
the division being exact by the theorem. The multinomial coefficient can also be built from binomial ones by choosing the pieces in turn, which is the content of a problem below.
Example 8.59 (Assigning students to projects).
Nine students are to be assigned to three named projects needing four, two and three students. The assignments number
Had the projects been unnamed and only their sizes fixed, the count would be different, since the pieces would no longer be distinguished by position.
Example 8.60 (A bag of shopping).
A bag is packed with four bananas, five tins of tuna, two boxes of cereal, four lemons, three bottles of cola and six light bulbs, twenty-four items in all, alike within each kind and distinguishable between kinds. The orders in which the bag can be packed number
since an order is settled by saying which of the twenty-four positions each kind occupies.
Theorem 8.61 (The multinomial theorem).
Let and let . Then
the sum running over all -tuples in with .
Discussion.
The statement generalises the binomial theorem from two summands to , and it is proved the same way, by induction on with the recursion for powers supplying the step. The bookkeeping is heavier because the terms are indexed by tuples rather than by a single number, so we describe the step first: multiplying by and distributing turns each term indexed by a tuple summing to into terms, one for each coordinate raised by one, and every tuple summing to arises this way from exactly the tuples obtained by lowering one of its positive coordinates. Collecting like terms, the coefficient wanted at is the sum of the coefficients at over those predecessors, and that sum identity is Pascal’s identity in its multinomial form, which the factorial formula supplies directly.
Proof.
Write for the set of -tuples in summing to . We first record the identity, for ,
which follows from the factorial formula: the -th summand is multiplied by and divided by , so the whole sum is multiplied by and divided by .
Now induct on . At the only tuple is and both sides are .
Suppose the identity holds at . Multiplying by and distributing,
Each inner term is for the tuple got from by raising the -th coordinate by one; and conversely each tuple in arises exactly once from each tuple got by lowering one of its positive coordinates. Collecting the terms belonging to a fixed , its coefficient is
by the recorded identity, which is the claim at .
Remark.
At the theorem is the binomial theorem and the recorded identity is Pascal’s, since a tuple has two coordinates to lower. The remark about where the binomial theorem applies carries over unchanged: the proof uses only the commutative, associative and distributive laws.
Example 8.62 (A term with no unknown in it).
Working in school algebra, a term of the expansion of
has the form
with . All three exponents vanish exactly when , which forces and each . So the constant term is when is four times , and otherwise.
Show that
whenever , by choosing the pieces one after another. Then check the identity a second time from the factorial formulas.
How many distinct arrangements are there of the eleven letters of ? State the count as a multinomial coefficient before evaluating it.
Expand by the multinomial theorem, and check the answer by multiplying the three factors out directly. How many terms does the expansion of have, before like terms are collected, and how many after?
Let . By counting the partitions of a -set into -subsets, show that is divisible by and not by .
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.
The coefficient of in is:
The largest order of an element of is:
The largest order of an element of is:
An element of of order is:
In let and .
The number of with is:
The number of with is:
For let be the number of permutations of an -set that move every point of it.
For , the sum equals:
Let and . The integers are placed in order, clockwise, at of positions spaced round a circle, so that no two consecutive integers, and included, sit in adjacent positions. Arrangements that differ by a rotation of the circle count as the same.
The number of such arrangements 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 ⟨ ⟩.
This chapter asks four new things of the checker: the factorial and the binomial coefficient on , the powers of a map, a name for a permutation, and the transposition as a map in its own right. The arithmetic comes first, written the way the Peano sheet wrote addition.
Factorials and binomial coefficients
The factorial of Definition 8.8 is written n !, with a space, since n! is a single name to Lean. Like addition, it is not computed, and its two clauses are equations to rewrite with:
Nat.factorial_zero 0 ! = succ 0
Nat.factorial_succ (succ n) ! = succ n * n !The binomial coefficient choose n k of Definition 8.45 is a count of subsets, and the checker has no counts, so it takes instead what Theorem 8.46 and Theorem 8.49 proved about that count:
Nat.choose_zero_right choose n 0 = succ 0
Nat.choose_eq_zero_of_lt n < k → choose n k = 0
Nat.choose_succ_succ choose (succ n) (succ k) = choose n k + choose n (succ k)The last is Pascal’s identity with both indices moved up by one, so that no subtraction appears.
Example.
, from the two clauses and the arithmetic of the Peano sheet.
Example.
A -subset of the empty set would be larger than the set it sits in.
The first part of Problem 8.4 .
The second half of the first part of Theorem 8.46 , this time from Pascal’s identity rather than by naming the one -subset.
The first half of its fourth part.
Powers
The power of Definition 8.22 is written σ^[t], which is Lean’s own notation for a map composed with itself times. The recursion is not computed either, and its clauses are
Function.iterate_zero_apply σ^[0] x = x
Function.iterate_succ_apply σ^[succ t] x = σ^[t] (σ x)the second being read at a point. The checker cannot form an inverse, so the laws set below are the ones that need none.
Example.
The first part of Theorem 8.24 , by induction on . The point is left under the quantifier so that the inductive hypothesis can be used at . The result is listed below as Function.iterate_add_apply.
The second part.
The first half of Theorem 8.27 , with the division already made: is any exponent at which is the identity.
Permutations and transpositions
Definition 8.1 is the last sheet’s BijOn with the two sets equal, and it is written
Perm σ A is BijOn σ A Aso obtain ⟨hm, hi, hs⟩ takes a permutation apart and refine ⟨?_, ?_, ?_⟩ builds one. An equation between two maps on a set is read at each point of the set, as equality of functions reads it.
The transposition is written swap a b. Its value at depends on whether is , or neither, and the checker cannot decide an equation between two objects, so its definition comes as three equations:
swap_apply_left swap a b a = b
swap_apply_right swap a b b = a
swap_apply_of_ne_of_ne x ≠ a → x ≠ b → swap a b x = xAn argument about swap a b x for an unknown x goes by cases, and excluded middle supplies them: rcases Classical.em (x = a) with h | h leaves one goal with h : x = a and one with h : ¬x = a.
Example.
A transposition is its own inverse. It is listed below as swap_swap.
Theorem 8.32 , read at each point of .
A transposition is a permutation of any set that holds its two points.
The second part of Problem 8.16 for a cycle of length two, with in the place of .
The identity from the proof of Proposition 8.41 , with in the place of .
Part of Problem 8.3 : is a permutation of the domain of . The checker cannot invert a bijection, so arrives as , together with the two equations that make it the inverse.
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 |
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 |
Lesson 9
Groups
Taught
Operations and Semigroups
The last chapter produced a set with a multiplication on it. The permutations of a set compose, the composite is again a permutation, the composition is associative, there is an identity, and every element has an inverse. None of those five facts mentions what a permutation is. This chapter keeps the five facts and drops the permutations. Many other sets with an operation satisfy the same five facts, so a result proved from them holds for all of these at once.
Operations
Let be a non-empty set. An operation on is a function
One writes for the value of at the ordered pair . The pair is a set equipped with an operation.
Two things are asked for. The first is that a value is named for every ordered pair of elements, which is what makes a function on all of . The second is that the value lands back in , and one says that is closed under . Writing instead of is only notation; the object underneath is still a function, and two operations are equal exactly when they agree at every pair.
Example 9.2 (Operations already in hand).
- and , with addition as built in the chapter on the natural numbers and multiplication as defined in its problems. So are and , since a sum or product of positive numbers is positive.
- For a non-empty set , the Cartesian power , the set of all functions , carries composition, . Its subset of permutations is closed under the same operation, since composition sends bijections to bijections; that closure is what let us write at all.
- For any set , the power set carries both and .
- On a totally ordered set , the rule sending to whichever of and is the larger is an operation, since comparability names one of them and antisymmetry makes the choice unambiguous when they are equal.
- On any non-empty , the rule (keep the left factor) is an operation.
Example 9.3 (Two failures of closure).
Call prime if and the only dividing are and , in the sense of divisibility. The primes are closed under neither addition nor multiplication: and , and neither is prime. Restricting or to the primes therefore does not produce an operation on them, and the restricted function is not a function into the primes at all.
The odd numbers show that the two can differ. They are closed under multiplication, since the remainder classes write two odd numbers as and , whose product is ; they are not closed under addition, since .
Definition 9.4 (Closed subsets).
Let be an operation on and let be non-empty. Then is closed under if for all . In that case the restriction of to is an operation on , and is a substructure of .
Closure is all that must be checked. Every named structure below (semigroup, group, subgroup) is this definition with further conditions added, and each further condition is either always inherited or always needs checking.
Example 9.5 (A substructure of the natural numbers).
Fix and let be the multiples of . If and then by distributivity and , so is closed under both operations and is a substructure of and of .
Associativity and Commutativity
Definition 9.6 (Associative and commutative operations).
Let be an operation on .
- The operation is associative if for all . In that case is a semigroup.
- The operation is commutative if for all . A commutative semigroup is also called abelian.
Both conditions are equalities required to hold identically, so both are inherited by every substructure: a law true of all elements of is in particular true of all elements of a subset. We note this once here rather than re-checking it in each example.
Example 9.7 (Which of them associate).
Addition and multiplication on are associative and commutative by the laws of addition and the corresponding laws of multiplication. Composition on is associative by the theorem on associativity of composition, so and are semigroups under . Union and intersection on are associative and commutative by the basic properties of unions and by the algebra of intersection. Taking the larger of two elements of a totally ordered set is associative and commutative, both sides of each law naming the largest of the elements involved.
Keeping the left factor, , is associative, since both and are , and is not commutative as soon as has two distinct points.
Composition shows that the two conditions are independent. It is associative on every , and already in there are permutations with , as the worked product of the last chapter showed in . Associativity is the more useful of the two, because of the next theorem.
Products of Many Factors
Definition 9.8 (Left-associated product).
Let be a set with an operation and let with . The left-associated product is defined by the recursion
A full bracketing of is either the single term , when , or an expression in which is a full bracketing of and is a full bracketing of , for some .
Theorem 9.9 (General associativity).
Let be a semigroup, let and let .
- For every ,
- Every full bracketing of equals .
- If is commutative and is obtained from by exchanging two neighbouring entries, then .
Discussion.
This is the theorem on general associativity and neighbour swaps with replaced by , and the earlier proof never mentioned : it used the associativity of for the first two parts and its commutativity for the third, and nothing else. So the argument transfers unchanged. We repeat the main step, which is the first part, the splitting identity, which says a left-associated product may be cut anywhere; it is an induction on the length of the second block, with the recursion clause as the base and a single application of associativity in the step. The second part is then an induction on in which a bracketing is split at its own top-level cut and the two halves identified by the inductive hypothesis. The third puts the exchanged pair in the middle by two applications of the first part, exchanges it by commutativity, and reassembles.
Proof.
For the first part, fix and induct on the length of the second block, so that . If the assertion is , which is the recursion clause. Suppose it holds at . Then
by the recursion clause, the inductive hypothesis, associativity, and the recursion clause again.
The second and third parts are the two parts of the earlier theorem, whose proof used only the binary laws just used here; substituting for throughout gives the argument verbatim, with the first part standing in for the splitting identity recorded there.
The second part allows us to write with no brackets at all in a semigroup, and we do so from here on. The third part allows exchanging neighbours when the operation commutes, and neighbours are enough, because the last chapter proved that every rearrangement is a string of neighbour exchanges.
Corollary 9.10 (Rearranging a product).
Let be an abelian semigroup, let and let . Then
Proof.
The proposition that neighbour swaps suffice writes as a product of transpositions of neighbouring points. Applying the third part of the theorem once for each carries the list to without changing the left-associated product, and the second part identifies that product with the bracket-free expression on either side.
Remark.
The corollary uses results from three chapters. The bracketing was settled for sums in the chapter on sequences, the reduction of an arbitrary rearrangement to neighbour exchanges was set as a problem there and proved in the chapter on permutations, and the assembly is one line. Nothing about was used, so the statement holds for unions, for intersections, for the larger-of-two operation, and for every abelian semigroup yet to be met.
On define an operation by the table
the entry in row and column being . Decide whether is associative and whether it is commutative.
Let be non-empty and define , keeping the right factor. Decide whether is associative and whether it is commutative, and compare with the left-factor rule.
Let be an abelian semigroup and let for and . Show that forming the products along the rows and then combining, and forming them along the columns and then combining, give the same element of .
Identity, Inverses and Groups
A semigroup asks one law of its operation. Two further conditions, an identity element and an inverse for each element, give a group. We look at each condition separately first.
The Identity
Definition 9.11 (Identity element).
Let be a set with an operation. An element is an identity for if
A semigroup with an identity is called a monoid.
An operation written additively usually has its identity written , and one written multiplicatively usually has it written . The choice is only notation. The definition asks for the law on both sides, and the next section shows why one side alone is weaker.
Proposition 9.12 (Uniqueness of the identity).
An operation has at most one identity.
Discussion.
The claim is a uniqueness statement, so we suppose two identities and and derive . We evaluate one product in two ways: reading with the left factor as the identity gives , reading it with the right factor as the identity gives , so the two are equal. No associativity is needed, which is why the proposition is stated for an operation and not for a semigroup.
Proof.
Let and be identities for . Since is an identity, . Since is an identity, . Hence .
Example 9.13 (Identities in the running examples).
The identity for on is , and the identity for on and on is . Composition on has the identity map as its identity, by the identity laws, and the same map serves for . On the identity for is and the identity for is . Taking the larger of two elements of a totally ordered set has an identity exactly when the set has a minimum, which is then the identity.
Two of the examples have none. Keeping the left factor has no identity once has two distinct points: an identity would satisfy for every , whereas , forcing every to equal . And has no identity, not because no element behaves like one but because the element that would, namely , is not in the set.
Inverses
Definition 9.14 (Inverse element).
Let be a set with an operation and with identity , and let . An element is an inverse of if
If has an inverse, is invertible.
Multiplicative notation writes for the inverse and additive notation writes . The two-sided demand is the same shape as the one made of inverse functions, and for the same reason: a one-sided inverse is weaker unless associativity lets us combine the two sides, as in the next proposition.
Proposition 9.15 (Uniqueness of inverses).
Let be a monoid and let be invertible. Then has exactly one inverse.
Discussion.
Uniqueness again, so we take two inverses and of the same and show they agree. We form one expression that can be read as either: put between them, as , and bracket it the two available ways. Bracketing to the right uses that is an inverse and leaves ; bracketing to the left uses that is one and leaves . The re-bracketing uses associativity, and without it the argument fails.
Proof.
Let and be inverses of . Then
So one may speak of the inverse of an invertible element, and write for it. Two consequences follow at once. First, is invertible with , since . Second, : the defining equations are unchanged when and are exchanged, so is an inverse of , and uniqueness makes it the inverse.
Proposition 9.16 (Inverse of a product).
Let be a monoid and let be invertible. Then is invertible and
Discussion.
There are two assertions, an existence claim and a formula, and one calculation settles both: if the element named on the right multiplies with to give on both sides, then is invertible and, by the uniqueness just proved, that element is the inverse. The check is a product of four factors, which general associativity lets us write without brackets; cancelling the inner pair leaves , and cancelling that leaves . The order is reversed so that the inner pair is adjacent.
Proof.
Using general associativity to drop brackets,
and in the same way . So is an inverse of , and by uniqueness it is the inverse.
The reversal is not new. It is the inverse of a composition met for functions, and the rule used without comment for permutations. The proof here covers both, and every other monoid as well.
Proposition 9.17 (The invertible elements).
Let be a monoid with identity and let
Then ; if then ; and if then . So is a monoid with identity , in which every element is invertible.
Discussion.
Three closure claims and then a summary that follows from them. That was noted above, being its own inverse. That is closed under is the previous proposition, which not only says is invertible but names the inverse, so nothing further is needed. That is closed under inversion is the remark that , which exhibits an inverse for . The summary then needs only that associativity and the identity laws are inherited by a subset, which they are, being laws required of all elements.
Proof.
From we get with . If then is invertible by the previous proposition, so , and is closed under . If then exhibits as an inverse of , so .
Hence is a closed subset containing , and it inherits associativity and the identity laws from . Each of its elements is invertible, and its inverse lies in , so is a monoid in which every element is invertible.
Example 9.18 (Who is invertible).
In only is invertible, since forces by the corollary on sums that vanish. In only is invertible. In under only is invertible, and under only .
The main example is composition. In the monoid the invertible elements are exactly the bijections , by the theorem on invertibility and bijections; that is to say, they are exactly the permutations, and the set they form is . The previous proposition, applied to , is therefore the statement that is closed under composition and under inversion. We proved this twice already, once for functions and once for permutations; here it follows from a proposition about monoids.
Let be an operation on with a left identity , meaning for every , and a right identity , meaning for every . Show that , and that it is then an identity. No associativity is needed.
Show that under the left-factor rule every element of is a right identity, and that under the right-factor rule every element is a left identity. So a one-sided identity need be neither unique nor accompanied by one on the other side, and neither rule has an identity once has two distinct points.
Let be a monoid and let satisfy and . Show that , so that is a two-sided inverse of . Which hypothesis fails if is only a set with an operation?
Groups
A group is a monoid in which every element is invertible: a set with an associative operation, an identity , and an inverse for each of its elements. A group whose operation is commutative is abelian, in the sense already fixed for semigroups.
The proposition on invertible elements now reads: the invertible elements of any monoid form a group. Applied to under composition it says that is a group, without using anything about permutations.
Example 9.20 (Groups already met).
- For any non-empty set , the symmetric group under composition. For this is , with by the count of bijections.
- The dihedral group . That it is closed under products and inverses was a problem of the last chapter, and the identity permutation is a symmetry of every polygon, so is a group with .
- The even permutations in , closed under products and inverses by another problem there. For this group is written and called the alternating group on letters.
- The one-element set with the only operation available to it. It is a group, called the trivial group, and it is the smallest group, since a group must contain an identity.
- , the smallest group with more than one element. Its whole multiplication is , which is the proposition that a transposition is its own inverse.
None of , and is a group. The first is a monoid in which only is invertible; the second has no identity at all; the third is a monoid in which only is invertible.
Remark (The groups not yet available).
The familiar first examples of groups are the integers under addition and the non-zero rationals or reals under multiplication. We do not have them: the integers are the subject of the next chapter, and they are built by adding to the inverses it lacks. The examples above are the ones already constructed, and they are enough to prove everything in this chapter; the arithmetic ones become further examples once they are built.
The definition asks for a two-sided identity and two-sided inverses, four conditions in all. The two left-handed ones already imply the others.
Theorem 9.21 (A left identity with left inverses is enough).
Let be a semigroup. Suppose there is with for every , and suppose that for every there is with . Then is an identity, every such is an inverse of , and is a group.
Discussion.
The statement is an implication from a shortened list of axioms to the full one, so we assume the two left-handed conditions and must produce the two right-handed ones. We apply the hypotheses repeatedly and re-bracket, in a particular order: the right-inverse law must come first, because the right-identity law is proved from it.
To get , take a left inverse of and then a left inverse of . Insert in front of using the left identity, replace that by , and re-bracket so that becomes adjacent; that inner pair becomes , which the left identity removes, leaving . Once is known, can be written as , re-bracketed to , which is the right-identity law. No appeal to uniqueness is needed anywhere; the calculation gives the two-sided laws directly.
Proof.
Fix , choose with , and choose with . Then
using the left identity, the choice of , associativity, the choice of , and the left identity again. So is a right inverse of as well as a left one.
Consequently
so is a right identity as well as a left one. Hence is an identity, each has the two-sided inverse , and is a group.
Remark (Right axioms, mixed axioms).
The same argument with left and right exchanged shows that a right identity together with right inverses is equally sufficient. A left identity paired with right inverses is not enough, and a counterexample with two elements exists; producing one is a problem below. So the two halves of the definition may be dropped in matching pairs but not in mismatched ones.
Proposition 9.22 (Cancellation in a group).
Let be a group and let . If then ; and if then .
Discussion.
Two implications of the same shape, and the second is the mirror image of the first, so only one need be written out. In each the hypothesis is an equation with a common factor on one side, and the way to remove a factor is to introduce its inverse on that same side and re-bracket: the inverse then meets and the pair becomes , which the identity law removes. Both the associativity and the existence of are used, and each once.
Proof.
Suppose . Then
The second implication is the same computation with applied on the right.
Cancellation says exactly that, for each fixed , the maps and are injective. When is finite they are therefore bijective, so each of the equations and has exactly one solution. In fact they are bijective whether or not is finite, since undoes the first; the finite case is worth noting separately, because it uses nothing about inverses and so applies to semigroups that are not groups.
Definition 9.23 (Regular semigroup).
A monoid in which cancellation holds on both sides (that is, implies , and implies ) is called regular.
Every group is regular, by the proposition. The converse fails, and our standard examples show it.
Example 9.24 (The natural numbers cancel).
is regular, since implies by the cancellation problem of the chapter on the natural numbers. It is not a group. Multiplication on is regular too: if with positive and, say, , write and cancel to get , whence because a product of positive numbers is positive. It is not a group either.
So regularity is strictly weaker than being a group, and it is the condition we need of a monoid we want to enlarge into a group. That is what the next chapter does to .
Construct a semigroup with a left identity in which every element has a right inverse, but which is not a group. Two elements suffice.
Let be a finite group and write out its multiplication table, the entry in row and column being . Show that every element of occurs exactly once in each row and exactly once in each column.
Show that is not regular, and that under is not regular once is non-empty.
The symmetric difference , the set of objects lying in exactly one of and , was met in the exercises of the chapter on sets. Show that is an abelian group, and identify its identity and the inverse of each element.
Subgroups
Let be a group with identity and let be non-empty. Then is a subgroup of if , if for all , and if for all . A subgroup other than and is called proper.
The three conditions say precisely that is itself a group under the restricted operation, and nothing extra is assumed. Suppose is a closed subset that happens to be a group in its own right, with identity . Then holds in , and cancelling there gives : a subset cannot have an identity of its own. Likewise the inverse of computed inside is an inverse of inside , so uniqueness of inverses makes it . The conditions listed are therefore necessary as well as sufficient, and they may be checked by computing in .
Proposition 9.26 (One-step subgroup criterion).
Let be a group and let be non-empty. Then is a subgroup of if and only if for all .
Discussion.
A biconditional between the three conditions of the definition and a single one, and one direction is much easier than the other. Forwards is immediate: a subgroup contains and is closed, so it contains . Backwards, we get the three conditions from the one by choosing and suitably. Non-emptiness supplies some to start from; taking produces ; taking then produces for every ; and once inverses are available, the product is , which the hypothesis covers. Each step uses the hypothesis once, and the steps must come in this order.
Proof.
Suppose is a subgroup and let . Then , so .
Conversely suppose whenever . Since is non-empty, choose ; taking gives . Now let ; taking the pair gives , so is closed under inverses. Finally let ; then , so taking the pair gives . Hence satisfies the three conditions.
Example 9.27 (Subgroups already met).
is a subgroup of , and for the alternating group is a subgroup of . Inside , the permutations fixing a chosen point form a subgroup: the identity fixes , a composite of two maps fixing fixes , and if then . Every group has the two subgroups and .
For each the multiples of form a subgroup of the integers under addition, an example we can state properly once the integers are built.
Show that a non-empty finite subset of a group that is closed under the operation is already a subgroup. For fixed the map sends into ; use finiteness to make it surjective, and read off and .
Show that an intersection of subgroups of is a subgroup of , for any non-empty indexed family of them. Show by example that a union of two subgroups need not be one.
List every subgroup of , and check each against the one-step criterion.
Homomorphisms and Quotients
A subgroup cuts a group into pieces of equal size, and sometimes the pieces form a group themselves. The last notion of this chapter is a map that respects the operation.
Cosets
Let be a subgroup of a group and let . The right coset and the left coset of by are
Proposition 9.29 (The right cosets partition the group).
Let be a subgroup of a group and define to mean . Then is an equivalence relation on whose classes are exactly the right cosets of . Moreover for every , when is finite.
Discussion.
Three assertions. The first asks for the three defining properties of an equivalence relation, and each comes from one of the three subgroup conditions: reflexivity is , symmetry is closure under inverses applied to , and transitivity is closure under the operation applied to a product that telescopes. The second is an equality of sets, so it is two inclusions, and both come from writing an element of one side in the form the other side demands. The third is a counting claim, and since cardinality classifies finite sets it is enough to produce a bijection ; the map is one, being surjective by the definition of the coset and injective by cancellation.
Proof.
For reflexivity, , so . For symmetry, if then its inverse lies in , so . For transitivity, if and then their product
lies in , so .
For the classes, fix . If then and . Conversely if with then , so . Hence .
For the count, the map from to is surjective by the definition of and injective by cancellation, hence a bijection, so the two sets have the same cardinality.
Since the classes of an equivalence relation partition the set, the right cosets partition into pieces all of the same size as . The left cosets do the same, by the mirror argument with .
Let be a finite group and a subgroup. Show that is the product of with the number of right cosets of . Deduce that divides .
Show that the left cosets of partition as the right cosets do, and that the two partitions have the same number of pieces, by checking that is a well-defined bijection between them.
Homomorphisms
Definition 9.30 (Homomorphism).
Let and be groups. A function is a homomorphism if
Its kernel is , the preimage of the identity of , and its image is . A bijective homomorphism is an isomorphism; groups with an isomorphism between them are isomorphic, written . An isomorphism from a group to itself is an automorphism. Throughout, and are the identities of and of .
The same symbol denotes two different operations, one on each side of the equation, and that is deliberate: the condition says that computing in and then transporting gives the same answer as transporting and then computing in .
Proposition 9.31 (Homomorphisms respect the identity and inverses).
Let be a homomorphism. Then and for every .
Discussion.
Neither conclusion is assumed by the definition, which mentions only products, so both must be derived from the product condition. For the first, is characterised inside by ; applying turns that into an equation about alone, and cancellation in finishes it. For the second, apply to the defining equation and use the first part: the result says is an inverse of , and inverses are unique.
Proof.
From we get , and cancelling on the left gives .
Then , and likewise . So is an inverse of , hence is by uniqueness.
Proposition 9.32 (Kernel and image).
Let be a homomorphism.
- is a subgroup of and is a subgroup of .
- is injective if and only if .
- If is an isomorphism then so is .
Discussion.
Three separate claims. The first two subgroup checks are the one-step criterion, and each is a short computation using the previous proposition to convert of an inverse into an inverse of ; non-emptiness comes from in both cases. The second claim is a biconditional: forwards, an injective map sends at most one point to and is already one; backwards, the way to turn an equality into a statement about the kernel is to move everything to one side, forming , which the hypothesis then forces to be . The third is again a matter of transporting a condition: given , name their preimages, apply the homomorphism condition to those, and read the resulting equation backwards through ; that is bijective is the theorem that the inverse of a bijection is a bijection.
Proof.
For the first, puts and , so both are non-empty. If then
so and the one-step criterion applies. If then , and the criterion applies again.
For the second, suppose is injective and . Then , so . Conversely suppose and . Then
so and hence .
For the third, let be an isomorphism and let have preimages . Then , so . And is a bijection, so it is an isomorphism.
Example 9.33 (The sign is a homomorphism).
The sign of a permutation takes two values, and the group with two elements is . Define by sending an even permutation to and an odd one to . The theorem on the properties of the sign says the sign of a product is the product of the signs, which is exactly the statement that is a homomorphism: the four cases of “even or odd times even or odd” are the four products in .
Its kernel is the set of even permutations, which is . So the fact that the alternating group is a subgroup, checked by hand last chapter, now follows from the proposition on kernels. For the map is surjective, since a transposition is odd, so its image is all of .
Theorem 9.34 (Cayley's theorem).
Every group is isomorphic to a subgroup of a symmetric group. Precisely: if is a group then , where , is an injective homomorphism , so is isomorphic to a subgroup of .
Discussion.
There are three things to check. First, the proposed values must lie where the theorem says: must be a permutation of , and it is, because undoes it on both sides, so it is invertible and hence a bijection. Second, the map must be a homomorphism, and since both sides are functions on the check is an equality of functions, settled by evaluating at an arbitrary ; associativity is the only thing used, and it is used once. Third, injectivity, which by the previous proposition is the triviality of the kernel: if is the identity permutation then it fixes in particular, and . The isomorphism onto a subgroup is then the image, which the previous proposition already knows to be a subgroup.
Proof.
For each the maps and satisfy
and likewise in the other order, so is invertible and hence a permutation of ; that is, .
Let be . For and any ,
so and is a homomorphism.
If then , so . Hence and is injective. Its image is a subgroup of , and restricted to that image is a bijective homomorphism, hence an isomorphism.
Remark.
Cayley’s theorem says that every group is a group of permutations, so in that sense the last chapter already covered all groups. The statement is weak, though: has elements when is finite, so the copy of inside it is a very small part of a very large group, and locating it is no easier than knowing already.
Show that of the example above is the only homomorphism that is not constant, for . Every transposition must go to the same place; say why.
Show that a homomorphism carries a subgroup of to a subgroup of , and that the preimage of a subgroup of is a subgroup of .
Show that and are isomorphic, and that and are not.
Normal Subgroups and Quotients
Kernels satisfy a condition that not every subgroup does, and it is exactly the condition needed to make the cosets into a group.
Definition 9.35 (Normal subgroup).
A subgroup of a group is normal if for all and .
In an abelian group , so every subgroup is normal, and the condition only matters in the non-commutative case.
Proposition 9.36 (Kernels are normal).
The kernel of a homomorphism is a normal subgroup of .
Discussion.
That the kernel is a subgroup is already proved, so only the normality condition is left, and it is a membership claim: we must show sends to . Applying the homomorphism condition twice turns that element into a product of three values of , the middle one being because lies in the kernel; the outer two are inverse to each other by the proposition on how homomorphisms treat inverses, so the product is .
Proof.
Let and . Then
so . With the subgroup property already established, is normal.
Theorem 9.37 (Normal subgroups are those whose cosets agree).
Let be a subgroup of a group . Then is normal if and only if for every .
Discussion.
A biconditional, and each direction converts one membership statement into another by moving a factor across. Forwards: an element of is , and to exhibit it in we must write it as times something in ; inserting gives , and normality is precisely the statement that the bracketed factor lies in . The reverse inclusion is the same move with in place of , which normality also covers. Backwards: given the equality of the two cosets, an element with is a member of , which the hypothesis rewrites as .
Proof.
Suppose is normal and let . If then and , so . If then , and by normality applied with , so . Hence the two cosets are equal.
Conversely suppose for every , and let and . Then , so for some , and . So is normal.
When is normal the two partitions of coincide and there is just one collection of cosets, which we write — the quotient of by the equivalence relation of the coset proposition.
Theorem 9.38 (The quotient group).
Let be a normal subgroup of a group . Then
is a well-defined operation on , making a group with identity and with . The map sending to is a surjective homomorphism with .
Discussion.
The main difficulty is showing that the operation is well defined. The proposed rule names the answer using and , but the arguments of the operation are the cosets, and a coset has many names; so we must show that replacing by any with , and likewise, leaves unchanged. Written in terms of the equivalence relation, that means and should force , and this calculation uses normality: the two known members of are separated by , and normality lets us move it past.
The rest follows from the laws in . Associativity, the identity law and the inverse law each reduce, through the definition of the operation, to the corresponding law in applied to representatives. That is a homomorphism is the definition of the operation read backwards, surjectivity is the definition of , and the kernel is the set of with , which is .
Proof.
For well-definedness, suppose and , so that and lie in . Then and , so
and by normality. So the displayed element is a product of two members of and lies in , giving . The operation is therefore well defined.
Associativity follows from associativity in :
Also , so is an identity, and , so is an inverse of . Hence is a group.
Finally , so is a homomorphism; it is surjective because every coset is for some ; and holds exactly when , so .
Remark.
So normal subgroups and kernels are the same thing: every kernel is normal, by the proposition, and every normal subgroup is the kernel of the map onto its own quotient. So the question “which subgroups can be quotiented by?” and the question “which subgroups arise as kernels?” have one answer.
Theorem 9.39 (First isomorphism theorem).
Let be a homomorphism. Then
by the isomorphism sending the coset to .
Discussion.
The statement claims an isomorphism between two groups both of which are already known to exist: the quotient by the previous theorem, since the kernel is normal, and the image by the proposition on kernels and images. So we only need to check four things about the named map. That it is well defined is the same issue as before, since a coset has many names, and it holds because two representatives differ by a member of the kernel, which sends to the identity. That it is a homomorphism is the definition of the quotient operation together with the homomorphism property of . Surjectivity onto the image is immediate. Injectivity is the triviality of the kernel of the new map, and it comes out as the statement that puts in , so the coset is the identity of the quotient.
Proof.
Write , a normal subgroup by the proposition, so that is a group. Define .
Well defined. If then , so and hence .
Homomorphism. .
Surjective onto . Every element of the image is for some .
Injective. If then , so and , the identity of . So the kernel of is trivial and is injective.
Hence is a bijective homomorphism from onto .
Example 9.40 (The sign again).
Take with . Its kernel is and its image is all of , so the theorem gives
The quotient has two elements, the even permutations and the odd ones, and its multiplication is the arithmetic of parity: even times even is even, even times odd is odd, odd times odd is even. Counting the cosets recovers the problem that is twice the number of even permutations, this time as a consequence rather than a construction.
Show that a subgroup with exactly two right cosets is normal, without computing anything about itself.
Show that is a subgroup of that is not normal, and that is a normal subgroup of . Which of the two has a quotient group, and what is it?
Let be a homomorphism and let be a normal subgroup of contained in . Show that there is exactly one homomorphism with , where is the quotient map. The first isomorphism theorem is the case .
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.
The symmetries of the square form , with .
The number of with is:
The number of with is:
Let be a finite group and write for the product of copies of .
For , the set is:
There is a single with for every at once:
Let be a finite group with even. The number of with is:
Let , with a subgroup of the finite group and a subgroup of . Suppose has exactly right cosets in , and exactly right cosets in .
The number of right cosets of in is:
Let be a subgroup of with .
If contains an odd permutation, the number of odd permutations in is:
If contains no odd permutation, that number is:
Let be an infinite group and let and be subgroups with exactly and exactly right cosets. The number of right cosets of in is:
Let be a non-empty subset of a group and suppose the sets , for , partition . Then is:
For a group put .
Then is:
Let with be a normal subgroup of . Then:
Let be a normal subgroup of and let be a normal subgroup of .
Then :
The smallest symmetric group holding a pair that witnesses this is:
Let be a subgroup of . The largest normal subgroup of contained in 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 ⟨ ⟩.
Every statement of this chapter is made of one group, so the checker is given one and the sheet works inside it. The objects are its elements, and three new pieces of notation carry the structure:
a ∗ b the product, typed \ast
e the identity
a⁻¹ the inverse of a, typed \-1The operation binds like a product, so a ∗ b ∗ c is (a ∗ b) ∗ c and brackets are written where the other reading is wanted. A subgroup is a set, hence an object like any other, and a ∈ H is the membership of the sets chapter.
Five entries carry Definition 9.19 and nothing else is given away:
mul_assoc (a ∗ b) ∗ c = a ∗ (b ∗ c)
e_mul e ∗ a = a
mul_e a ∗ e = a
inv_mul_cancel a⁻¹ ∗ a = e
mul_inv_cancel a ∗ a⁻¹ = eEverything else in the chapter is a consequence, and the sheet asks for the consequences.
Multiplying an equation through
The axioms are equations, so the work is rewriting. What the paper proofs do in one line (multiply both sides by ) the checker needs spelled out, and congrArg says it: from h : x = y it builds f x = f y for any f written out as fun t => …. Once the equation has the factor on it, rw [...] at h cancels.
Example.
The observation that settled the identity of a subgroup, in the discussion after Definition 9.25 . Multiplying by on the left is the whole of it.
Example.
The left half of Proposition 9.22 . It is listed below as mul_left_cancel, so the exercises may lean on it.
Example.
Inverting twice returns the element, noted after Proposition 9.15 . It is listed below as inv_inv.
The identity is its own inverse.
Proposition 9.12 , with only the left-hand law assumed.
The right half of Proposition 9.22 .
Proposition 9.15 , in the form Problem 9.6 puts it.
The equation has no second solution, as the remark after Proposition 9.22 observes.
Proposition 9.16 . Show first that multiplies with to give .
The rearrangement that carries a right coset onto a left one in Theorem 9.37 .
The first step of the backward direction of Proposition 9.26 .
Its second step.
And its third, which is where inv_inv earns its place.
The first half of Proposition 9.31 . A homomorphism is a map with the one property, so it arrives as an arrow together with the equation it satisfies.
Its second half, with the first half to hand.
The kernel is closed under the operation, part of Proposition 9.32 . The kernel arrives as a set together with its membership criterion.
Proposition 9.36 : the kernel is normal. (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 |
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 |
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 |