Mascot image.
← MA0 1 · Introduction to University Mathematics (Proofs)

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 55 or π\pi are terms denoting specific objects, while an unquantified variable such as xx is a term whose value has not yet been specified. We can then form expressions describing the object denoted by a variable, such as man(x)\operatorname{man}(x) to say ”xx is a man,” or x>3x>3 to say ”xx is greater than 33.” We call these expressions predicates (also known as variable propositions), since they make a claim that depends on one or more variables.

Definition 2.1 (Predicate).

Let x1,,xnx_1, \ldots, x_n be variable symbols. We say φ(x1,,xn)\varphi(x_1, \ldots, x_n) is an nn-ary predicate if its truth value is determined once values are assigned to each of the variables x1,x2,,xnx_1, x_2, \ldots, x_n (or equivalently, replacing each variable by a term denoting a specific object produces a proposition).

  • A 11-ary (monadic) predicate describes a property, e.g., IsPrime(x)\text{IsPrime}(x).
  • A 22-ary (dyadic) predicate describes a relation between two terms, e.g., IsGreaterThan(x,y)\text{IsGreaterThan}(x, y).
  • An nn-ary predicate describes a relation among nn terms.

Note that we would usually write such a declaration as: let P(x)P(x) be the statement ”x21=0x^2-1=0.”

Remark.

A term by itself is not a complete sentence, so it has no truth value; likewise, as hinted earlier the resulting expressions above (x>3x>3) are still not propositions because their truth value depends on the actual value of xx.

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 PP is the predicate “is prime,” then P(x)P(x) and P(7)P(7) 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.

Example 2.2.

Let R(x,y,z)R(x, y, z) denote x+y=zx + y = z, where the variables range over the integers. Then R(2,1,5)R(2, -1, 5) is \bot since 2+(1)52 + (-1) \neq 5; R(3,4,7)R(3, 4, 7) is \top since 3+4=73 + 4 = 7; and R(x,3,z)R(x, 3, z) is still a predicate, since x+3=zx + 3 = z can be \top or \bot depending on the values of xx and zz.

Remark.

It is common to use capital letters such as P,Q,RP, Q, R to denote predicates.

A predicate’s variables take values in a domain UU, called the universe of discourse (in the previous example, UU is the integers). Once values from UU are substituted, the predicate becomes a proposition with truth value \top or \bot; hence we can now apply the logical connectives introduced earlier.

Example 2.3.

Let P(x)P(x) denote x>0x > 0. Then the following are true: P(3)P(1),P(3) \lor P(-1), P(3)¬P(1);P(3) \to \neg P(-1); and the following are false: P(3)P(1),P(3) \land P(-1), P(3)P(1)P(3) \to P(-1).

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.

Example 2.4.

Using P(x)P(x) as above, the following are propositional functions:

R(x,y)=defP(x)P(y),S(y)=defP(3)P(y)R(x, y) \defeq P(x) \to P(y), \qquad S(y) \defeq P(3) \land P(y)

R(x,y)R(x, y) is a predicate in two variables; S(y)S(y) is a predicate in one variable (since P(3)P(3) is already a proposition).

Problem 2.1.

Consider the expressions man(x)\text{man}(x), x>3x > 3, and 2+3=52 + 3 = 5. Which of these are propositions and which are predicates? For each predicate, give one substitution that makes it \top and one that makes it \bot.

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 A,B,S,A,B,S,\dots, and elements by lowercase letters a,b,x,a,b,x,\dots. If SS is a set, then xSx \in S means ”xx is an element of SS,” and xSx \notin S or equivalently ¬(xS)\neg(x \in S), means ”xx is not an element of SS.”

Example 2.6.

Let S={2,3,5}S = \{2,3,5\}. Then 3S3 \in S, but 4S4 \notin S.

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, {2,3}{{2,3},5},\{2,3\} \in \{\{2,3\},5\}, because the collection on the right has two elements: the set {2,3}\{2,3\} and the number 55; The problem arises when this is confused with the case where only the original objects are elements: {2,3}{2,3,5}.\{2,3\} \notin \{2,3,5\}. So aAa \in A asks whether aa is literally a member of the collection AA, not merely whether its contents appear among the elements of AA.

Problem 2.2.

Let S={2,3,5}.S = \{2,3,5\}. Which of the following are true?

(a) 3S3 \in S

(b) 4S4 \notin S

(c) 5S5 \in S

(d) 1S1 \in S

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 φ(x)\varphi(x) be a predicate with variable xx ranging over a universe of discourse UU. The universal quantification of xx in φ\varphi, written x(φ(x))\forall x\,(\varphi(x)), is the proposition asserting that φ(a)\varphi(a) is \top for every element aUa \in U. It is read “for all xx, φ(x)\varphi(x).”

Determining the truth of x(φ(x))\forall x\,(\varphi(x)) amounts to exhaustive verification: examine every object in the universe, and if even one makes φ\varphi false, the entire statement is false. If every object passes, the statement is true; a value aa for which φ(a)=\varphi(a) = \bot is called a counterexample.

If the universe is the collection U={a1,a2,,an}U = \{a_1, a_2, \ldots, a_n\}, the universal quantifier reduces to a conjunction:

x(φ(x))φ(a1)φ(a2)φ(an)\forall x\,(\varphi(x)) \equiv \varphi(a_1) \land \varphi(a_2) \land \cdots \land \varphi(a_n)

Remark (Indexed Conjunction and Disjunction).

When a conjunction or disjunction extends over a collection of terms, we write

i=1nφ(ai)  =def  φ(a1)φ(a2)φ(an),i=1nφ(ai)  =def  φ(a1)φ(a2)φ(an)\bigwedge_{i=1}^{n} \varphi(a_i) \;\defeq\; \varphi(a_1) \land \varphi(a_2) \land \cdots \land \varphi(a_n), \qquad \bigvee_{i=1}^{n} \varphi(a_i) \;\defeq\; \varphi(a_1) \lor \varphi(a_2) \lor \cdots \lor \varphi(a_n)

More generally, for any index set SS the notations aSφ(a)\bigwedge_{a \in S} \varphi(a) and aSφ(a)\bigvee_{a \in S} \varphi(a) denote the conjunction and disjunction, respectively, of φ(a)\varphi(a) over every aa in SS. In this notation, the finite-universe equivalences above become x(φ(x))aUφ(a)\forall x\,(\varphi(x)) \equiv \bigwedge_{a \in U} \varphi(a) and, as we shall see shortly, x(φ(x))aUφ(a)\exists x\,(\varphi(x)) \equiv \bigvee_{a \in U} \varphi(a).

Specifying the Quantification Set

Earlier our description of a quantification states that it “ranges over a universe of discourse,” take for example the sentence

x(x20)\forall x\, (x^2 \geqslant 0)

which may look true, but as it stands it is meaningless. What is xx? “For every xx” from where? If xx ranges over colours, or over sentences, then x20x^2 \geqslant 0 is not false, it is not even grammatical. We need to know where the object xx comes from before we can ask whether the claim about it is true.

If we amend the sentence so that xx ranges over the real numbers, we get a well-formed statement, and a true one. If instead we let xx range over the complex numbers, we get an equally well-formed statement that is now false: the imaginary unit ii is a complex number with i2=1i^2 = -1, and 10-1 \geqslant 0 fails. (We will make little real use of the complex numbers in these notes, but they are a convenient source of counterexamples.)

Example 2.8.

Let P(x)P(x) denote ”x>0x > 0.”

If the universe is the integers, then x(P(x))\forall x\,(P(x)) is \bot: the value x=0x = 0 is a counterexample, since P(0)P(0) is false. If UU is the positive integers (the natural numbers greater than 0), then x(P(x))\forall x\,(P(x)) is \top. The truth value of a universally quantified statement depends on the choice of universe.

The Existential Quantifier

Definition 2.9 (Existential Quantifier).

Let φ(x)\varphi(x) be a predicate with variable xx ranging over a universe UU. The existential quantification of xx in φ\varphi, written x(φ(x))\exists x\,(\varphi(x)), is the proposition asserting that there is at least one element aUa \in U for which φ(a)\varphi(a) is \top. It is read “there exists an xx such that φ(x)\varphi(x).”

Where the universal quantifier demands exhaustive verification, the existential quantifier demands a search: examine objects in the universe until one satisfies φ\varphi. 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 U={a1,a2,,an}U = \{a_1, a_2, \ldots, a_n\}, the existential quantifier reduces to a disjunction:

x(φ(x))φ(a1)φ(a2)φ(an)\exists x\,(\varphi(x)) \equiv \varphi(a_1) \lor \varphi(a_2) \lor \cdots \lor \varphi(a_n)

If x(φ(x))\forall x\,(\varphi(x)) is true and UU is non-empty, then x(φ(x))\exists x\,(\varphi(x)) must also be true: if every element satisfies φ\varphi, at least one does.

Example 2.10.

Let P(x)P(x) denote ”x>0x > 0.”

x(P(x))\exists x\,(P(x)) is \top when the universe is the integers (witness: x=1x = 1), \top when UU is the positive integers, and \bot when UU is the negative integers.

The following table summarises the two quantifiers:

StatementTrue whenFalse when
x(P(x))\forall x\,(P(x))P(x)P(x) is \top for every xUx \in UThere exists a counterexample: some aa with P(a)=P(a) = \bot
x(P(x))\exists x\,(P(x))There exists a witness: some aa with P(a)=P(a) = \topP(x)P(x) is \bot for every xUx \in U

Remark (Quantifiers and Finite Domains).

If the domain is finite, quantifiers are technically unnecessary: x(P(x))\forall x\,(P(x)) is a conjunction and x(P(x))\exists x\,(P(x)) 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:

xP(x)Q(x)means(x(P(x)))Q(x)\forall x\, P(x) \lor Q(x) \quad \text{means} \quad \bigl(\forall x\,(P(x))\bigr) \lor Q(x)

This expression has a free variable xx in Q(x)Q(x) and is therefore a predicate. The two xx‘s are in fact independent: the expression could equivalently be written (y(P(y)))Q(x)\bigl(\forall y\,(P(y))\bigr) \lor Q(x). By contrast, x(P(x)Q(x))\forall x\,(P(x) \lor Q(x)) has both occurrences of xx 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 AA be a set and let P(x)P(x) be a predicate. The bounded quantifiers are defined by

xA(P(x))  =def  x(xAP(x)),xA(P(x))  =def  x(xAP(x))\forall x \in A\,(P(x)) \;\defeq\; \forall x\,(x \in A \to P(x)), \qquad \exists x \in A\,(P(x)) \;\defeq\; \exists x\,(x \in A \land P(x))

read “for every xx in AA, P(x)P(x)” and “there is an xx in AA with P(x)P(x).” When several variables share a set we abbreviate further, writing x,yA(P(x,y))\forall x, y \in A\,(P(x,y)) for xAyA(P(x,y))\forall x \in A\, \forall y \in A\,(P(x,y)), and likewise x,yA(P(x,y))\exists x, y \in A\,(P(x,y)) for xAyA(P(x,y))\exists x \in A\, \exists y \in A\,(P(x,y)).

