Logic and Quantifiers

The Language of Mathematical Statements

Target Audience: Anyone about to read or write their first proofs.

Prerequisites: None beyond arithmetic. This is the first page of the Logic & Proof series; the proof techniques themselves come in the next page.

How to Read This Page

Every theorem on this site is a statement, and every proof is an argument that a statement is true. Before either can be read with precision, three things have to be nailed down: exactly what a statement is, how small statements combine into large ones, and what the words for all and there exists commit you to. That is the whole of this page.

Work the truth tables in Sections 2–5 by hand at least once before using the equivalence explorer — the explorer is for checking and exploring, not for replacing the skill. The two sections that repay the most rereading are the conditional, whose truth table surprises everyone once, and negation, which is the single most-used skill in proof writing.

Companion material: four step-through definition pages and three formula quizzes under Logic & Proof restate the definitions and laws for review; they are linked from the summary.

1. What Is a Statement?

Mathematics is built from sentences that are either true or false — not sentences that are questions, commands, opinions, or that depend on an unspecified quantity.

Definition: Statement

A statement (or proposition) is a sentence or mathematical expression that is definitely true or definitely false. Its truth value is true (\(T\)) or false (\(F\)), and it has exactly one of them.

Nothing in the definition says we must know which value it has — only that it has one.

