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 ,” and or equivalently , means ” is not an element of .”
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
The natural next step is to make claims about all values in a domain, or to assert that at least one satisfying value exists. These are the universal and existential quantifiers, the final logical apparatus for formal mathematical reasoning.
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. The power of quantifiers lies in their ability to make claims about 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 enough to earn 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)
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 the reason the abbreviation is worth having.
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 cornerstone of deductive reasoning 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 ,
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 , , ,
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. Every multi-step mathematical deduction is, at its core, a sequence 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 , .
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 is remarkably powerful: It can recover 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. This universality makes Resolution 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
The power of inference rules lies in chaining them. 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 yields perhaps the most frequently used quantifier rule in practice:
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 hunts for an absurdity.
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 is the bridge between 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 turns the tables. 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 will lean on the same piece of apparatus.
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 earns its keep when both directions resist a straight argument: the two negations and each hand us two facts to work with where the direct proof gets 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 resist a direct argument 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 builds the very that says is not there.
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 all three stand or fall together.
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, and it is a strategy in name only.
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 : it stands for every element at once, and Universal Generalisation is what licenses the step from it to the whole 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 rules out a world in which the object is missing.
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 rules out the world in which no pair works and stops there, and that is the mark of a non-constructive argument.
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 gets forgotten: producing a solution says nothing about whether a second one is hiding somewhere, 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.
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 it is the logical foundation of every indirect proof above: 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 doing its work. 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 only as strong as its weakest step. 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 |