The restriction enters the universal quantifier through an implication and the existential one through a conjunction, and the pairing cannot be swapped. The statement x(xAP(x))\exists x\,(x \in A \to P(x)) is made true by any object outside AA whatsoever, since a false antecedent makes the implication true, so it says nothing about the elements of AA 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 !x(φ(x))\exists!\, x\,(\varphi(x)) asserts that exactly one element of UU satisfies φ\varphi. It is defined in terms of the other quantifiers:

!x(φ(x))    x(φ(x)y(φ(y)y=x))\exists!\, x\,(\varphi(x)) \;\equiv\; \exists x\,\bigl(\varphi(x) \land \forall y\,(\varphi(y) \to y = x)\bigr)

This reads: “there exists an xx such that φ(x)\varphi(x), and any yy satisfying φ(y)\varphi(y) must equal xx.” It takes a bounded form like the other two: for a set AA,

!xA(P(x))  =def  !x(xAP(x))\exists!\, x \in A\,(P(x)) \;\defeq\; \exists!\, x\,(x \in A \land P(x))

Example 2.14.

Let UU be the integers and let P(x)P(x) denote ”x+1=0x + 1 = 0.” Then !xU(P(x))\exists!\, x \in U\,(P(x)) is \top: the unique witness is x=1x = -1. If instead P(x)P(x) denotes ”x>0x > 0,” then !xU(P(x))\exists!\, x \in U\,(P(x)) is \bot, since every positive integer satisfies PP and there are infinitely many of them.

Formalising Arguments

We can now symbolise the prime-number argument that propositional logic could not handle. Let UU be the integers, let P(x)P(x) denote ”xx is a prime number greater than 22,” and let O(x)O(x) denote ”xx is odd.”

  1. “Every prime number greater than 22 is odd” becomes xU(P(x)O(x))\forall x \in U\,(P(x) \to O(x)).
  2. “The number 77 is a prime number greater than 22” becomes P(7)P(7).
  3. By substituting x=7x = 7 into (1) we obtain P(7)O(7)P(7) \to O(7). Since P(7)P(7) is true by (2) and the conditional P(7)O(7)P(7) \to O(7) is true, bivalence forces O(7)O(7) to be true: ”77 is odd.”

More broadly, the four classical categorical propositions of Aristotelian logic can be expressed in first-order form. Given predicates S(x)S(x) and R(x)R(x) over a universe UU:

TypeStatementFirst-order form
AAll SS are RRxU(S(x)R(x))\forall x \in U\,(S(x) \to R(x))
ENo SS is RRxU(S(x)¬R(x))\forall x \in U\,(S(x) \to \neg R(x))
ISome SS is RRxU(S(x)R(x))\exists x \in U\,(S(x) \land R(x))
OSome SS is not RRxU(S(x)¬R(x))\exists x \in U\,(S(x) \land \neg R(x))

Remark (The Connective Trap).

A common error is to write xU(S(x)R(x))\forall x \in U\,(S(x) \land R(x)), which makes the much stronger claim that everything in the universe is both SS and RR. Equally, xU(S(x)R(x))\exists x \in U\,(S(x) \to R(x)) is almost always vacuously true: any element that is not SS makes the implication true and serves as a witness.

Example 2.15 (Translating Natural Language).

Let UU be all people, let S(x)S(x) denote ”xx is a student in this class,” and let P(x)P(x) denote ”xx has written a programme in Python.”

“Every student in this class has written a programme in Python” is formalised as xU(S(x)P(x))\forall x \in U\,(S(x) \to P(x)).

“Some student in this class has written a programme in Python” is formalised as xU(S(x)P(x))\exists x \in U\,(S(x) \land P(x)).

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 φ(x)\varphi(x) with universe UU:

(1) ¬(x(φ(x)))x(¬φ(x))\neg\bigl(\forall x\,(\varphi(x))\bigr) \equiv \exists x\,(\neg\varphi(x))

(2) ¬(x(φ(x)))x(¬φ(x))\neg\bigl(\exists x\,(\varphi(x))\bigr) \equiv \forall x\,(\neg\varphi(x))

Proof.

The two quantifiers expand into an indexed conjunction and an indexed disjunction over UU:

x(φ(x))aUφ(a),x(φ(x))aUφ(a)\forall x\,(\varphi(x)) \equiv \bigwedge_{a \in U} \varphi(a), \qquad \exists x\,(\varphi(x)) \equiv \bigvee_{a \in U} \varphi(a)

(1)

¬(x(φ(x)))¬(aUφ(a))by the expansion of aU¬φ(a)by generalised De Morganx(¬φ(x))by the expansion of \begin{aligned} \neg\bigl(\forall x\,(\varphi(x))\bigr) &\equiv \neg\Bigl(\bigwedge_{a \in U} \varphi(a)\Bigr) && \text{by the expansion of } \forall \\ &\equiv \bigvee_{a \in U} \neg\varphi(a) && \text{by generalised De Morgan} \\ &\equiv \exists x\,(\neg\varphi(x)) && \text{by the expansion of } \exists \end{aligned}

(2)

¬(x(φ(x)))¬(aUφ(a))by the expansion of aU¬φ(a)by generalised De Morganx(¬φ(x))by the expansion of \begin{aligned} \neg\bigl(\exists x\,(\varphi(x))\bigr) &\equiv \neg\Bigl(\bigvee_{a \in U} \varphi(a)\Bigr) && \text{by the expansion of } \exists \\ &\equiv \bigwedge_{a \in U} \neg\varphi(a) && \text{by generalised De Morgan} \\ &\equiv \forall x\,(\neg\varphi(x)) && \text{by the expansion of } \forall \end{aligned}

Remark (De Morgan over a Universe).

The generalised De Morgan’s laws were stated for nn propositions, and the proof above applies them to a conjunction indexed by UU, which need not be finite (we explore this in a second). When U={a1,,an}U = \{a_1, \ldots, a_n\}, the step is the corollary verbatim:

¬(φ(a1)φ(an))¬φ(a1)¬φ(an)\neg\bigl(\varphi(a_1) \land \cdots \land \varphi(a_n)\bigr) \equiv \neg\varphi(a_1) \lor \cdots \lor \neg\varphi(a_n)

Which has an immediate consequences: x(φ(x))¬(x(¬φ(x)))\forall x\,(\varphi(x)) \equiv \neg\bigl(\exists x\,(\neg\varphi(x))\bigr) and x(φ(x))¬(x(¬φ(x)))\exists x\,(\varphi(x)) \equiv \neg\bigl(\forall x\,(\neg\varphi(x))\bigr).

Example 2.17 (Negating in English).

Let UU be the real numbers.

  1. “There is a real number xx with x2=1x^2 = -1,” in symbols xU(x2=1)\exists x \in U\,(x^2 = -1), is \bot. Its negation is the universal statement “for every real number xx, x21x^2 \neq -1,” which is \top.
  2. “Every real number is positive or negative,” in symbols xU(x>0x<0)\forall x \in U\,(x > 0 \lor x < 0), is \bot: the counterexample is x=0x = 0. Its negation is xU¬(x>0x<0)\exists x \in U\,\neg(x > 0 \lor x < 0), and De Morgan’s laws turn the negated disjunction into a conjunction, giving xU(x0x0)\exists x \in U\,(x \leqslant 0 \land x \geqslant 0): “there is a real number that is neither positive nor negative.” It is \top, with x=0x = 0 doing the existing.

Negation and Bounded Quantifiers

The bounded notation of Definition 2.12 is coherent with negation. Applying the theorem to a set SS:

¬(xS(P(x)))xS(¬P(x))and¬(xS(P(x)))xS(¬P(x))\neg\bigl(\forall x \in S\,(P(x))\bigr) \equiv \exists x \in S\,(\neg P(x)) \quad \text{and} \quad \neg\bigl(\exists x \in S\,(P(x))\bigr) \equiv \forall x \in S\,(\neg P(x))

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:

¬(x(xSP(x)))x¬(xSP(x))x(xS¬P(x))\neg\bigl(\forall x\,(x \in S \to P(x))\bigr) \equiv \exists x\,\neg(x \in S \to P(x)) \equiv \exists x\,(x \in S \land \neg P(x))

which is the bounded existential xS(¬P(x))\exists x \in S\,(\neg P(x)).

Problem 2.3.

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:

x(P(x)Q(x))x(P(x))x(Q(x))\forall x\,(P(x) \land Q(x)) \equiv \forall x\,(P(x)) \land \forall x\,(Q(x)) x(P(x)Q(x))x(P(x))x(Q(x))\exists x\,(P(x) \lor Q(x)) \equiv \exists x\,(P(x)) \lor \exists x\,(Q(x))

However, the reverse pairings do not hold in general:

x(P(x)Q(x))  ≢  x(P(x))x(Q(x))\exists x\,(P(x) \land Q(x)) \;\not\equiv\; \exists x\,(P(x)) \land \exists x\,(Q(x)) x(P(x)Q(x))  ≢  x(P(x))x(Q(x))\forall x\,(P(x) \lor Q(x)) \;\not\equiv\; \forall x\,(P(x)) \lor \forall x\,(Q(x))

For both non-equivalences, a single counterexample suffices: Let U={a,b}U = \{a, b\}, with P(x)P(x) true exactly of aa and Q(x)Q(x) true exactly of bb. Then x,P(x)x,Q(x)\exists x,P(x) \land \exists x,Q(x) is \top (witnesses aa and bb), but x,(P(x)Q(x))\exists x,(P(x) \land Q(x)) is \bot, since P(a)Q(a)P(a) \land Q(a) fails on the second conjunct and P(b)Q(b)P(b) \land Q(b) on the first. Likewise x,(P(x)Q(x))\forall x,(P(x) \lor Q(x)) is \top (it holds at aa via PP and at bb via QQ), while x,P(x)x,Q(x)\forall x,P(x) \lor \forall x,Q(x) is \bot, since P(b)P(b) and Q(a)Q(a) both fail.

Problem 2.4.

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.

Example 2.18.

The statement x(¬S(x))¬x(S(x))\forall x\,(\neg S(x)) \leftrightarrow \neg\exists x\,(S(x)) is valid: it is an instance of Theorem 2.16 and holds for any predicate SS and any domain.

The statement x(F(x)T(x))\forall x\,(F(x) \leftrightarrow T(x)) is satisfiable: taking FTF \equiv T makes it true, while taking the domain to be the integers with F(x)(x>0)F(x) \equiv (x > 0) and T(x)(x<0)T(x) \equiv (x < 0) makes it false.

The statement x(F(x)¬F(x))\forall x\,(F(x) \land \neg F(x)) is unsatisfiable: it asserts that every element simultaneously satisfies and fails to satisfy FF, contradicting the principle of bivalence.

Problem 2.5.

Let PP be a predicate over an arbitrary universe UU. Determine whether each of the following statements is valid, satisfiable, or unsatisfiable, and justify your answer.

(a) !xU(P(x))xU(P(x))\exists!\, x \in U\,(P(x)) \to \exists x \in U\,(P(x))

(b) xU(P(x))!xU(P(x))\forall x \in U\,(P(x)) \to \exists!\, x \in U\,(P(x))

(c) !xU(¬P(x))¬xU(P(x))\exists!\, x \in U\,(\neg P(x)) \to \neg\forall x \in U\,(P(x))

Problem 2.6.