Examples

  • \(7\) is a prime number. True.
  • \(2 + 2 = 5\). False.
  • There are infinitely many primes. True — proved on this site (The Infinitude of Primes).
  • Every even integer greater than \(2\) is the sum of two primes. A statement — it is either true or false — even though nobody knows which (this is Goldbach's conjecture, open since 1742).

Not statements:

  • Is \(7\) prime? (a question)
  • Add \(3\) to both sides. (a command)
  • \(x\) is even. (true for some \(x\), false for others — see below)

Open Sentences

The last example is the important one. "\(x\) is even" is not a statement because its truth depends on \(x\): true when \(x = 4\), false when \(x = 7\). A sentence whose truth value depends on one or more variables is an open sentence. We write it with the variables shown,

\[ P(x): \; x \text{ is even}, \qquad R(x, y): \; x \lt y, \]

so that \(P(4)\) is a true statement and \(P(7)\) a false one. An open sentence becomes a statement in two ways: by substituting specific values, or by quantifying the variable — "for every integer \(x\), \(P(x)\)" is a statement (a false one). Quantifiers are the subject of Section 7.

Naming Statements

We use capital letters \(P, Q, R, \ldots\) to stand for statements, exactly as algebra uses \(x, y, z\) to stand for numbers. The sentence "\(P\) is true" then means "the statement named \(P\) has truth value \(T\)." Everything in the next five sections is about how the truth value of a compound statement is determined by the truth values of its parts.

2. And, Or, Not

Three operations build new statements out of old ones. Each is defined by a truth table: a complete list of the truth values of the new statement for every combination of truth values of its parts.

Definition: Conjunction, Disjunction, Negation

  • The conjunction \(P \land Q\) ("\(P\) and \(Q\)") is true exactly when both \(P\) and \(Q\) are true.
  • The disjunction \(P \lor Q\) ("\(P\) or \(Q\)") is true exactly when at least one of \(P\), \(Q\) is true.
  • The negation \(\lnot P\) ("not \(P\)") is true exactly when \(P\) is false.
\(P\) \(Q\) \(P \land Q\) \(P \lor Q\) \(\lnot P\)
T T T T F
T F F T F
F T F T T
F F F F T

Row convention: with two statements there are \(2 \times 2 = 4\) combinations; with \(n\) statements, \(2^n\). Listing \(T\) before \(F\) and varying the rightmost letter fastest gives every table the same shape, which makes tables comparable at a glance.

Pitfall: "or" is inclusive

In everyday speech "soup or salad" usually means one but not both. In mathematics \(P \lor Q\) is true when both are true — the first row of the table. So "\(x\) is even or \(x\) is prime" is a true statement about \(x = 2\), which is both.

When exclusive "or" is genuinely wanted, mathematics says so: "exactly one of \(P\), \(Q\)," which is the compound statement \((P \lor Q) \land \lnot(P \land Q)\) worked out in Section 5.

Worked Example

Decide the truth value of each statement.

  1. \((-3 \in \mathbb{Z}) \land (-3 \in \mathbb{N})\). The first part is true, the second false (the natural numbers are \(1, 2, 3, \ldots\)); a conjunction with a false part is false.
  2. \((\sqrt{2} \in \mathbb{Q}) \lor (\pi \gt 3)\). The first part is false (see The Irrationality of √2), the second true; a disjunction with a true part is true.
  3. \(\lnot(5 \lt 3)\). The inner statement is false, so its negation is true. In practice one writes \(5 \geq 3\) — the negation of \(\lt\) is \(\geq\), not \(\gt\).

3. The Conditional Statement

Almost every theorem has the shape "if this, then that." The conditional is the connective that captures it, and its truth table is the one that has to be understood rather than merely memorised.

Definition: Conditional Statement

The conditional \(P \Rightarrow Q\) ("if \(P\), then \(Q\)"; also written \(P \to Q\)) is false in exactly one case: when \(P\) is true and \(Q\) is false. In every other case it is true. \(P\) is the hypothesis (or antecedent), \(Q\) the conclusion (or consequent).

\(P\) \(Q\) \(P \Rightarrow Q\)
T T T
T F F
F T T
F F T

Why a False Hypothesis Makes the Conditional True

The last two rows are the ones that feel wrong: how can "if \(P\) then \(Q\)" be true when \(P\) is false? Two ways to see it.

The promise. "If it rains tomorrow, I will bring an umbrella." If it does not rain, I have not broken my promise whatever I do — the promise can only be broken by rain with no umbrella. A conditional is a promise about the case \(P\) true, and it is false only when that promise is broken.

The mathematical reason. Consider the theorem "if \(x\) is even, then \(x^2\) is even." We want this to be a true statement — true for every integer \(x\), including \(x = 3\). For \(x = 3\) the hypothesis is false. If a false hypothesis made the conditional false, then \(x = 3\) would be a counterexample to a theorem that is obviously right. The only way to let "for all \(x\)" range over all integers is to count the false-hypothesis cases as true.

Vacuous Truth

A conditional whose hypothesis is never satisfied is true for that reason alone, and is said to be vacuously true. "Every element of the empty set is purple" is true: there is no element to fail. This is not a curiosity — the Uniqueness of Limits proof has to guard explicitly against a limit definition being satisfied vacuously, and the guard is where the argument's real content lives.

A conditional does not need its hypothesis settled to be worth proving. Von Koch proved in 1901 that if the Riemann Hypothesis is true, then the count of primes up to \(x\) matches the logarithmic-integral estimate to within \(O(\sqrt{x}\,\log x)\) — a genuine theorem, proved over a century ago, whose hypothesis is still unresolved today. The truth of \(P \Rightarrow Q\) never waits on the truth of \(P\); it is exactly this fact that lets the proof techniques ahead build \(P \Rightarrow Q\) from an assumed \(P\) whose own truth is never in question inside the argument.

The Many Ways to Say \(P \Rightarrow Q\)

All of the following mean exactly \(P \Rightarrow Q\):

Phrasing Note
If \(P\), then \(Q\). The standard form.
\(Q\) if \(P\). Same statement, clauses swapped.
\(P\) only if \(Q\). "Only if" points at the conclusion. The most misread form.
\(P\) is sufficient for \(Q\). Knowing \(P\) is enough to get \(Q\).
\(Q\) is necessary for \(P\). \(P\) cannot hold without \(Q\).
Whenever \(P\), \(Q\). Common in theorem statements.

Notice that which letter is the antecedent changes with the phrasing: in "\(P\) if \(Q\)" the antecedent is \(Q\) — the connective's tail sits right after "if"; in "\(P\) only if \(Q\)" the antecedent is \(P\) itself. The two forms are not the same statement read two ways; they pin down different halves of a biconditional, which is exactly why Section 4 needs both to nail \(P\) and \(Q\) down completely.

Sufficient, Not Necessary

"\(P\) if \(Q\)" makes \(Q\) a sufficient condition for \(P\): knowing \(Q\) is enough, on its own, to guarantee \(P\). It does not make \(Q\) the only route to \(P\) — there may be others.

Worked Example

"\(n\) is even if \(n\) is divisible by \(4\)" is true, and divisibility by \(4\) is sufficient for evenness. But it is not necessary: \(n = 6\) is even without being divisible by \(4\), so there is at least one other route to the same conclusion.

Reasoning backwards from \(P\) to \(Q\) here — "\(n\) is even, so \(n\) is divisible by \(4\)" — is affirming the consequent, named and refuted in Section 10.

Necessary, Not Sufficient

"\(P\) only if \(Q\)" makes \(Q\) a necessary condition for \(P\): without \(Q\), \(P\) cannot hold. It does not make \(Q\) enough on its own — \(Q\) can hold while \(P\) still fails, because some other requirement is unmet.

Worked Example

"A series converges only if its terms tend to \(0\)" — convergence \(\Rightarrow\) terms \(\to 0\). Necessary, and famously not sufficient: the harmonic series \(\sum 1/n\) has terms tending to \(0\) and diverges anyway. Because of this, the statement is used almost exclusively in its contrapositive form — the terms do not tend to \(0\), therefore the series diverges. That is the typical fate of a necessary condition: it earns its keep as a test for failure, not as a route to success.

Reasoning forwards from \(Q\) to \(P\) — "the terms tend to \(0\), so the series converges" — is the same invalid move as before, wearing different clothes.

Why "Only If" and "Necessary" Feel Backwards

Necessary sounds like the stronger word, so it is tempting to expect \(Q \Rightarrow P\) rather than \(P \Rightarrow Q\). The arrow runs the other way for a structural reason. If \(Q\) is necessary for \(P\), then every case where \(P\) holds is a case where \(Q\) holds too — the \(P\)-cases form a subset of the \(Q\)-cases. "Everything in the small set is in the big set" is exactly \(P \Rightarrow Q\). Sufficient conditions are narrow and specific; necessary conditions are broad and cheap to satisfy — which is also why a necessary condition alone rarely settles anything: knowing \(7\) is prime settles nothing about whether \(7\) is prime and greater than a million, even though primality is necessary for that stronger claim.

The Two Forms on One Sentence

  • "You may drive if you are sixteen" hands you a licence the moment you turn sixteen. Sufficient — a gift.
  • "You may drive only if you are sixteen" hands you nothing. It rules out driving while younger; you may still lack a test pass, a car, or working eyesight. Necessary — a gate.

Every necessary condition is a gate of this kind: it can stop you, it cannot start you.

Converse, Inverse, Contrapositive

From \(P \Rightarrow Q\) three related conditionals can be formed:

The contrapositive always has the same truth value as the original (proved in Section 6); the converse and inverse in general do not.

Worked Example

Let \(P \Rightarrow Q\) be "if \(n\) is divisible by \(4\), then \(n\) is even" (true).

  • Converse: "if \(n\) is even, then \(n\) is divisible by \(4\)." False — \(n = 6\).
  • Inverse: "if \(n\) is not divisible by \(4\), then \(n\) is odd." False — again \(n = 6\).
  • Contrapositive: "if \(n\) is odd, then \(n\) is not divisible by \(4\)." True, as it must be.

Pitfall: a true conditional says nothing when \(P\) fails

From "if \(n\) is divisible by \(4\), then \(n\) is even" and the fact that \(6\) is not divisible by \(4\), you can conclude nothing about whether \(6\) is even. Reasoning "\(P\) is false, so \(Q\) is false" is the inverse, and the inverse is not implied by the original.

The Parsing Habit

When a sentence mixes "if" and "only if" into ordinary prose, find the connective first. Plain if introduces the tail of the arrow — the sufficient condition, on the side the arrow points away from. Only if introduces the head — the necessary condition, on the side the arrow points to. Placed mid-sentence, "\(P\) if \(Q\)" has its tail after the connective (\(Q \Rightarrow P\)); "\(P\) only if \(Q\)" has its tail before it (\(P \Rightarrow Q\)).

Then sanity-check by naming the single row of the truth table the statement forbids. If you can name that row, you have read the direction correctly.

4. The Biconditional

Definition: Biconditional Statement

The biconditional \(P \Leftrightarrow Q\) ("\(P\) if and only if \(Q\)"; also written \(P \leftrightarrow Q\), and abbreviated "\(P\) iff \(Q\)") is true exactly when \(P\) and \(Q\) have the same truth value.

\(P\) \(Q\) \(P \Leftrightarrow Q\)
T T T
T F F
F T F
F F T

The name says what it is: a conditional in both directions. "\(P\) if \(Q\)" is \(Q \Rightarrow P\), and "\(P\) only if \(Q\)" is \(P \Rightarrow Q\); together,

\[ (P \Leftrightarrow Q) \;\equiv\; (P \Rightarrow Q) \land (Q \Rightarrow P). \]

This single line explains a convention you will meet on every "if and only if" theorem: its proof has two parts, one for each direction, and a proof that establishes only one of them has proved a weaker theorem. In the language of Section 3, \(P\) is both necessary and sufficient for \(Q\).

Example

"An integer \(n\) is even if and only if \(n^2\) is even." Both directions are true (the forward direction is a one-line direct proof; the reverse is the contrapositive "if \(n\) is odd then \(n^2\) is odd"), so the biconditional is true. It is precisely this biconditional that the Irrationality of √2 proof leans on when it passes from "\(a^2\) is even" to "\(a\) is even."

A Notorious Trap: "if" in a Definition Usually Means "iff"

In a theorem, plain "if" is one-directional — Section 3 is unambiguous about that. In a definition, mathematical writing almost universally uses "if" to mean "if and only if," even though the word "only" never appears. "An integer \(n\) is even if it is divisible by \(2\)" is a definition, not a theorem, and it is understood to assert both directions: \(n\) is even \(\Leftrightarrow\) \(2 \mid n\).

The signal is context, not wording: a sentence that introduces a term (says what a word means) is a biconditional by convention; a sentence that relates already-defined terms (a theorem) means exactly what it says, one direction only.

5. Truth Tables for Compound Statements

Connectives nest: \(\lnot(P \land Q)\), \((P \lor Q) \land \lnot(P \land Q)\), and so on. The truth value of any such compound statement is computed mechanically, from the inside out, and the truth table records the result for every row. The method:

  1. List every combination of truth values of the letters (\(2^n\) rows).
  2. Add one column for each sub-expression, innermost first.
  3. Fill each column from the columns it depends on, one row at a time.

Parentheses and a precedence convention decide what "innermost" means: \(\lnot\) binds most tightly, then \(\land\), then \(\lor\), then \(\Rightarrow\), then \(\Leftrightarrow\). So \(\lnot P \lor Q\) means \((\lnot P) \lor Q\), not \(\lnot(P \lor Q)\). When in doubt, add parentheses — nobody has ever been marked down for them.

Worked Example: exclusive or

Build the table for \((P \lor Q) \land \lnot(P \land Q)\), the statement "exactly one of \(P\), \(Q\) is true."

\(P\) \(Q\) \(P \lor Q\) \(P \land Q\) \(\lnot(P \land Q)\) \((P \lor Q) \land \lnot(P \land Q)\)
T T T T F F
T F T F T T
F T T F T T
F F F F T F

The final column is \(T\) exactly in the two rows where \(P\) and \(Q\) differ — exclusive or, as intended. Notice it is also the column for \(\lnot(P \Leftrightarrow Q)\).

Interactive: Equivalence Explorer

Type two expressions in \(P\), \(Q\), \(R\) — or pick a pair from the menu — and the explorer builds both truth tables with one column per sub-expression, then compares the final columns. Rows where the two expressions disagree are highlighted. Typing ~ & | -> <-> works as well as the symbol buttons.

First expression

Second expression

Build the tables to compare.

Two expressions are logically equivalent exactly when their final columns match row for row. A column of all \(T\) is a tautology; all \(F\), a contradiction.

6. Logical Equivalence

Definition: Logically Equivalent

Two statements are logically equivalent, written \(P \equiv Q\), when they have the same truth value in every row of their joint truth table — that is, when \(P \Leftrightarrow Q\) is true no matter what truth values the letters take.

Equivalent statements can be substituted for one another anywhere, which is what makes the laws below usable: each one licenses a rewrite.

Definition: Tautology and Contradiction

A statement true in every row is a tautology (\(P \lor \lnot P\), the law of the excluded middle); one false in every row is a contradiction (\(P \land \lnot P\)). A proof by contradiction, met in the next page, works by deriving a contradiction from a supposition.

The Laws Worth Knowing by Name

Law Equivalence
Double negation \(\lnot\lnot P \equiv P\)
De Morgan's laws \(\lnot(P \land Q) \equiv \lnot P \lor \lnot Q\) and \(\lnot(P \lor Q) \equiv \lnot P \land \lnot Q\)
Contrapositive \((P \Rightarrow Q) \equiv (\lnot Q \Rightarrow \lnot P)\)
Conditional as disjunction \((P \Rightarrow Q) \equiv (\lnot P \lor Q)\)
Negated conditional \(\lnot(P \Rightarrow Q) \equiv P \land \lnot Q\)
Biconditional \((P \Leftrightarrow Q) \equiv (P \Rightarrow Q) \land (Q \Rightarrow P)\)
Commutative \(P \land Q \equiv Q \land P\), \(P \lor Q \equiv Q \lor P\)
Associative \((P \land Q) \land R \equiv P \land (Q \land R)\), likewise for \(\lor\)
Distributive \(P \land (Q \lor R) \equiv (P \land Q) \lor (P \land R)\) and \(P \lor (Q \land R) \equiv (P \lor Q) \land (P \lor R)\)

Every one of these is a preset in the explorer. Note what is not on the list: \(\Rightarrow\) is neither commutative (that would make the converse equivalent) nor associative (try the last preset).

Worked Example: two proofs of one law

Show that \(\lnot(P \Rightarrow Q) \equiv P \land \lnot Q\).

By table. \(P \Rightarrow Q\) is false only in the row \(P = T\), \(Q = F\); so \(\lnot(P \Rightarrow Q)\) is true only in that row. And \(P \land \lnot Q\) is true only when \(P\) is true and \(Q\) is false — the same row. The columns agree, so the statements are equivalent.

By laws. Rewrite the conditional as a disjunction and apply De Morgan and double negation:

\[ \lnot(P \Rightarrow Q) \;\equiv\; \lnot(\lnot P \lor Q) \;\equiv\; \lnot\lnot P \land \lnot Q \;\equiv\; P \land \lnot Q. \]

The second method scales; the first does not. With five letters a table has \(32\) rows, and a chain of rewrites is still three lines.

De Morgan for Sets

The set identities \((A \cup B)^c = A^c \cap B^c\) and \((A \cap B)^c = A^c \cup B^c\) are De Morgan's laws in another costume: an element is in \((A \cup B)^c\) exactly when it is not (in \(A\) or in \(B\)), which by the logical law is when it is not in \(A\) and not in \(B\). The site's De Morgan's Laws for Sets page proves them by the double-inclusion method, and its element-chase is exactly this argument written out.

7. Quantifiers

Section 1 left an open sentence \(P(x)\) waiting to be turned into a statement. Substituting a value is one way; the other is to say how many values make it true.

Definition: Universal and Existential Quantifiers

Let \(P(x)\) be an open sentence and \(S\) a set.

  • The universal statement \(\forall x \in S,\; P(x)\) ("for all \(x\) in \(S\), \(P(x)\)") is true when \(P(x)\) holds for every element \(x\) of \(S\), and false when even one element fails.
  • The existential statement \(\exists x \in S,\; P(x)\) ("there exists \(x\) in \(S\) such that \(P(x)\)") is true when \(P(x)\) holds for at least one element of \(S\), and false when no element satisfies it.

\(\forall\) is read "for all," "for every," "for each"; \(\exists\) is read "there exists," "there is," "for some." The variant \(\exists!\,x\) means "there exists exactly one \(x\)."

Examples

  • \(\forall x \in \mathbb{R},\; x^2 \geq 0\). True.
  • \(\exists x \in \mathbb{R},\; x^2 = -1\). False. But \(\exists x \in \mathbb{C},\; x^2 = -1\) is true: the domain is part of the statement, and changing it can change the truth value.
  • \(\forall n \in \mathbb{N},\; \exists p,\; p \text{ is prime and } p \gt n\). This is the Infinitude of Primes in symbols. True.
  • \(\exists!\, x \in \mathbb{R},\; x^3 = 8\). True — over \(\mathbb{C}\) it would be false, since there are three cube roots.

Bound and Free Variables

In \(\forall x \in \mathbb{R},\; x^2 \geq 0\) the letter \(x\) is bound by the quantifier: the statement is not "about" any particular \(x\), and renaming it (\(\forall t \in \mathbb{R},\; t^2 \geq 0\)) changes nothing. In the open sentence \(x \lt y\), both letters are free. A sentence is a statement exactly when it has no free variables.

Nested Quantifiers: The Order Matters

Quantifiers stack, and the order in which they appear is part of the meaning. Compare, over the integers,

\[ \text{(a)}\;\; \forall x \in \mathbb{Z},\; \exists y \in \mathbb{Z},\; y = x + 1 \qquad\qquad \text{(b)}\;\; \exists y \in \mathbb{Z},\; \forall x \in \mathbb{Z},\; y = x + 1. \]

(a) says: pick any integer, and then a successor for it can be found. True — the \(y\) is allowed to depend on the \(x\) chosen before it. (b) says: there is one fixed integer \(y\) which is the successor of every integer at once. False. Read left to right, each existential choice may depend on everything quantified before it and on nothing after it.

The everyday version: "everybody has a mother" (\(\forall\)-\(\exists\), true) versus "somebody is the mother of everybody" (\(\exists\)-\(\forall\), false). Same open sentence, opposite meanings.

Where the Order Rule Earns Its Keep: the ε–δ Definition

The definition of \(\lim_{x \to a} f(x) = L\) is a three-deep nesting:

\[ \forall \varepsilon \gt 0,\; \exists \delta \gt 0,\; \forall x,\; \big(0 \lt |x - a| \lt \delta \;\Rightarrow\; |f(x) - L| \lt \varepsilon\big). \]

The rule "\(\delta\) is allowed to depend on \(\varepsilon\)" that every limit proof relies on is not an extra convention — it is the quantifier order. \(\delta\) comes after \(\varepsilon\), so it may depend on it; \(x\) comes after both, so \(\delta\) may not depend on \(x\). Swap the first two quantifiers and you get a different, far stronger property (uniform continuity is the analogous swap for continuity).

The site's limit definition page walks this statement one quantifier at a time, and the Standard Limits tutorial puts it to work.

Pitfall: the empty domain

\(\forall x \in \varnothing,\; P(x)\) is true for every \(P\) — there is nothing to fail — while \(\exists x \in \varnothing,\; P(x)\) is false for every \(P\). This is vacuous truth again, because \(\forall x \in S,\; P(x)\) is shorthand for \(\forall x,\; (x \in S \Rightarrow P(x))\).

8. Translating English into Symbols

Theorems are stated in English, and the first act of understanding one is to see its logical skeleton. A handful of patterns cover almost everything.

English Symbols Note
All \(A\) are \(B\). \(\forall x,\; (A(x) \Rightarrow B(x))\) Universal goes with \(\Rightarrow\).
Some \(A\) are \(B\). \(\exists x,\; (A(x) \land B(x))\) Existential goes with \(\land\).
No \(A\) are \(B\). \(\forall x,\; (A(x) \Rightarrow \lnot B(x))\) Equivalently \(\lnot\exists x,\; (A(x) \land B(x))\).
Some \(A\) are not \(B\). \(\exists x,\; (A(x) \land \lnot B(x))\) The negation of "all \(A\) are \(B\)."

Pitfall: \(\exists\) with \(\Rightarrow\)

"Some primes are even" is not \(\exists x,\; (\text{prime}(x) \Rightarrow \text{even}(x))\). That statement is true as soon as any \(x\) at all fails to be prime (a false hypothesis makes the conditional true), so it says almost nothing. The correct form is \(\exists x,\; (\text{prime}(x) \land \text{even}(x))\). A mismatched pair — \(\forall\) with \(\land\), or \(\exists\) with \(\Rightarrow\) — is nearly always a translation error.

Hidden Quantifiers

Mathematical English routinely leaves the universal quantifier unspoken. "If \(x\) is even, then \(x^2\) is even" has a free \(x\) and is, read literally, an open sentence; what is meant is \(\forall x \in \mathbb{Z},\; (x \text{ even} \Rightarrow x^2 \text{ even})\). The convention: a theorem stated with free variables is universally quantified over them. Recognising this is what tells you that proving the statement means proving it for an arbitrary \(x\), not for one convenient example.

Worked Examples

  1. Every integer is even or odd.
    \[ \forall n \in \mathbb{Z},\; (n \text{ is even}) \lor (n \text{ is odd}). \]
  2. There is an even prime.
    \[ \exists p,\; (p \text{ is prime}) \land (p \text{ is even}). \]
    True, and \(p = 2\) is the only witness.
  3. Between any two distinct rationals there is another rational.
    \[ \forall a, b \in \mathbb{Q},\; \big(a \lt b \;\Rightarrow\; \exists c \in \mathbb{Q},\; a \lt c \lt b\big). \]
    The existential sits inside the conditional, after the universal — so \(c\) may depend on \(a\) and \(b\), as it must (\(c = (a + b)/2\) works).
  4. The equation \(x^2 = 2\) has no rational solution.
    \[ \lnot\,\exists x \in \mathbb{Q},\; x^2 = 2, \qquad\text{equivalently}\qquad \forall x \in \mathbb{Q},\; x^2 \neq 2. \]
    This is the statement proved on the Irrationality of √2 page, and the two forms are related by the negation rules of the next section.

9. Negating Statements

To prove a statement by contradiction you assume its negation; to prove a conditional by contrapositive you negate both sides; to show a claim is false you exhibit its negation. Forming the negation of a complicated statement correctly is therefore the single most-used skill in proof writing, and it is entirely mechanical.

The Negation Rules

\[ \begin{aligned} \lnot(P \land Q) &\equiv \lnot P \lor \lnot Q & \lnot(\forall x,\; P(x)) &\equiv \exists x,\; \lnot P(x) \\ \lnot(P \lor Q) &\equiv \lnot P \land \lnot Q & \lnot(\exists x,\; P(x)) &\equiv \forall x,\; \lnot P(x) \\ \lnot(P \Rightarrow Q) &\equiv P \land \lnot Q & \lnot\lnot P &\equiv P \end{aligned} \]

Method. Push the \(\lnot\) inward one step at a time: swap \(\land\) with \(\lor\), swap \(\forall\) with \(\exists\), turn a conditional into "hypothesis and not conclusion," and stop when every \(\lnot\) sits directly on an atomic statement. Then simplify the atoms (\(\lnot(a \lt b)\) is \(a \geq b\)).

A restricted domain travels with its quantifier and is not negated: \(\lnot(\forall x \in S,\; P(x)) \equiv \exists x \in S,\; \lnot P(x)\). The reason is the shorthand from Section 7 — \(\forall x \in S,\; P(x)\) is \(\forall x,\; (x \in S \Rightarrow P(x))\), whose negation is \(\exists x,\; (x \in S \land \lnot P(x))\).

Worked Examples, in Increasing Depth

  1. All primes are odd. \(\forall p,\; (\text{prime}(p) \Rightarrow \text{odd}(p))\).
    \[ \lnot\forall p,\; (\text{prime}(p) \Rightarrow \text{odd}(p)) \;\equiv\; \exists p,\; \lnot(\text{prime}(p) \Rightarrow \text{odd}(p)) \;\equiv\; \exists p,\; (\text{prime}(p) \land \lnot\text{odd}(p)). \]
    "Some prime is not odd" — true, so the original is false. The negation of a universal is an existential, and disproving "all" needs exactly one counterexample.
  2. There is an integer larger than every integer. \(\exists y \in \mathbb{Z},\; \forall x \in \mathbb{Z},\; y \gt x\).
    \[ \lnot\exists y,\; \forall x,\; (y \gt x) \;\equiv\; \forall y,\; \lnot\forall x,\; (y \gt x) \;\equiv\; \forall y,\; \exists x,\; \lnot(y \gt x) \;\equiv\; \forall y,\; \exists x,\; (x \geq y). \]
    "For every integer there is one at least as large" — true (take \(x = y\)), so the original is false. Each quantifier flipped in turn, and the domains stayed put.
  3. The limit definition. Negate \(\lim_{x \to a} f(x) = L\):
    \[ \begin{aligned} &\lnot\Big(\forall \varepsilon \gt 0,\; \exists \delta \gt 0,\; \forall x,\; \big(0 \lt |x - a| \lt \delta \Rightarrow |f(x) - L| \lt \varepsilon\big)\Big) \\ \equiv\;& \exists \varepsilon \gt 0,\; \forall \delta \gt 0,\; \exists x,\; \lnot\big(0 \lt |x - a| \lt \delta \Rightarrow |f(x) - L| \lt \varepsilon\big) \\ \equiv\;& \exists \varepsilon \gt 0,\; \forall \delta \gt 0,\; \exists x,\; \big(0 \lt |x - a| \lt \delta \;\land\; |f(x) - L| \geq \varepsilon\big). \end{aligned} \]
    Read it back: "there is a tolerance \(\varepsilon\) that no \(\delta\) can meet — for every \(\delta\) some \(x\) within \(\delta\) of \(a\) still lands \(\varepsilon\) or more away from \(L\)." That sentence is the recipe for proving a limit fails: name an \(\varepsilon\), and for an arbitrary \(\delta\) produce the bad \(x\). The Uniqueness of Limits proof runs a contradiction argument on exactly this machinery.

Pitfall: negating a conditional

The negation of "if \(P\) then \(Q\)" is not "if \(P\) then not \(Q\)," and it is not "if not \(P\) then not \(Q\)." It is "\(P\), and not \(Q\)": the one row where the promise is broken. A conditional is refuted by a single instance with true hypothesis and false conclusion — never by another conditional.

10. Logical Inference

Truth tables tell us when a compound statement is true. A proof does something different: from statements already known to be true it derives new ones. The steps that are always legitimate are the rules of inference, and each is backed by a tautology.

Rule From Conclude Backing tautology
Modus ponens \(P \Rightarrow Q\) and \(P\) \(Q\) \(((P \Rightarrow Q) \land P) \Rightarrow Q\)
Modus tollens \(P \Rightarrow Q\) and \(\lnot Q\) \(\lnot P\) \(((P \Rightarrow Q) \land \lnot Q) \Rightarrow \lnot P\)
Hypothetical syllogism \(P \Rightarrow Q\) and \(Q \Rightarrow R\) \(P \Rightarrow R\) Transitivity of \(\Rightarrow\)
Disjunctive syllogism \(P \lor Q\) and \(\lnot P\) \(Q\) \(((P \lor Q) \land \lnot P) \Rightarrow Q\)
Universal instantiation \(\forall x,\; P(x)\) \(P(c)\) for any particular \(c\) Definition of \(\forall\)
Existential generalisation \(P(c)\) for some particular \(c\) \(\exists x,\; P(x)\) Definition of \(\exists\)

Modus tollens is the contrapositive in action: from \(P \Rightarrow Q\) and \(\lnot Q\), the contrapositive \(\lnot Q \Rightarrow \lnot P\) plus modus ponens gives \(\lnot P\). The two "syllogism" rules are what let a long proof be read as a chain — each line follows from earlier lines by one rule, and the chain ends at the theorem.

Worked Example: a proof as a chain of inferences

Known: (1) every integer divisible by \(4\) is even; (2) every even integer has an even square; (3) \(n = 12\) is divisible by \(4\). Conclude that \(n^2\) is even.

  1. From (1), by universal instantiation at \(n\): \(4 \mid n \Rightarrow n \text{ even}\).
  2. From that and (3), by modus ponens: \(n\) is even.
  3. From (2), by universal instantiation at \(n\): \(n \text{ even} \Rightarrow n^2 \text{ even}\).
  4. From steps 2 and 3, by modus ponens: \(n^2\) is even. ∎

Written out, a real proof compresses all four lines into "since \(4 \mid 12\), \(12\) is even, so \(144\) is even." The rules are what make the compression legitimate.

Two Invalid Patterns: Affirming the Consequent and Denying the Antecedent

Modus ponens and modus tollens each have a near-twin that is not valid, and the resemblance is close enough to slip past an inattentive reader.

  • Affirming the consequent: from \(P \Rightarrow Q\) and \(Q\), concluding \(P\). Invalid — it uses the converse \(Q \Rightarrow P\), which is not equivalent to the original.
  • Denying the antecedent: from \(P \Rightarrow Q\) and \(\lnot P\), concluding \(\lnot Q\). Invalid — it uses the inverse \(\lnot P \Rightarrow \lnot Q\), which is likewise not equivalent.

A concrete counterexample settles both. Take \(P\): "\(n = 4\)" and \(Q\): "\(n\) is even", so \(P \Rightarrow Q\) is true. With \(n = 6\), \(Q\) holds but \(P\) fails, which kills the first pattern; \(\lnot P\) holds but \(\lnot Q\) fails, which kills the second.

Both errors are the same error: treating a conditional as though it ran in both directions. Only \(P \Leftrightarrow Q\) licenses that, which is Section 4.

Looking Ahead: the Three Proof Shapes

Every technique in the next page of this series is a strategy for establishing a conditional \(P \Rightarrow Q\), and each is one of this page's equivalences in action:

  • Direct proof: assume \(P\), derive \(Q\) by a chain of inferences.
  • Contrapositive: assume \(\lnot Q\), derive \(\lnot P\) — legitimate because \((P \Rightarrow Q) \equiv (\lnot Q \Rightarrow \lnot P)\).
  • Contradiction: assume \(P \land \lnot Q\) (the negation of \(P \Rightarrow Q\)) and derive a contradiction, so the negation is false and the conditional is true. The Irrationality of √2 and Infinitude of Primes pages are the classic instances.

11. Summary and Where to Go Next

Idea The one thing to remember
Statement Definitely true or definitely false; open sentences are neither until quantified.
\(\lor\) Inclusive: true when both parts are.
\(P \Rightarrow Q\) False only when \(P\) is true and \(Q\) false; a false hypothesis makes it true.
\(P \Leftrightarrow Q\) Two conditionals; an "iff" proof has two parts.
Equivalence Identical truth-table columns. Contrapositive yes, converse no.
Quantifiers \(\forall\) pairs with \(\Rightarrow\), \(\exists\) with \(\land\); order matters; later choices may depend on earlier ones.
Negation Push \(\lnot\) inward: swap \(\land\)/\(\lor\), swap \(\forall\)/\(\exists\), \(\lnot(P \Rightarrow Q) \equiv P \land \lnot Q\).
Inference A proof is a chain of modus ponens; the three proof shapes are equivalences in action.

Review Material for This Page

Where This Page Appears in the Proofs

Text used for this page: Hammack, Book of Proof, Chapter 2 (free online). The next page in this series covers the proof techniques themselves — direct, contrapositive, contradiction, and induction.

12. Symbol Reference

An addendum: every symbol used on this page, gathered for lookup. The final column gives the alternative forms you will meet in other books and, where it applies, what you can type into the equivalence explorer, which accepts plain ASCII as well as the proper symbols.

Connectives

Symbol Read as Meaning Also written / typed
\(\lnot P\) not \(P\) Negation: true exactly when \(P\) is false. \(\sim P\), \(\overline{P}\); type ~P, !P or not P
\(P \land Q\) \(P\) and \(Q\) Conjunction: true exactly when both are true. \(P \cdot Q\), \(PQ\); type &, &&, ^ or and
\(P \lor Q\) \(P\) or \(Q\) Disjunction: true when at least one is true. Always inclusive. \(P + Q\); type |, || or or
\(P \Rightarrow Q\) if \(P\), then \(Q\); \(P\) implies \(Q\) Conditional: false only when \(P\) is true and \(Q\) is false. \(P \to Q\), \(P \supset Q\); type ->, => or implies
\(P \Leftrightarrow Q\) \(P\) if and only if \(Q\) Biconditional: true exactly when both have the same truth value. \(P \leftrightarrow Q\), "\(P\) iff \(Q\)"; type <->, <=> or iff
\(P \oplus Q\) \(P\) exclusive-or \(Q\) True when exactly one of the two is true. \((P \lor Q) \land \lnot(P \land Q)\), equivalently \(\lnot(P \Leftrightarrow Q)\)

Quantifiers

Symbol Read as Meaning Notes
\(\forall\) for all; for every; for each Universal quantifier: the statement holds for every element of the domain. Pairs with \(\Rightarrow\): "all \(A\) are \(B\)" is \(\forall x,\; (A(x) \Rightarrow B(x))\)
\(\exists\) there exists; there is; for some Existential quantifier: the statement holds for at least one element. Pairs with \(\land\): "some \(A\) are \(B\)" is \(\exists x,\; (A(x) \land B(x))\)
\(\exists!\) there exists exactly one Uniqueness quantifier. Shorthand for existence together with uniqueness
\(\nexists\) there does not exist Negated existential. Same as \(\lnot\exists\), and equal to \(\forall x,\; \lnot P(x)\)

Truth Values and Relations Between Statements

Symbol Read as Meaning Notes
\(T\), \(\top\) true The truth value true; \(\top\) also denotes a tautology. Type T or true in the explorer
\(F\), \(\bot\) false The truth value false; \(\bot\) also denotes a contradiction. Type F or false in the explorer
\(\equiv\) is logically equivalent to The two statements have the same truth value in every row. A relation between statements, not a connective inside one
\(\vdash\) proves; derives Syntactic entailment: there is a derivation of the right side from the left. Rarely needed at this level; included for completeness
\(\models\) models; satisfies Semantic entailment: every case making the left true makes the right true. The semantic counterpart of \(\vdash\)

Marks Used in Reasoning

Symbol Read as Meaning
\(\therefore\) therefore Marks the conclusion of an argument.
\(\because\) because Marks the reason for a claim.
\(\blacksquare\), \(\square\) end of proof Closes a proof; the written-out form is "QED". Proof pages on this site use \(\blacksquare\).

Sets and Numbers Used on This Page

Symbol Read as Meaning
\(\in\) is an element of Membership: \(x \in S\) says \(x\) belongs to the set \(S\).
\(\notin\) is not an element of Negated membership; the same as \(\lnot(x \in S)\).
\(\varnothing\) the empty set The set with no elements. Also written \(\emptyset\) or \(\{\}\).
\(\mid\) divides \(a \mid b\) says \(b\) is a whole multiple of \(a\) — as in \(4 \mid 12\).
\(\mathbb{N}\) the natural numbers On this site, \(1, 2, 3, \ldots\)
\(\mathbb{Z}\) the integers \(\ldots, -2, -1, 0, 1, 2, \ldots\)
\(\mathbb{Q}\) the rational numbers Ratios of integers with non-zero denominator.
\(\mathbb{R}\) the real numbers The full number line.
\(\mathbb{C}\) the complex numbers Numbers \(a + bi\) with \(a, b\) real.
\(\neq\), \(\leq\), \(\geq\) is not equal to; at most; at least Order relations. Note \(\lnot(a \lt b)\) is \(a \geq b\), not \(a \gt b\).

For the wider set-theoretic vocabulary — unions, intersections, subsets, power sets, cardinality — see the Set Theory and Logic Symbols reference, which covers this table's logic half alongside the set notation this page does not need.