Let UU be all English texts, and let P(x)P(x), Q(x)Q(x) and R(x)R(x) denote ”xx is a clear explanation”, ”xx is satisfactory”, and ”xx 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.

Problem 2.7.

Let ZZ be the integers and let RR 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) xZ(x20)\forall x \in Z\,(x^2 \geqslant 0)

(b) xR(x2<0)\exists x \in R\,(x^2 < 0)

(c) xRyR(x+y=0)\forall x \in R\,\exists y \in R\,(x + y = 0)

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 UU be the real numbers, the formalisation is:

xUyU(x+y=0)\forall x \in U\, \exists y \in U\,(x + y = 0)

The outer quantifier xU\forall x \in U asserts that the claim holds for every real xx. The inner quantifier yU\exists y \in U asserts that, for each such xx, a suitable yy exists. The two quantifiers are nested: yU\exists y \in U lies within the scope of xU\forall x \in U.

A nested quantified statement can be decomposed by treating each inner quantification as a propositional function. For instance, xUyU(x+y=0)\forall x \in U\, \exists y \in U\,(x + y = 0) can be read as xU(Q(x))\forall x \in U\,(Q(x)), where Q(x)=defyU(P(x,y))Q(x) \defeq \exists y \in U\,(P(x, y)) and P(x,y)=def(x+y=0)P(x, y) \defeq (x + y = 0). Note that Q(x)Q(x) is itself a predicate: the existential quantifier binds yy, but xx remains free until the outer xU\forall x \in U binds it.

Order of Quantifiers

The order in which quantifiers appear is critical. Consider the same predicate P(x,y)=def(x+y=0)P(x, y) \defeq (x + y = 0), with UU still the real numbers.

xUyU(P(x,y))\forall x \in U\, \exists y \in U\,(P(x, y)) asserts: “for every real xx, there exists a real yy such that x+y=0x + y = 0.” This is \top: for any given xx, the witness y=xy = -x works. Crucially, the witness may differ for each xx.

yUxU(P(x,y))\exists y \in U\, \forall x \in U\,(P(x, y)) asserts: “there exists a single real yy such that x+y=0x + y = 0 for every real xx.” This is \bot: 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 xx one at a time and look for a fresh yy at each step. In the second, we pick a candidate yy first and then test it against every xx. 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 UU be the real numbers and let p(m,n)p(m, n) denote ”m>nm > n.” Then nUmU(p(m,n))\forall n \in U\, \exists m \in U\,(p(m, n)) says “for every number there is a larger one,” which is \top; the witness m=n+1m = n + 1 works for each nn. Flipping the two quantifiers, mUnU(p(m,n))\exists m \in U\, \forall n \in U\,(p(m, n)) says “there is a number larger than every number,” which is \bot; among other embarrassments, such an mm would have to satisfy m>mm > m (this will be important in a second).

Example 2.21 (Captains).

Let XX be the professional footballers, let YY be the clubs, and let p(x,y)p(x, y) denote ”xx is the captain of yy.” Four formally similar statements have four very different meanings:

  1. xXyY(p(x,y))\forall x \in X\, \exists y \in Y\,(p(x, y)): every footballer is some club’s captain. \bot.
  2. yYxX(p(x,y))\exists y \in Y\, \forall x \in X\,(p(x, y)): there is one club whose captain is every footballer at once. \bot, and its dressing room does not bear thinking about.
  3. yYxX(p(x,y))\forall y \in Y\, \exists x \in X\,(p(x, y)): every club has a captain. \top.
  4. xXyY(p(x,y))\exists x \in X\, \forall y \in Y\,(p(x, y)): there is one footballer who captains every club. \bot.

Only the quantifier order and the choice of which set each variable is drawn from separate these.

Problem 2.8.

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:

xUyU(P(x,y))yUxU(P(x,y))\forall x \in U\, \forall y \in U\,(P(x, y)) \equiv \forall y \in U\, \forall x \in U\,(P(x, y)) xUyU(P(x,y))yUxU(P(x,y))\exists x \in U\, \exists y \in U\,(P(x, y)) \equiv \exists y \in U\, \exists x \in U\,(P(x, y))

Both nested universal quantifiers demand that PP hold for every pair, and both nested existential quantifiers demand that at least one pair satisfies PP. In neither case does the order in which pairs are examined affect the outcome.

Quantification Fixes a Variable

Let XX be the even integers greater than or equal to 44, let PP be the prime numbers, and for nXn \in X and a,bPa, b \in P let Q(n,a,b)Q(n, a, b) denote ”a+b=na + b = n.” Consider

nXa,bP(Q(n,a,b))\forall n \in X\, \exists a, b \in P\,(Q(n, a, b))

The initial quantification nX\forall n \in X serves to fix a value of nn, which is then used for the rest of the statement. The assertion that follows, that there are primes aa and bb with a+b=na + b = n, is made about that fixed but arbitrary value. Read as a whole, the statement says that no matter which nn is chosen from XX, we can find aa and bb satisfying QQ. The order of quantification is what tells us those values may depend on the chosen nn.

Take a particular value. We know 8X8 \in X, since 88 is even and 848 \geqslant 4. Can we find a,bPa, b \in P with a+b=8a + b = 8? We can take a=3a = 3 and b=5b = 5. Now take n=14n = 14; our choices have to be different from before, and a=3a = 3, b=11b = 11 will do (as will a=b=7a = b = 7). This is what we mean when we say that aa and bb depend on nn.

Problem 2.9.

What is the difference between the statement above and the following one?

nXa,bP(Q(n,a,b))\exists n \in X\, \exists a, b \in P\,(Q(n, a, b))

Is it \top or \bot? Why?

Remark.

The universal statement nXa,bP(Q(n,a,b))\forall n \in X\, \exists a, b \in P\,(Q(n, a, b)) is the Goldbach Conjecture, met as a proposition of unknown truth value in the previous chapter. Checking n=8n = 8 and n=14n = 14 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 nn for which no such aa and bb 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:

  1. Rewrite with explicit quantifiers: “for every two integers, if both are positive, then their sum is positive.”
  2. Introduce variables: “for all integers xx and yy, if x>0x > 0 and y>0y > 0, then x+y>0x + y > 0.”
  3. Formalise, taking UU to be the integers:
x,yU(x>0y>0x+y>0)\forall x, y \in U\,(x > 0 \land y > 0 \to x + y > 0)

Example 2.23 (Carrying Restrictions Along).

The Archimedean principle says that if bb and ss are positive numbers, there is a natural number nn with ns>bns > b. This holds however large bb is and however small ss is.

Let UU be the real numbers, let NN be the natural numbers, and let p(b,s,n)p(b, s, n) denote ”ns>bns > b.” If we agree in advance that bb and ss range over the positive reals and nn over the natural numbers, the principle encodes compactly. If instead all three variables range over UU, we have to carry the restrictions ourselves:

b,sU((b>0s>0)n(nNp(b,s,n)))\forall b, s \in U\,\Bigl((b > 0 \land s > 0) \to \exists n\,\bigl(n \in N \land p(b, s, n)\bigr)\Bigr)

read “for every bb and ss, if both are positive, then there is a natural number nn satisfying ns>bns > b.” Writing LL for the positive real numbers, the bounded quantifiers of Definition 2.12 package the same statement as

b,sLnN(p(b,s,n))\forall b, s \in L\, \exists n \in N\,(p(b, s, n))

The two say the same thing, and the second is the reason the abbreviation is worth having.

Example 2.24 (Translating Natural Language).

Let UU be all people and let L(x,y)L(x, y) denote ”xx loves yy.”

Everybody loves somebody.xUyU(L(x,y))There is someone who is loved by everyone.xUyU(L(y,x))There is someone who loves someone.x,yU(L(x,y))Everyone loves themselves.xU(L(x,x))\begin{array}{ll} \text{Everybody loves somebody.} & \forall x \in U\, \exists y \in U\,(L(x, y)) \\[4pt] \text{There is someone who is loved by everyone.} & \exists x \in U\, \forall y \in U\,(L(y, x)) \\[4pt] \text{There is someone who loves someone.} & \exists x, y \in U\,(L(x, y)) \\[4pt] \text{Everyone loves themselves.} & \forall x \in U\,(L(x, x)) \end{array}

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.

Problem 2.10.

Let UU be all students in a class and let F(x,y)F(x, y) denote ”xx and yy 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 UU be the real numbers. Determine the truth value of each statement:

(a) xUyU(x2=y)\forall x \in U\, \exists y \in U\,(x^2 = y) is \top: for any xx, choose y=x2y = x^2.

(b) xUyU(x=y2)\forall x \in U\, \exists y \in U\,(x = y^2) is \bot: taking x=1x = -1, there is no real yy with y2=1y^2 = -1.

(c) xUyU(xy=0)\exists x \in U\, \forall y \in U\,(xy = 0) is \top: choose x=0x = 0.

(d) x,yU(x+yy+x)\exists x, y \in U\,(x + y \neq y + x) is \bot: addition of real numbers is commutative, so x+y=y+xx + y = y + x for all x,yUx, y \in U. This is the negation of x,yU(x+y=y+x)\forall x, y \in U\,(x + y = y + x), which is \top.

Problem 2.11.

Let UU be the integers. Determine the truth value of each statement, and justify your answer.

(a) xUyU(xy=1)\forall x \in U\, \exists y \in U\,(x \cdot y = 1)

(b) xUyU(x+y=y)\exists x \in U\, \forall y \in U\,(x + y = y)

(c) x,yUzU(x+z=y)\forall x, y \in U\, \exists z \in U\,(x + z = y)

Negating Nested Quantifiers

Theorem 2.16 extends to nested quantifiers by repeated application. Each quantifier flips (\forall \leftrightarrow \exists) and the negation pushes inward:

¬(xy(P(x,y)))x¬(y(P(x,y)))xy(¬P(x,y))\neg\bigl(\forall x\, \exists y\,(P(x, y))\bigr) \equiv \exists x\, \neg\bigl(\exists y\,(P(x, y))\bigr) \equiv \exists x\, \forall y\,(\neg P(x, y))

At each step, one quantifier is negated. The process terminates when the negation reaches the predicate.

Example 2.26.

Let UU be the real numbers and negate the statement xUyU(x+y=0)\forall x \in U\, \exists y \in U\,(x + y = 0), “every real number has an additive inverse.”

Applying the negation rules from outside in:

¬(xUyU(x+y=0))xUyU(x+y0)\neg\bigl(\forall x \in U\, \exists y \in U\,(x + y = 0)\bigr) \equiv \exists x \in U\, \forall y \in U\,(x + y \neq 0)

In English: “there is a real number with no additive inverse.” This is \bot, confirming that the original statement is \top.

Problem 2.12.

Let UU be the real numbers. Negate each of the following statements and simplify. State whether the original or its negation is true.

(a) x,yU(x+y=y+x)\forall x, y \in U\,(x + y = y + x)

(b) xUyU(xy=0)\exists x \in U\, \forall y \in U\,(xy = 0)

(c) xUy,zU(y2+z2=x)\forall x \in U\, \exists y, z \in U\,(y^2 + z^2 = x)

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:

Q1x1Q2x2Qkxk(ψ(x1,x2,,xk))Q_1 x_1\, Q_2 x_2\, \cdots\, Q_k x_k\,\bigl(\psi(x_1, x_2, \ldots, x_k)\bigr)

where each QiQ_i is either \forall or \exists, each variable ranges over the universe fixed in advance, and ψ\psi contains no quantifiers. For example, the statement x(P(x))x(Q(x))\exists x\,(P(x)) \to \exists x\,(Q(x)) is not in PNF because quantifiers appear on both sides of \to. Rewriting using the defining equivalence of the conditional and renaming variables for clarity:

¬(x(P(x)))y(Q(y))x(¬P(x))y(Q(y))xy(¬P(x)Q(y))\neg\bigl(\exists x\,(P(x))\bigr) \lor \exists y\,(Q(y)) \equiv \forall x\,(\neg P(x)) \lor \exists y\,(Q(y)) \equiv \forall x\, \exists y\,(\neg P(x) \lor Q(y))

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.

Problem 2.13.

Let PP and QQ be predicates over a universe UU. Convert the following to Prenex Normal Form:

(a) x(P(x))x(Q(x))\forall x\,(P(x)) \to \exists x\,(Q(x))

(b) ¬(xy(P(x,y)))z(Q(z))\neg\bigl(\forall x\, \exists y\,(P(x, y))\bigr) \lor \forall z\,(Q(z))

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 pqp \to q is known and pp is true, we may conclude qq, 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

Definition 2.27 (Argument).

An argument in propositional logic is a finite sequence of propositions p1,p2,,pn,qp_1, p_2, \ldots, p_n, q. The propositions p1,,pnp_1, \ldots, p_n are the premises and qq is the conclusion. The argument is valid if the truth of all premises guarantees the truth of the conclusion: (p1p2pn)q(p_1 \land p_2 \land \cdots \land p_n) \to q 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:

p1p2pnq\frac{p_1 \quad p_2 \quad \cdots \quad p_n}{q}

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 p1,p2,,pnqp_1, p_2, \ldots, p_n \vdash q (read ”p1,,pnp_1, \ldots, p_n entail qq”) means that qq can be derived from the premises p1,,pnp_1, \ldots, p_n using axioms, inference rules, and previously established theorems. When no premises are needed, we write q\vdash q, meaning qq 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”):

pqpq\frac{p \to q \quad p}{q}

If we know pqp \to q and pp, we may conclude qq. Its validity rests on the tautology

((pq)p)q((p \to q) \land p) \to q

To see why this is a tautology, suppose both pqp \to q and pp are true: by the truth table of the conditional, the only circumstance under which pqp \to q is true and pp is true is when qq is also true. Hence qq must hold.

Example 2.28.

Earlier established the universal statement “every prime greater than 22 is odd.” Let pp denote “7 is prime and greater than 2” and qq denote “7 is odd.” The universal claim gives pqp \to q, and we can verify pp directly (7 is prime, and 7>27 > 2); modus Ponens yields qq: the integer 7 is odd.

Problem 2.14.

Let pp denote “it is snowing” and qq denote “the lecture is cancelled.” Suppose we know pqp \to q and pp. State the conclusion and identify the inference rule. Now suppose instead we know pqp \to q and qq. Can we conclude pp? Justify your answer using the truth table of the conditional.

Modus Tollens

Theorem 2.29 (Modus Tollens).

For any propositions pp and qq,

pq¬q¬p\frac{p \to q \quad \neg q}{\neg p}

Proof.

Assume pqp \to q and ¬q\neg q. By the Contrapositive equivalence, pq¬q¬pp \to q \equiv \neg q \to \neg p. Since ¬q\neg q is true, Modus Ponens applied to ¬q¬p\neg q \to \neg p and ¬q\neg q yields ¬p\neg p.

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.

Example 2.30.

If nn is even, then n2n^2 is even. We observe that 4949 is not even and by Modus Tollens, 7 is not even.

Hypothetical Syllogism

Theorem 2.31 (Hypothetical Syllogism).

For any propositions pp, qq, rr,

pqqrpr\frac{p \to q \quad q \to r}{p \to r}

Proof.

Assume pqp \to q and qrq \to r. We wish to show prp \to r. Assume pp. From pp and pqp \to q, Modus Ponens gives qq. From qq and qrq \to r, a second application of Modus Ponens gives rr. Since assuming pp led to rr, we conclude prp \to r.

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 nn is divisible by 44, then nn is even” and “if nn is even, then n2n^2 is even.” Hypothetical Syllogism yields: “if nn is divisible by 44, then n2n^2 is even.”

Implication Elimination

Theorem 2.32 (Implication Elimination).

For any propositions pp and qq, (pq)(pq)(p \to q) \vdash (p \vdash q).

Proof.

Assume pqp \to q. We must show pqp \vdash q. Assume pp. From pqp \to q and pp, Modus Ponens yields qq. Thus pqp \vdash q.

This gives one direction of the link between a conditional and a derivation: if pqp \to q is known, then from the assumption pp one may derive qq. The reverse direction will appear later in Direct Proof, where we show that if assuming pp leads to qq, then the conditional pqp \to q is established. Together, the two directions show how the turnstile and the conditional correspond: pqp \vdash q if and only if pq\vdash p \to q.

Further Propositional Inference Rules

Several additional inference rules arise from tautologies:

Conjunction. From two established truths, their conjunction follows.

pqpq\frac{p \quad q}{p \land q}

The tautological justification is immediate, but Conjunction can also be derived from Modus Ponens alone via reductio.

Proof.

Assume pp and qq. Suppose for contradiction that ¬(pq)\neg(p \land q). By De Morgan’s Law (Theorem 6, 1), ¬(pq)¬p¬q\neg(p \land q) \equiv \neg p \lor \neg q. By the Conditional axiom, ¬p¬qp¬q\neg p \lor \neg q \equiv p \to \neg q. Since pp holds, Modus Ponens yields ¬q\neg q. But qq is assumed, a contradiction. Therefore pqp \land q.

Simplification. From a conjunction, either conjunct may be extracted.

pqp\frac{p \land q}{p}

Addition. A known truth may be weakened to a disjunction.

ppq\frac{p}{p \lor q}

Disjunctive Syllogism. If one disjunct is eliminated, the other must hold.

pq¬pq\frac{p \lor q \quad \neg p}{q}

Resolution. Two clauses sharing a complementary literal may be combined, eliminating the shared variable.

¬prpqqr\frac{\neg p \lor r \quad p \lor q}{q \lor r}

Constructive Dilemma. Two conditionals with a disjunction of their antecedents yield the disjunction of their consequents.

(αγ)(βδ)(αβ)γδ\frac{(\alpha \to \gamma) \quad (\beta \to \delta) \quad (\alpha \lor \beta)}{\gamma \lor \delta}

Problem 2.15.

Prove that all of these are tautologies.

Notice the relationships among these rules. Disjunctive Syllogism is a special case of Resolution (set r=r = \bot and apply the Identity axiom). Addition is dual to Conjunction, and Simplification is a special case of Modus Ponens (since (pq)p(p \land q) \to p is a tautology).

Remark (Resolution Subsumes Other Rules).

Resolution is remarkably powerful: It can recover Hypothetical Syllogism: rewrite pqp \to q as ¬pq\neg p \lor q and qrq \to r as ¬qr\neg q \lor r (by the Conditional axiom), then a single resolution step on qq yields ¬pr\neg p \lor r, which is prp \to r. It can also recover Modus Ponens: express pp as pp \lor \bot and pqp \to q as ¬pq\neg p \lor q, and resolution gives qqq \lor \bot \equiv q 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.

NameRuleTautologyModus Ponensp,  pq    q((pq)p)qModus Tollens¬q,  pq    ¬p((pq)¬q)¬pHyp. Syllogismpq,  qr    pr((pq)(qr))(pr)Conjunctionp,  q    pq(pq)(pq)Simplificationpq    p(pq)pAdditionp    pqp(pq)Disj. Syllogismpq,  ¬p    q((pq)¬p)qResolution¬pr,  pq    qr((¬pr)(pq))(qr)Constr. Dilemma(αγ),  (βδ),  αβ    γδ((αγ)(βδ)(αβ))(γδ)Disj. Elimination(pr),  (qr),  pq    r((pr)(qr)(pq))rEx Falsop,  ¬p    q(p¬p)q\small \begin{array}{lll} \textbf{Name} & \textbf{Rule} & \textbf{Tautology} \\ \hline \text{Modus Ponens} & p,\; p \to q \;\vdash\; q & ((p \to q) \land p) \to q \\ \text{Modus Tollens} & \neg q,\; p \to q \;\vdash\; \neg p & ((p \to q) \land \neg q) \to \neg p \\ \text{Hyp.\ Syllogism} & p \to q,\; q \to r \;\vdash\; p \to r & ((p \to q) \land (q \to r)) \to (p \to r) \\ \text{Conjunction} & p,\; q \;\vdash\; p \land q & (p \land q) \to (p \land q) \\ \text{Simplification} & p \land q \;\vdash\; p & (p \land q) \to p \\ \text{Addition} & p \;\vdash\; p \lor q & p \to (p \lor q) \\ \text{Disj.\ Syllogism} & p \lor q,\; \neg p \;\vdash\; q & ((p \lor q) \land \neg p) \to q \\ \text{Resolution} & \neg p \lor r,\; p \lor q \;\vdash\; q \lor r & ((\neg p \lor r) \land (p \lor q)) \to (q \lor r) \\ \text{Constr.\ Dilemma} & (\alpha \to \gamma),\; (\beta \to \delta),\; \alpha \lor \beta \;\vdash\; \gamma \lor \delta & ((\alpha \to \gamma) \land (\beta \to \delta) \land (\alpha \lor \beta)) \to (\gamma \lor \delta) \\ \text{Disj.\ Elimination} & (p \to r),\; (q \to r),\; p \lor q \;\vdash\; r & ((p \to r) \land (q \to r) \land (p \lor q)) \to r \\ \text{Ex Falso} & p,\; \neg p \;\vdash\; q & (p \land \neg p) \to q \end{array}

Problem 2.16.

Identify the inference rule applied in each step of the following argument. Premises: (i) pqp \to q, (ii) ¬qr\neg q \lor r, (iii) ¬r\neg r.

  1. From (ii) and (iii), conclude ¬q\neg q.
  2. From (i) and step 1, conclude ¬p\neg p.

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.

Example 2.33.

We show the following argument is valid. Premises: (1) p(pq)p \land (p \to q), (2) qrq \to r. Conclusion: rr.

1.p(pq)Premise2.qrPremise3.pSimplification from 14.pqSimplification from 15.qModus Ponens from 3, 46.rModus Ponens from 5, 2\begin{array}{rll} 1. & p \land (p \to q) & \text{Premise} \\ 2. & q \to r & \text{Premise} \\ 3. & p & \text{Simplification from 1} \\ 4. & p \to q & \text{Simplification from 1} \\ 5. & q & \text{Modus Ponens from 3, 4} \\ 6. & r & \text{Modus Ponens from 5, 2} \end{array}

Problem 2.17.

Show that the following argument is valid by listing each step and the inference rule used. Premises: (1) pqp \to q, (2) q(rs)q \to (r \land s), (3) ¬ru\neg r \lor u, (4) pp. Conclusion: uu.

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 cc:

xP(x)P(c)for any c in the universe\frac{\forall x\, P(x)}{P(c)} \quad \text{for any } c \text{ in the universe}

Universal Generalisation (UG). If P(c)P(c) can be established for an arbitrary element cc (one about which no special assumptions are made), then xP(x)\forall x\, P(x) follows:

P(c) for arbitrary cxP(x)\frac{P(c) \text{ for arbitrary } c}{\forall x\, P(x)}

The word “arbitrary” is critical. If the proof of P(c)P(c) exploits any property peculiar to cc, the generalisation is invalid.

Existential Instantiation (EI). If at least one element satisfies PP, we may introduce a name cc for such an element:

xP(x)P(c) for some c\frac{\exists x\, P(x)}{P(c) \text{ for some } c}

The name cc must be fresh: not previously used in the argument.

Existential Generalisation (EG). If a particular element cc satisfies PP, then at least one element does:

P(c)xP(x)\frac{P(c)}{\exists x\, P(x)}

Universal Modus Ponens (UMP). Combining Universal Instantiation with Modus Ponens yields perhaps the most frequently used quantifier rule in practice:

x(P(x)Q(x))P(c)Q(c)\frac{\forall x\,(P(x) \to Q(x)) \quad P(c)}{Q(c)}

Example 2.34.

Write RR for the real numbers, and suppose we know x(x>0xR)\forall x\,(x > 0 \to \sqrt{x} \in R), the universe being RR, and that 9>09 > 0. Universal Modus Ponens yields 9R\sqrt{9} \in R.

Problem 2.18.

Identify the quantifier inference rule used in each step. The universe is the positive integers.

  1. “Every multiple of 66 is a multiple of 33.” (Premise)
  2. 18=6318 = 6 \cdot 3, so 1818 is a multiple of 66.” (Premise)
  3. “Therefore, 1818 is a multiple of 33.”
  4. “Therefore, there exists a positive integer that is a multiple of 33.”

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 C(x)C(x) denote ”xx is in this class,” B(x)B(x) denote ”xx has read the book,” and E(x)E(x) denote ”xx passed the exam.” The premises are x(C(x)¬B(x))\exists x\,(C(x) \land \neg B(x)) and x(C(x)E(x))\forall x\,(C(x) \to E(x)). We derive x(E(x)¬B(x))\exists x\,(E(x) \land \neg B(x)).

1.x(C(x)¬B(x))Premise2.x(C(x)E(x))Premise3.C(a)¬B(a) for some aEI from 14.C(a)E(a)UI from 25.C(a)Simplification from 36.E(a)Modus Ponens from 4, 57.¬B(a)Simplification from 38.E(a)¬B(a)Conjunction from 6, 79.x(E(x)¬B(x))EG from 8\begin{array}{rll} 1. & \exists x\,(C(x) \land \neg B(x)) & \text{Premise} \\ 2. & \forall x\,(C(x) \to E(x)) & \text{Premise} \\ 3. & C(a) \land \neg B(a) \text{ for some } a & \text{EI from 1} \\ 4. & C(a) \to E(a) & \text{UI from 2} \\ 5. & C(a) & \text{Simplification from 3} \\ 6. & E(a) & \text{Modus Ponens from 4, 5} \\ 7. & \neg B(a) & \text{Simplification from 3} \\ 8. & E(a) \land \neg B(a) & \text{Conjunction from 6, 7} \\ 9. & \exists x\,(E(x) \land \neg B(x)) & \text{EG from 8} \end{array}

Fallacies

Definition 2.36 (Fallacy).

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 ”pqp \to q; qq; therefore pp” is invalid. A counterexample: let p=p = \bot and q=q = \top. Then pqp \to q is \top and qq is \top, but pp is \bot.

Denying the Antecedent. The argument ”pqp \to q; ¬p\neg p; therefore ¬q\neg q” is equally invalid. With p=p = \bot and q=q = \top, both premises are satisfied but ¬q\neg q is \bot.

Both fallacies confuse an implication with its converse or its inverse: pqp \to q does not entail qpq \to p, nor does it entail ¬p¬q\neg p \to \neg q.

Example 2.37.

“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.

Problem 2.19.

Identify the fallacy in each argument and provide a counterexample (an assignment under which the premises are true but the conclusion is false).

  1. “If x>2x > 2, then x>1x > 1. The number 32\tfrac{3}{2} satisfies x>1x > 1. Therefore 32>2\tfrac{3}{2} > 2.”
  2. “If x>0x > 0, then x2>0x^2 > 0. The number 1-1 does not satisfy x>0x > 0. Therefore (1)20(-1)^2 \leqslant 0.”

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 ,2,1,0,1,2,\ldots, -2, -1, 0, 1, 2, \ldots, 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 nn is even if it can be written as n=2kn = 2k for some whole number kk, and odd if it can be written as n=2k+1n = 2k + 1 for some whole number kk. Every whole number is one or the other and never both.

Definition 2.39 (Prime and Composite).

A whole number greater than 11 is composite if it is a product of two whole numbers each at least 22, and prime otherwise.

Proving Conditional Claims

Recall that pqp \to q asserts that whenever pp holds, qq necessarily holds. The conditional is already true in every case where pp fails, so no proof need consider those cases: it is enough to suppose pp and deduce qq.

The strategies are collected below. The justification column speaks about our proofs rather than inside them, and it uses     \implies for that outer step, keeping it apart from the connective \to that lives in the statements themselves;     \impliedby is the same arrow read right to left.

StrategyApproachJustificationTrivial proofShow q is trueq true    pq trueVacuous proofShow p is falsep false    pq trueDirect proofAssume p, derive qpq        pqContrapositiveAssume ¬q, derive ¬ppq¬q¬pContradictionAssume p¬q, derive r¬r(p¬q)        pq\small \begin{array}{lll} \textbf{Strategy} & \textbf{Approach} & \textbf{Justification} \\ \hline \text{Trivial proof} & \text{Show } q \text{ is true} & q \text{ true} \implies p \to q \text{ true} \\ \text{Vacuous proof} & \text{Show } p \text{ is false} & p \text{ false} \implies p \to q \text{ true} \\ \text{Direct proof} & \text{Assume } p,\text{ derive } q & p \vdash q \;\implies\; \vdash p \to q \\ \text{Contrapositive} & \text{Assume } \neg q,\text{ derive } \neg p & p \to q \equiv \neg q \to \neg p \\ \text{Contradiction} & \text{Assume } p \land \neg q,\text{ derive } r \land \neg r & (p \land \neg q) \to \bot \;\implies\; p \to q \end{array}

The last two are called indirect proofs, since they establish the conditional without constructing a chain from pp to qq.

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 x>5x > 5, then x0=0x \cdot 0 = 0” holds because the conclusion holds for every xx. A vacuous proof shows instead that the hypothesis is never met: “for every real number xx, if x<xx < x, then x=7x = 7” holds because no xx satisfies x<xx < x.

Definition 2.40 (Direct Proof).

A direct proof of a conditional statement pqp \to q proceeds by assuming pp and deriving qq through a sequence of valid inferences. The assumption of pp 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 pp allows us to derive qq using valid inferences, then the conditional pqp \to q is established. The Deduction Rule is the bridge between the turnstile (\vdash) and the conditional (\to): the statement pqp \vdash q (a syntactic derivation) becomes pqp \to q (a logical truth).

Strategy (Direct proof of a conditional).

Claim: pqp \to q

  1. Suppose pp holds.
  2. Prove that qq holds.

Proposition 2.41.

If x>1x > 1, then x2>1x^2 > 1.

Discussion.

We will assume x>1x > 1 and show x2>1x^2 > 1. Our tool is the well-known algebraic rule (which we prove later on) that if a>ba > b and c>dc > d with all four numbers positive, then ac>bdac > bd.

Proof.

Assume x>1x > 1. Since x>1>0x > 1 > 0, both xx and 11 are positive, so multiplying the inequality x>1x > 1 by itself yields x2>11=1x^2 > 1 \cdot 1 = 1. Thus x2>1x^2 > 1.

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 xx satisfies x>1x > 1, it automatically satisfies x2>1x^2 > 1.

As we know the contrapositive ¬q¬p\neg q \to \neg p is logically equivalent to pqp \to q, so proving either one proves the other. The swap is worth making when pp or qq 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: pqp \to q

  1. Suppose ¬q\neg q holds.
  2. Prove that ¬p\neg p holds.

This is the direct strategy applied to ¬q¬p\neg q \to \neg p.

Proposition 2.42.

If x3<0x^3 < 0, then x<0x < 0.

Discussion.

Here pp is "x3<0x^3 < 0" and qq is "x<0x < 0". Proving this directly is awkward, since we would begin knowing a fact about x3x^3 and have to dig our way down to a fact about xx. The contrapositive turns the tables. Since ¬q\neg q is "x0x \geqslant 0" and ¬p\neg p is "x30x^3 \geqslant 0", the contrapositive ¬q¬p\neg q \to \neg p reads “if x0x \geqslant 0, then x30x^3 \geqslant 0”, where we start from xx and build up to x3x^3; that direction is straightforward. So we will assume x0x \geqslant 0 and show x30x^3 \geqslant 0, announcing at the outset that we are proving the contrapositive.

Proof.

We prove the contrapositive: if x0x \geqslant 0, then x30x^3 \geqslant 0. Assume x0x \geqslant 0. Since all terms are non-negative, multiplying x0x \geqslant 0 by itself thrice gives xxx000x \cdot x \cdot x \geqslant 0 \cdot 0 \cdot 0, that is, x30x^3 \geqslant 0. The contrapositive holds, so the original statement “if x3<0x^3 < 0, then x<0x < 0” 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 pp by assuming ¬p\neg p and deriving a contradiction, that is, a statement of the form q¬qq \land \neg q for some proposition qq. Since a sound proof system cannot derive a false conclusion from true premises, the assumption ¬p\neg p must be false, so pp 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, ¬(pq)p¬q\neg(p \to q) \equiv p \land \neg q. 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: pqp \to q

  1. AFSOC that pp holds and qq fails.
  2. Find a contradiction.

Proposition 2.44.

For all real numbers xx and yy, if x+y>2x + y > 2, then x>1x > 1 or y>1y > 1.

Discussion.

Our statement is the conditional pqp \to q, where pp is "x+y>2x + y > 2" and qq is the disjunction ”x>1x > 1 or y>1y > 1”. A direct proof would have to settle which half of qq to aim at, and the hypothesis does not decide that for us, so we go indirectly. The negation of the whole statement is p¬qp \land \neg q, and De Morgan turns ¬q\neg q into ”x1x \leqslant 1 and y1y \leqslant 1”. That leaves us with three inequalities: we add the two coming from ¬q\neg q and set the result against pp.

Proof.

AFSOC that x+y>2x + y > 2 and that the conclusion fails, so that x1x \leqslant 1 and y1y \leqslant 1. Adding these two inequalities gives x+y2x + y \leqslant 2. But we assumed x+y>2x + y > 2, and no number is both greater than 22 and at most 22. Therefore, whenever x+y>2x + y > 2, at least one of x>1x > 1, y>1y > 1 holds.

Remark (Contradiction Against Contrapositive).

The two indirect routes are easy to confuse. A proof by contradiction assumes the negation of the entire statement, p¬qp \land \neg q, and derives an absurdity from it. A contrapositive proof assumes only ¬q\neg q and derives ¬p\neg p, 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.

Problem 2.20.

Prove that if 0<x<10 < x < 1, then x2<xx^2 < x.

Problem 2.21.

Prove that for all whole numbers nn, if 3n+23n + 2 is odd, then nn is odd.

Problem 2.22.

Prove that for all real numbers xx, if x5<0x^5 < 0, then x<0x < 0.

Proving Biconditional Claims

The connective \leftrightarrow is defined entirely in terms of \to: asserting pqp \leftrightarrow q is asserting the conjunction (pq)(qp)(p \to q) \land (q \to p). 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 (    \implies) and (    \impliedby), 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: pqp \leftrightarrow q

  1. Prove that pqp \to q, by any of the conditional methods.
  2. Prove that qpq \to p, by any of the conditional methods.

Consider ”nn is even if and only if n2n^2 is even”. Before the proof, recall the two forms an even and an odd whole number take, n=2kn = 2k and n=2k+1n = 2k + 1.

Proposition 2.45.

nn is even if and only if n2n^2 is even.

Discussion.

The two conditionals are pqp \to q, “if nn is even, then n2n^2 is even”, and qpq \to p, “if n2n^2 is even, then nn is even”. The first is straightforward: write n=2kn = 2k and show that n2=2(whole number)n^2 = 2(\text{whole number}). The second is trickier, since its hypothesis tells us about n2n^2 when we want a conclusion about nn; so we take its contrapositive ¬p¬q\neg p \to \neg q, “if nn is odd, then n2n^2 is odd”, assume n=2k+1n = 2k + 1, and show that n2=2(whole number)+1n^2 = 2(\text{whole number}) + 1.

Proof.

(    \implies) First, suppose nn is even, so n=2kn = 2k for some whole number kk. Then n2=(2k)2=4k2=2(2k2)n^2 = (2k)^2 = 4k^2 = 2(2k^2), and since 2k22k^2 is a whole number, n2n^2 is even.

(    \impliedby) The remaining conditional is “if n2n^2 is even, then nn is even”, and we prove its contrapositive: if nn is odd, then n2n^2 is odd. Suppose n=2k+1n = 2k + 1 for some whole number kk. Squaring, n2=(2k+1)2=4k2+4k+1=2(2k2+2k)+1,n^2 = (2k + 1)^2 = 4k^2 + 4k + 1 = 2(2k^2 + 2k) + 1, and since 2k2+2k2k^2 + 2k is a whole number, n2n^2 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: pqp \leftrightarrow q

  1. AFSOC that ¬(pq)¬(qp)\neg(p \to q) \lor \neg(q \to p).
  2. In the first case, p¬qp \land \neg q holds. Find a contradiction.
  3. In the second case, q¬pq \land \neg p holds. Find a contradiction.

Whether this route is worth taking depends entirely on what pp and qq are, and the direct one usually wins; but it earns its keep when both directions resist a straight argument: the two negations p¬qp \land \neg q and q¬pq \land \neg p each hand us two facts to work with where the direct proof gets one.

Proposition 2.46.

Let xx be a real number. Then x=0x = 0 if and only if no real number yy satisfies xy=1xy = 1.

Discussion.

Our statement is the biconditional pqp \leftrightarrow q, where pp is "x=0x = 0" and qq is “no real number yy satisfies xy=1xy = 1”. Both directions resist a direct argument for the same reason, which is that qq is itself a denial: proving it outright would mean ruling out every candidate yy one at a time, thus negating gets round both problems. In the first case we hold pp along with ¬q\neg q, and ¬q\neg q produces an actual yy with xy=1xy = 1, into which we may substitute x=0x = 0. In the second we hold qq along with ¬p\neg p, and x0x \neq 0 is exactly the condition under which we may divide by xx, which builds the very yy that qq says is not there.

Proof.

AFSOC that one of the two conditionals fails.

Suppose first that pp holds and qq fails, so that x=0x = 0 and some real number yy satisfies xy=1xy = 1. Then 1=xy=0y=01 = xy = 0 \cdot y = 0, and 101 \neq 0.

Suppose instead that qq holds and pp fails, so that no real number yy satisfies xy=1xy = 1, and x0x \neq 0. Since x0x \neq 0 we may divide by it, and y=1xy = \frac{1}{x} is then a real number with xy=1xy = 1, which qq 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 pp and qq to each other, we find an intermediary statement rr and prove prp \leftrightarrow r and rqr \leftrightarrow q; the chain then forces pp and qq 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: pqp \leftrightarrow q

  1. Find a statement rr.
  2. Prove that prp \leftrightarrow r, by any of the methods above.
  3. Prove that rqr \leftrightarrow q, by any of the methods above.

Proposition 2.47.

For a real number xx, the following are equivalent: x2=xx^2 = x; the product x(x1)x(x - 1) is zero; x=0x = 0 or x=1x = 1.

Discussion.

Our statement puts three conditions on a real number xx and asserts that any one of them forces the other two, so we take rr to be "x(x1)=0x(x-1) = 0" and prove the two biconditionals x2=xrx^2 = x \leftrightarrow r and rr \leftrightarrowx=0x = 0 or x=1x = 1”, each of them directly. The first is a rearrangement, and it runs in both directions because subtracting xx 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 rr to be the statement "x(x1)=0x(x - 1) = 0".

(x2=xrx^2 = x \leftrightarrow r) Subtracting xx from both sides of x2=xx^2 = x gives x2x=0x^2 - x = 0, and x2x=x(x1)x^2 - x = x(x - 1), so rr holds. Adding xx to both sides of x(x1)=0x(x-1) = 0 reverses the step, so the two conditions imply one another.

(rx=0r \leftrightarrow x = 0 or x=1x = 1) 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 x(x1)=0x(x - 1) = 0 holds exactly when x=0x = 0 or x1=0x - 1 = 0, and the latter says x=1x = 1. 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 x3+x+4=7\sqrt{x - 3} + \sqrt{x + 4} = 7. Squaring both sides and simplifying produces x=12x = 12 as the sole candidate. Squaring can introduce extraneous solutions, so we must substitute back: 9+16=3+4=7\sqrt{9} + \sqrt{16} = 3 + 4 = 7, and here the candidate is genuine. Contrast this with x+x=0x + \sqrt{x} = 0: squaring leads to candidates x=0x = 0 and x=1x = 1, but 1+1=201 + \sqrt{1} = 2 \neq 0, so only x=0x = 0 is a true solution.

Problem 2.23.

Prove that a whole number nn is even if and only if n+1n + 1 is odd. Then prove it a second time by the indirect method.

Problem 2.24.

Prove that a real number xx satisfies x3=xx^3 = x if and only if x=0x = 0, x=1x = 1, or x=1x = -1.

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: pqp \land q

  1. Prove that pp holds.
  2. Prove that qq holds.

Proposition 2.48.

If x>1x > 1, then x2>xx^2 > x and x3>x2x^3 > x^2.

Discussion.

Let pp be "x2>xx^2 > x" and qq be "x3>x2x^3 > x^2", with the hypothesis x>1x > 1 available to both. For pp we borrow a second rule of order, that if a>ba > b and c>0c > 0, then ac>bcac > bc; since x>1>0x > 1 > 0, multiplying x>1x > 1 by xx gives x2>xx^2 > x. For qq we multiply x>1x > 1 by x2x^2 instead, which the same rule permits once we know x2x^2 is positive, and pp has just told us that x2>x>1x^2 > x > 1.

Proof.

Assume x>1x > 1. Since x>1>0x > 1 > 0, the number xx is positive, so multiplying both sides of x>1x > 1 by xx gives x2>xx^2 > x, which is the first half.

For the second half, note that x2>x>1>0x^2 > x > 1 > 0, so x2x^2 is positive as well. Multiplying both sides of x>1x > 1 by x2x^2 gives x3>x2x^3 > x^2. Both halves hold, so their conjunction does.

By De Morgan’s law the negation of pqp \land q 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: pqp \land q

  1. AFSOC that ¬p¬q\neg p \lor \neg q holds.
  2. In the first case, ¬p\neg p holds. Find a contradiction.
  3. In the second case, ¬q\neg q holds. Find a contradiction.

Problem 2.25.

Prove the proposition above a second time by the indirect method, assuming that x>1x > 1 and that x2xx^2 \leqslant x or x3x2x^3 \leqslant x^2. 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: pqp \lor q

  1. Prove that pp holds, or else prove that qq holds.

The interesting case is when neither half holds on its own, because pp and qq 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 pp holds the claim is already proved and qq need not be looked at, which leaves only the cases where pp fails, and there we must guarantee qq. Since pqqpp \lor q \equiv q \lor p, the roles may be swapped, and we assume whichever negation is more useful.

Strategy (Proof of a disjunction by otherwise).

Claim: pqp \lor q

  1. Suppose ¬p\neg p holds.
  2. Prove that qq holds.

Proposition 2.49.

For every real number xx, either x1x \leqslant 1 or x2>xx^2 > x.

Discussion.

Our statement is the disjunction pqp \lor q, where pp is "x1x \leqslant 1" and qq is "x2>xx^2 > x", and neither half holds for every xx: the number 12\tfrac{1}{2} satisfies pp and fails qq, while 22 does the reverse. Thus, we take the “otherwise” route: here ¬p\neg p reads x>1x > 1, and multiplying that inequality by the positive number xx gives qq.

Proof.

Suppose x1x \leqslant 1 fails, so x>1x > 1. Then xx is positive, and multiplying both sides of x>1x > 1 by xx gives x2>xx^2 > x. 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: pqp \lor q

  1. AFSOC that ¬p¬q\neg p \land \neg q holds.
  2. Find a contradiction.

Proposition 2.50.

For all real numbers xx and yy, if xy=0xy = 0, then x=0x = 0 or y=0y = 0.

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 xy=0xy = 0 and negate the conclusion, which by gives us x0x \neq 0 and y0y \neq 0 together. A non-zero real number may be divided by, so we divide xy=0xy = 0 through by xx and read off a statement about yy that the second half of the negation denies.

Proof.

Assume xy=0xy = 0, and AFSOC that both halves of the conclusion fail, so that x0x \neq 0 and y0y \neq 0. Since x0x \neq 0 we may divide both sides of xy=0xy = 0 by xx, which gives y=0y = 0. But we assumed y0y \neq 0, and no number is both zero and non-zero. Therefore at least one of x=0x = 0, y=0y = 0 holds.

Problem 2.26.

Prove that for every real number xx, either x=0x = 0 or x2>0x^2 > 0.

Problem 2.27.

Prove the proposition about x1x \leqslant 1 and x2>xx^2 > x a second time, by the indirect method.

Proving Universal Claims

To prove xS,p(x)\forall x \in S,\, p(x) we take an arbitrary element of SS and show that pp holds of it. Nothing may be assumed about that element beyond its membership in SS: it stands for every element at once, and Universal Generalisation is what licenses the step from it to the whole of SS.

Strategy (Direct proof of a universal claim).

Claim: xS,  p(x)\forall x \in S,\; p(x)

  1. Let ySy \in S be arbitrary and fixed.
  2. Prove that p(y)p(y) holds.

Proposition 2.51.

For all whole numbers n3n \geqslant 3, the number n21n^2 - 1 is composite.

Discussion.

Our statement is universally quantified over all integers n3n \geq 3. To prove that n21n^2 - 1 is composite, we must, by definition, produce two integers each strictly greater than 11 whose product is n21n^2 - 1. The identity n21=(n+1)(n1)n^2 - 1 = (n+1)(n-1) gives us exactly such a factorisation. The only possible concern is whether the smaller factor, n1n-1, is at least 22. The hypothesis n3n \geq 3 settles this: subtracting 11 from both sides of n3n \geq 3 yields n12n - 1 \geq 2, which is precisely the lower bound we need. (Had we allowed n=2n = 2, the factorisation would read 313 \cdot 1, which is prime and therefore would fail.)

Proof.

Let n3n \geqslant 3 be any whole number. Notice that n21=(n+1)(n1)n^2 - 1 = (n + 1)(n - 1), a product of two whole numbers. Since n3n \geqslant 3, the smaller factor satisfies n12n - 1 \geqslant 2, so n21n^2 - 1 is a product of two whole numbers each at least 22. Thus n21n^2 - 1 is composite.

Remark (Arbitrary Is Not Specific).

Consider the statement “for every whole number nn, n20n^2 \geqslant 0”. The following is not a valid proof: “let nn be an arbitrary whole number, say n=17n = 17. Then 172=289017^2 = 289 \geqslant 0.” 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 nn, and every step in it must hold for all the values nn 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: xS,  p(x)\forall x \in S,\; p(x)

  1. AFSOC that there is some ySy \in S for which ¬p(y)\neg p(y) holds.
  2. Find a contradiction.

Proposition 2.52.

There is no least positive real number. That is, no positive real number aa satisfies aba \leqslant b for every positive real number bb.

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 aa with aba \leqslant b for every positive bb, so we assume such an aa and look for a positive number smaller than it. Halving serves: a2\tfrac{a}{2} is positive whenever aa is, and it is smaller than aa, so it both must and cannot satisfy the inequality aa was assumed to satisfy.

Proof.

AFSOC that a least positive real number aa exists, so that a>0a > 0 and aba \leqslant b for every positive real number bb. Consider a2\tfrac{a}{2}. Since a>0a > 0 we have a2>0\tfrac{a}{2} > 0, so a2\tfrac{a}{2} is itself a positive real number, and being one it must satisfy aa2a \leqslant \tfrac{a}{2}. But a2<a\tfrac{a}{2} < a, and no number is both smaller than aa and at least aa. Therefore no least positive real number exists.

Problem 2.28.

Prove that for every real number xx there is a real number yy with y>xy > x.

Problem 2.29.

Let xx be a real number with x0x \geqslant 0, and suppose xyx \leqslant y for every positive real number yy. Prove that x=0x = 0.

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: xS,  p(x)\exists x \in S,\; p(x)

  1. Define a specific object yy.
  2. Prove that ySy \in S.
  3. Prove that p(y)p(y) holds.

Proposition 2.53.

Fix real numbers a,b,c,d,e,fa, b, c, d, e, f with adbc0ad - bc \neq 0. Then there are real numbers xx and yy satisfying both

ax+by=eandcx+dy=f.ax + by = e \qquad \text{and} \qquad cx + dy = f.

Discussion.

The claim is existential, so the proof must produce a specific pair xx, yy 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 dd and the second by b-b makes the two yy terms cancel when we add:

adx+bdy=debcxbdy=bf(adbc)x=debf\begin{aligned} adx + bdy &= de \\ -bcx - bdy &= -bf \\ \hline (ad - bc)x &= de - bf \end{aligned}

so x=debfadbcx = \frac{de - bf}{ad - bc}, which is a real number precisely because adbc0ad - bc \neq 0. Cancelling the xx terms the same way, by multiplying the first equation by cc and the second by a-a, gives (bcad)y=ceaf(bc - ad)y = ce - af and so y=afceadbcy = \frac{af - ce}{ad - bc}.

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 adbc0ad - bc \neq 0, we may define

x=debfadbcandy=afceadbc,x = \frac{de - bf}{ad - bc} \qquad \text{and} \qquad y = \frac{af - ce}{ad - bc},

and both are real numbers. Substituting them into the two equations,

ax+by=(adeabf)+(abfbce)adbc=adebceadbc=e(adbc)adbc=e,cx+dy=(cdebcf)+(adfcde)adbc=adfbcfadbc=f(adbc)adbc=f.\begin{aligned} ax + by &= \frac{(ade - abf) + (abf - bce)}{ad - bc} = \frac{ade - bce}{ad - bc} = \frac{e(ad - bc)}{ad - bc} = e, \\ cx + dy &= \frac{(cde - bcf) + (adf - cde)}{ad - bc} = \frac{adf - bcf}{ad - bc} = \frac{f(ad - bc)}{ad - bc} = f. \end{aligned}

So the pair x,yx, y 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: xS,  p(x)\exists x \in S,\; p(x)

  1. AFSOC that for every ySy \in S, ¬p(y)\neg p(y) holds.
  2. Find a contradiction.

Proposition 2.54.

Let aa, bb, cc 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 aa, bb, cc 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 ab<0ab < 0, bc<0bc < 0 and ac<0ac < 0 at once. Multiplying all three together produces (abc)2(abc)^2, and a square cannot be negative.

Proof.

AFSOC that no two of aa, bb, cc have a non-negative product, so that ab<0ab < 0, bc<0bc < 0, and ac<0ac < 0. Multiplying the first two of these negative numbers gives a positive one, and multiplying that by the third gives a negative one, so

(ab)(bc)(ac)<0.(ab)(bc)(ac) < 0.

But (ab)(bc)(ac)=a2b2c2=(abc)2(ab)(bc)(ac) = a^2b^2c^2 = (abc)^2, 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 (abc)2(abc)^2 is both negative and non-negative, which is impossible. Therefore some two of aa, bb, cc 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 xx and yy both work and concluding that x=yx = y.

Strategy (Proof of a unique existential claim).

Claim: !xS,  p(x)\exists!\, x \in S,\; p(x)

  1. Prove xS,  p(x)\exists x \in S,\; p(x), by either method above.
  2. Suppose p(x)p(x) and p(y)p(y) both hold, and prove that x=yx = y.

Proposition 2.55.

There exists a unique real number xx such that 3x1=03x - 1 = 0.

Discussion.

Unique existence is two claims, so the proof comes in two halves. Existence asks for one real number satisfying 3x1=03x - 1 = 0, and we verify x=13x = \tfrac{1}{3} 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 xx and yy both satisfy the equation and show that the supposition forces x=yx = y.

Proof.

Consider x=13x = \tfrac{1}{3}: then 3131=11=03 \cdot \tfrac{1}{3} - 1 = 1 - 1 = 0, so at least one real number works. For uniqueness, suppose xx and yy both satisfy the equation. Then 3x1=0=3y13x - 1 = 0 = 3y - 1, so 3x=3y3x = 3y, and dividing by 33 gives x=yx = y. Thus exactly one real number satisfies 3x1=03x - 1 = 0.

Problem 2.30.

Fix a real number aa. Prove that the equation x2+2ax+a2=0x^2 + 2ax + a^2 = 0 has exactly one real solution.

Problem 2.31.

Fix a real number aa. Prove that there is a real number xx satisfying x3+(1a2)xa=0x^3 + (1 - a^2)x - a = 0.

Disproving Claims

To disprove a statement is to show that its truth value is \bot, and by the definition of negation that is the same as showing its negation is \top. 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 nn, the number nn 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 2k2k, and any k2k \geqslant 2 makes 2k2k a product of two whole numbers each at least 22, hence composite; that leaves k=1k = 1 as the only candidate, and it works.

Disproof.

The number 22 is prime, and 22 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 xx such that x2<0x^2 < 0.

Discussion.

Disproving an existential claim means proving its negation, and that negation is universal: every real number must satisfy x20x^2 \geqslant 0, so no single well-chosen xx will settle it and the argument has to cover all of them at once. What stands in the way is the sign of xx, 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 xx, x20x^2 \geqslant 0. Every real number falls into one of two cases, x0x \geqslant 0 or x<0x < 0. If x0x \geqslant 0, multiplying the inequality by itself preserves the sign, so xx00x \cdot x \geqslant 0 \cdot 0, that is, x20x^2 \geqslant 0. If x<0x < 0, multiplying through by 1-1 flips the inequality to x>0-x > 0; multiplying x>0-x > 0 by itself then gives (x)(x)>00(-x)(-x) > 0 \cdot 0, so x2>0x^2 > 0 and in particular x20x^2 \geqslant 0. Either way x20x^2 \geqslant 0, so the claim is false.

Problem 2.32.

Disprove: for every real number xx, x2>xx^2 > x.

Problem 2.33.

Disprove: there is a real number xx with x2+x+1=0x^2 + x + 1 = 0.

The Law of Excluded Middle

Theorem 2.58 (Law of Excluded Middle).

For any proposition pp, p¬pp \lor \neg p is a tautology.

Proof.

By the Complement axiom, ¬pp\neg p \lor p \equiv \top. By the Commutativity axiom, ¬ppp¬p\neg p \lor p \equiv p \lor \neg p. Therefore p¬pp \lor \neg p \equiv \top.

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 pp and ¬p\neg p without knowing which of them actually holds, and a conclusion reached in both cases is established without our ever finding out.

Proposition 2.59.

Let mm and nn be whole numbers. If mnmn is even, then mm is even or nn is even.

Discussion.

Our statement is the conditional whose hypothesis is ”mnmn is even” and whose conclusion is the disjunction ”mm is even or nn is even”. The hypothesis says nothing about mm on its own and no computation extracts it, so we appeal to LEM and split on whether mm is even. One case gives the conclusion immediately. In the other mm is odd, and we show that an odd nn would make mnmn odd against the hypothesis, which leaves nn even.

Proof.

Suppose mnmn is even. By LEM, either mm is even or mm is odd.

Case 1. If mm is even, the conclusion holds immediately.

Case 2. Suppose mm is odd, so m=2j+1m = 2j + 1 for some whole number jj. If nn were also odd, say n=2k+1n = 2k + 1, then mn=(2j+1)(2k+1)=4jk+2j+2k+1=2(2jk+j+k)+1,mn = (2j + 1)(2k + 1) = 4jk + 2j + 2k + 1 = 2(2jk + j + k) + 1, so mnmn would be odd, contradicting the hypothesis that mnmn is even. Therefore nn is even.

In both cases at least one of mm, nn is even.

Problem 2.34.

Using the Law of Excluded Middle, prove that for all whole numbers nn, the number n(n+1)n(n + 1) is even.

Problem 2.35.

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:

p¬pqfor every q\frac{p \quad \neg p}{q} \quad \text{for every } q

Its validity rests on the tautology (p¬p)q(p \land \neg p) \to q: since p¬pp \land \neg p is identically false, the conditional holds for every qq by vacuous truth.

Example 2.60 (Consequences of a Contradiction).

Suppose we accept the false premise 1=1-1 = 1. Adding 11 to both sides gives 0=20 = 2, a false consequence. Squaring both sides gives 1=11 = 1, 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 pqp \lor q. Knowing the disjunction holds means at least one of pp, qq holds, so we may consider each separately and argue as follows.

Strategy (Using a disjunction).

Because pqp \lor q, we have two cases.

Case 1. Suppose pp holds. Then …

Case 2. Suppose qq 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 xx and yy are whole numbers and both xyxy and x+yx + y are even, then xx and yy are both even,” we must show that if xx or yy is odd then xyxy or x+yx + y is odd. Since the hypotheses are symmetric in xx and yy, we may assume WLOG that xx is odd; the remaining case follows by swapping xx and yy.

“There exists” is not “let such an xx be given”. Writing xS,p(x)\exists x \in S,\, p(x) in the middle of a proof asserts only that the line is true: that some element of SS with the property is out there. It does not introduce one. If we go on to refer to xx 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 xx be given. Thereafter xx 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 xx, yy, zz such that p(x,y,z)p(x, y, z) holds. Let such xx, yy, zz be given.”

"pqp \to q" is not ”pp, therefore qq”. Writing pqp \to q on the page asserts that the implication holds; it does not assert qq. To deduce qq we must make it clear that we also have pp, and that we are using Modus Ponens on the two.

Strategy (Using a conditional).

pqp \to q because …

Also, pp holds because …

Therefore qq holds.

Remark (Mistakes in Proofs).

A chain of equalities is only as strong as its weakest step. Consider the “proof” that 1=1-1 = 1:

1=(1)1=(1)2/2=((1)2)1/2=11/2=1\begin{aligned} -1 &= (-1)^1 \\ &= (-1)^{2/2} \\ &= \bigl((-1)^2\bigr)^{1/2} \\ &= 1^{1/2} \\ &= 1 \end{aligned}

The error is in the third step: the law (xa)b=xab(x^a)^b = x^{ab} requires x0x \geqslant 0. Each step in a proof must be a valid inference rather than a plausible manipulation.

Finally, Quantifiers can also conceal errors. The formula (pq)(qp)(p \to q) \lor (q \to p) is a propositional tautology (verify this by truth table). Substituting predicates p(n)p(n) = ”nn is odd” and q(n)q(n) = ”nn is prime,” one might reason: “for every nn, either oddness implies primality or primality implies oddness.” Yet neither n(p(n)q(n))\forall n\,(p(n) \to q(n)) nor n(q(n)p(n))\forall n\,(q(n) \to p(n)) is true. The resolution is that n[(p(n)q(n))(q(n)p(n))]\forall n\,[(p(n) \to q(n)) \lor (q(n) \to p(n))] is not the same as [n(p(n)q(n))][n(q(n)p(n))][\forall n\,(p(n) \to q(n))] \lor [\forall n\,(q(n) \to p(n))]. The universal quantifier does not distribute over disjunction. The first formula is indeed true (for each fixed nn, 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.

Exercise 2.1.

Each expression below is built from predicates over a fixed universe. Say what it is.

x(P(x))Q(x)\forall x\,(P(x)) \lor Q(x)

answer one of these

x(P(x)Q(x))\forall x\,(P(x) \lor Q(x))

answer one of these

y(x+y=0)\exists y\,(x + y = 0)

answer one of these

z(P(x)Q(y,z))\exists z\,(P(x) \to Q(y, z))

answer one of these

Exercise 2.2.

Membership and the bounded quantifiers.

Let T={1,{1}}T = \{1, \{1\}\}. Which holds?

answer one of these

Some object cc lies outside AA. Which of these is then true, whatever PP is?

answer one of these

Exercise 2.3.

Negate each statement, leaving no negation in front of a quantifier and no “it is not the case that” anywhere.

Every multiple of 88 is even.

answer one of these

There is a real number xx such that x2=2x^2 = 2 and x<0x < 0.

answer one of these

If nn is prime, then nn is odd.

answer one of these

Exercise 2.4.

Take the conditional “if nn is a multiple of 1212, then nn is a multiple of 33”, with nn ranging over the whole numbers.

The converse and the inverse are:

answer one of these

The contrapositive is:

answer one of these

Whatever conditional we had started from, at most how many distinct truth values can the four statements carry between them?

answer one of these

Exercise 2.5.

Let UU be the whole numbers and let P(x,y)P(x, y) denote ”x+yx + y is even”.

xUyU(P(x,y))\forall x \in U\, \forall y \in U\,(P(x, y))

answer one of these

xUyU(P(x,y))\forall x \in U\, \exists y \in U\,(P(x, y))

answer one of these

yUxU(P(x,y))\exists y \in U\, \forall x \in U\,(P(x, y))

answer one of these

For xUyU(P(x,y))\forall x \in U\, \exists y \in U\,(P(x, y)), which witness works?

answer one of these

Exercise 2.6.

Let PP and QQ be predicates over an arbitrary universe. Classify each statement.

x(P(x)¬P(x))\forall x\,(P(x) \lor \neg P(x))

answer one of these

x(P(x))x(¬P(x))\exists x\,(P(x)) \lor \forall x\,(\neg P(x))

answer one of these

x(P(x))x(P(x))\exists x\,(P(x)) \to \forall x\,(P(x))

answer one of these

x(P(x)Q(x))x(P(x)¬Q(x))\forall x\,(P(x) \to Q(x)) \land \exists x\,(P(x) \land \neg Q(x))

answer one of these

Exercise 2.7.

Each argument form below is invalid. Give an assignment at which every premise holds and the conclusion fails.

pq,  p    ¬qp \lor q,\; p \;\vdash\; \neg q

answer assignment
p q

pq,  qr    rpp \to q,\; q \to r \;\vdash\; r \to p

answer assignment
p q r

p(qr),  ¬q    ¬pp \to (q \lor r),\; \neg q \;\vdash\; \neg p

answer assignment
p q r

Exercise 2.8.

Push each negation inward until it stands in front of the predicate alone.

¬(xS(p(x)q(x)))\neg\bigl(\forall x \in S\,(p(x) \to q(x))\bigr)

answer one of these

¬(xy(P(x,y)Q(y)))\neg\bigl(\exists x\, \forall y\,(P(x, y) \to Q(y))\bigr)

answer one of these

Exercise 2.9.

The shape of a claim decides the shape of its proof.

Take the claim: for every real number xx, if x4<1x^4 < 1 then x<1x < 1. A proof of it by contrapositive opens by assuming:

answer one of these

A proof of the same claim by contradiction opens by assuming:

answer one of these

A proof of !xS(p(x))\exists!\, x \in S\,(p(x)) that produces a witness and stops there has established:

answer one of these

To disprove xS(p(x))\exists x \in S\,(p(x)):

answer one of these

Exercise 2.10.

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 m+nm + n is even, then mnmn is even.

answer one of these

If x2>xx^2 > x, then x>1x > 1.

answer one of these

For whole numbers mm and nn, the sum m+nm + n is even exactly when:

answer one of these

Exercise 2.11.

Let mm and bb be real numbers and consider the equation mx+b=0mx + b = 0.

Suppose m0m \neq 0, so that the equation has exactly one real solution. Which step of the uniqueness half of that proof is the one that uses m0m \neq 0?

answer one of these

If m=0m = 0:

answer one of these

Exercise 2.12.

A whole number is a difference of two squares if it can be written as a2b2a^2 - b^2 for whole numbers aa and bb.

Which pair of squares has difference 2k+12k + 1?

answer one of these

Which whole numbers are a difference of two squares?

answer one of these

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, \top, \bot and negation. What is missing is the rest of the connectives. Each of \land, \lor and \leftrightarrow 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.

lean worked
1example (p q : Prop) (hp : p) (hq : q) : p  q := by
verified
goalGoals accomplished.

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.

lean worked
1example (p q : Prop) (h : p  q) : q := by
verified
goalGoals accomplished.

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.

lean worked
1example (p q r : Prop) (h : p  q) (hr : r) : r  p := by
verified
goalGoals accomplished.

Exercise 2.13.

Two assumptions make their conjunction.

lean proof
1example (p q : Prop) : p  q  p  q := by
goalp q : Prop p q p q

Exercise 2.14.

The order of a conjunction carries no information.

lean proof
1example (p q : Prop) : p  q  q  p := by
goalp q : Prop p q q p

Exercise 2.15.

Nor does the bracketing.

lean proof
1example (p q r : Prop) : (p  q)  r  p  (q  r) := by
goalp q r : Prop (p q) r p q r

Exercise 2.16.

Two hypotheses taken in turn, against the two taken together.

lean proof
1example (p q r : Prop) : (p  q  r)  (p  q  r) := by
goalp q r : Prop (p q r) p q r

Exercise 2.17.

No statement holds alongside its own negation.

lean proof
1example (p : Prop) : ¬(p  ¬p) := by
goalp : Prop ¬(p ¬p)

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 pp, so the right half is the one to go for.

lean worked
1example (p q : Prop) (hq : q) : p  q := by
verified
goalGoals accomplished.

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.

lean worked
1example (p q r : Prop) (h : p  q) (hpr : p  r) (hqr : q  r) : r := by
verified
goalGoals accomplished.

Exercise 2.18.

The order of a disjunction carries no information either, but here we must first find out which half we were handed.

lean proof
1example (p q : Prop) : p  q  q  p := by
goalp q : Prop p q q p

Exercise 2.19.

Nor does the bracketing of a disjunction.

lean proof
1example (p q r : Prop) : (p  q)  r  p  (q  r) := by
goalp q r : Prop (p q) r p q r

Exercise 2.20.

Conjunction distributes over disjunction.

lean proof
1example (p q r : Prop) : p  (q  r)  (p  q)  (p  r) := by
goalp q r : Prop p (q r) p q p r

Exercise 2.21.

One of De Morgan’s laws.

lean proof
1example (p q : Prop) : ¬(p  q)  ¬p  ¬q := by
goalp q : Prop ¬(p q) ¬p ¬q

Exercise 2.22.

Half of the defining equivalence of the conditional.

lean proof
1example (p q : Prop) : ¬p  q  (p  q) := by
goalp q : Prop ¬p q p q

Exercise 2.23.

And the other half.

lean proof
1example (p q : Prop) : (p  q)  ¬p  q := by
goalp q : Prop (p q) ¬p q

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.

lean worked
1example (p q : Prop) (h : p  q) (k : q  p) : p  q := by
verified
goalGoals accomplished.

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.

lean worked
1example (p q : Prop) (h : p  q) (hq : q) : p := by
verified
goalGoals accomplished.

Exercise 2.24.

An equivalence may be read from either end.

lean proof
1example (p q : Prop) : (p  q)  (q  p) := by
goalp q : Prop (p q) (q p)

Exercise 2.25.

Equivalence is transitive.

lean proof
1example (p q r : Prop) : (p  q)  (q  r)  (p  r) := by
goalp q r : Prop (p q) (q r) (p r)

Exercise 2.26.

A statement conjoined with itself says no more than the statement.

lean proof
1example (p : Prop) : p  p  p := by
goalp : Prop p p p

Exercise 2.27.

Equivalent statements may be swapped for one another inside a disjunction.

lean proof
1example (p q r : Prop) : (p  q)  (p  r  q  r) := by
goalp q r : Prop (p q) (p r q r)

Exercise 2.28.

No statement is equivalent to its own negation.

lean proof
1example (p : Prop) : ¬(p  ¬p) := by
goalp : Prop ¬(p ¬p)
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