UniMaths
Free chapterTry everything here: cards, proofs and practice. Sign up free to save your progress and unlock all 7 chapters.Sign up free
PROOF · 1

Logic and statements

13 concepts · 67 questions

Statements, the connectives and their truth tables, implication and its converse and contrapositive, logical equivalence, De Morgan's laws, quantifiers and how to negate them.

Definition 1.1Statements

A statement (or proposition) is a sentence that is either true or false, but not both. "77 is prime" and "2+2=52 + 2 = 5" are statements (true and false). "Is xx prime?" and "x>3x > 3" are not: the first is a question, and the truth of the second depends on xx. A sentence like "x>3x > 3" whose truth depends on a variable is a predicate P(x)P(x); it becomes a statement once xx is fixed or quantified.

Statement: definitely true or definitely false, even if nobody knows which.

Not statements: questions, commands, and sentences with a free variable like "nn is even".

Predicate: P(n)P(n) = "nn is even" becomes a statement once you plug in n=4n = 4 or say "for all nn".

Definition 1.2Negation, conjunction and disjunction

For statements P,QP, Q:

  • ¬P\neg P ("not PP") is true exactly when PP is false.
  • P∧QP\wedge Q ("PP and QQ") is true exactly when both are true.
  • P∨QP\vee Q ("PP or QQ") is true when at least one is true. Mathematical "or" is inclusive: P∨QP\vee Q is true when both are.

Truth tables list the value for each of the four combinations of P,QP, Q.

And: both. Or: at least one (both allowed). Not: flips the truth value.

Truth table: with nn basic statements there are 2n2^n rows.

Everyday trap: "soup or salad" usually means one, but in maths "x>0x > 0 or x<5x < 5" is true for x=1x = 1.

Definition 1.3Implication

P⇒QP\Rightarrow Q ("if PP then QQ", "PP implies QQ") is false only when PP is true and QQ is false; in the other three cases it is true. PP is the hypothesis and QQ the conclusion. Other readings: "QQ if PP", "PP only if QQ", "PP is sufficient for QQ", "QQ is necessary for PP". In particular an implication with a false hypothesis is (vacuously) true.

P⇒QP\Rightarrow Q fails only one way: PP true, QQ false.

Vacuous truth: "if 1=21 = 2 then I am the Pope" is true.

"Only if" points forwards: "PP only if QQ" means P⇒QP\Rightarrow Q.

To prove P⇒QP\Rightarrow Q: assume PP, deduce QQ. You never need to check the case PP false.

Definition 1.4Converse, contrapositive and biconditional

For the implication P⇒QP\Rightarrow Q:

  • its converse is Q⇒PQ\Rightarrow P;
  • its contrapositive is ¬Q⇒¬P\neg Q\Rightarrow\neg P;
  • the biconditional P⇔QP\Leftrightarrow Q ("PP if and only if QQ", "iff") means (P⇒Q)∧(Q⇒P)(P\Rightarrow Q)\wedge(Q\Rightarrow P), and is true exactly when PP and QQ have the same truth value.

Converse swaps: Q⇒PQ\Rightarrow P. Can be false when the original is true.

Contrapositive swaps and negates: ¬Q⇒¬P\neg Q\Rightarrow\neg P. Always has the same truth value (see Prop. 1.5, next).

Iff = both directions. To prove P⇔QP\Leftrightarrow Q, prove P⇒QP\Rightarrow Q and its converse.

Proposition 1.5An implication is equivalent to its contrapositive

For all statements P,QP, Q, the implication P⇒QP\Rightarrow Q and its contrapositive ¬Q⇒¬P\neg Q\Rightarrow\neg P have the same truth value. Consequence: to prove P⇒QP\Rightarrow Q it is enough to prove ¬Q⇒¬P\neg Q\Rightarrow\neg P (proof by contrapositive, §2).

Contrapositive = same statement. "If it rains, the ground is wet" ≡ "if the ground is dry, it didn't rain".

Proof: both fail in exactly one row: PP true, QQ false.

Use it when the negation of the conclusion is easier to work with than the hypothesis.

Proof

Definition 1.6Tautologies and logical equivalence

A formula built from statement letters is a tautology if it is true for every assignment of truth values, and a contradiction if it is false for every assignment. Formulas AA and BB are logically equivalent, written A≡BA\equiv B, if they have the same truth value under every assignment; equivalently, A⇔BA\Leftrightarrow B is a tautology. Examples: P∨¬PP\vee\neg P is a tautology (excluded middle); P∧¬PP\wedge\neg P is a contradiction; ¬¬P≡P\neg\neg P\equiv P; P⇒Q≡¬P∨QP\Rightarrow Q\equiv\neg P\vee Q.

Tautology: true in every row (e.g. P∨¬PP\vee\neg P). Contradiction: false in every row.

Equivalent: identical truth-table columns. Prove it by a table or by chaining known equivalences.

Handy: P⇒Q≡¬P∨QP\Rightarrow Q\equiv\neg P\vee Q, and ¬¬P≡P\neg\neg P\equiv P.

Theorem 1.7De Morgan's laws (logic)

For all statements P,QP, Q:

¬(P∧Q)≡¬P∨¬Q,¬(P∨Q)≡¬P∧¬Q.\neg(P\wedge Q)\equiv\neg P\vee\neg Q,\qquad \neg(P\vee Q)\equiv\neg P\wedge\neg Q.

Consequence: negating "and" gives "or" and vice versa, e.g. ¬(0<x<1)≡x≤0∨x≥1\neg(0 < x < 1)\equiv x\le0\vee x\ge1.

Not (both) = at least one fails: ¬(P∧Q)≡¬P∨¬Q\neg(P\wedge Q)\equiv\neg P\vee\neg Q.

Not (either) = both fail: ¬(P∨Q)≡¬P∧¬Q\neg(P\vee Q)\equiv\neg P\wedge\neg Q.

Example: "not (x≥0x\ge0 and y≥0y\ge0)" means x<0x < 0 or y<0y < 0.

Proof

Proposition 1.8Distributive laws (logic)

For all statements P,Q,RP, Q, R:

P∧(Q∨R)≡(P∧Q)∨(P∧R),P∨(Q∧R)≡(P∨Q)∧(P∨R).P\wedge(Q\vee R)\equiv(P\wedge Q)\vee(P\wedge R),\qquad P\vee(Q\wedge R)\equiv(P\vee Q)\wedge(P\vee R).

∧\wedge and ∨\vee are also commutative and associative, so brackets in P∧Q∧RP\wedge Q\wedge R or P∨Q∨RP\vee Q\vee R don't matter.

Like algebra, a(b+c)=ab+aca(b + c) = ab + ac, but both ways round: ∧\wedge distributes over ∨\vee and ∨\vee over ∧\wedge.

Proof trick: split on whether PP is true or false.

Proof

Proposition 1.9The negation of an implication

For all statements P,QP, Q: ¬(P⇒Q)≡P∧¬Q\neg(P\Rightarrow Q)\equiv P\wedge\neg Q. Consequence: an implication is disproved by exhibiting a case where the hypothesis holds and the conclusion fails; the negation of an implication is not another implication.

Not (if PP then QQ) = PP and not QQ.

Common mistake: the negation is not "if PP then not QQ".

Example: "it is false that if nn is odd then nn is prime" means "nn is odd and nn is not prime" (e.g. n=9n = 9).

Proof

Definition 1.10Quantifiers

For a predicate P(x)P(x) about elements xx of a set SS:

  • ∀x∈S, P(x)\forall x\in S,\ P(x) ("for all xx in SS, P(x)P(x)") is true when P(x)P(x) holds for every x∈Sx\in S;
  • ∃x∈S, P(x)\exists x\in S,\ P(x) ("there exists xx in SS with P(x)P(x)") is true when P(x)P(x) holds for at least one x∈Sx\in S;
  • ∃! x∈S, P(x)\exists!\,x\in S,\ P(x) means there is exactly one such xx. Statements can nest quantifiers, e.g. ∀x∈R ∃y∈R, y>x\forall x\in\mathbb{R}\ \exists y\in\mathbb{R},\ y > x.

∀\forall: every element works. One failure (a counterexample) kills it.

∃\exists: at least one works. One example proves it.

Empty set: ∀x∈∅,P(x)\forall x\in\emptyset, P(x) is (vacuously) true; ∃x∈∅,P(x)\exists x\in\emptyset, P(x) is false.

Proposition 1.11Negating quantifiers

¬(∀x∈S, P(x))≡∃x∈S, ¬P(x),¬(∃x∈S, P(x))≡∀x∈S, ¬P(x).\neg\big(\forall x\in S,\ P(x)\big)\equiv\exists x\in S,\ \neg P(x),\qquad \neg\big(\exists x\in S,\ P(x)\big)\equiv\forall x\in S,\ \neg P(x).

Consequence: to negate a statement with several quantifiers, move ¬\neg inwards one quantifier at a time, swapping ∀↔∃\forall\leftrightarrow\exists, and finally negate the predicate. For example, the negation of "∀ε>0 ∃N ∀n≥N, ∣an∣<ε\forall\varepsilon > 0\ \exists N\ \forall n\ge N,\ |a_n| < \varepsilon" is "∃ε>0 ∀N ∃n≥N, ∣an∣≥ε\exists\varepsilon > 0\ \forall N\ \exists n\ge N,\ |a_n|\ge\varepsilon".

Negation flips quantifiers: ¬∀=∃¬\neg\forall = \exists\neg and ¬∃=∀¬\neg\exists = \forall\neg.

Recipe: swap every ∀\forall/∃\exists, keep the order, negate the final condition.

Restricted quantifiers keep their range: ¬(∀ε>0 … )\neg(\forall\varepsilon > 0\ \dots) is ∃ε>0 …\exists\varepsilon > 0\ \dots, not ∃ε≤0\exists\varepsilon\le0.

Proof

Remark 1.12The order of quantifiers matters

Quantifiers of the same type commute (∀x∀y≡∀y∀x\forall x\forall y\equiv\forall y\forall x, likewise ∃\exists), but ∀\forall and ∃\exists do not. ∀x∈R ∃y∈R, y>x\forall x\in\mathbb{R}\ \exists y\in\mathbb{R},\ y > x is true (yy may depend on xx, e.g. y=x+1y = x + 1), whereas ∃y∈R ∀x∈R, y>x\exists y\in\mathbb{R}\ \forall x\in\mathbb{R},\ y > x is false (no real exceeds every real). In general ∃y ∀x, P(x,y)⇒∀x ∃y, P(x,y)\exists y\ \forall x,\ P(x, y)\Rightarrow\forall x\ \exists y,\ P(x, y), but not conversely.

∀x ∃y\forall x\ \exists y: yy may depend on xx. ∃y ∀x\exists y\ \forall x: one yy for all xx at once, which is much stronger.

Example: everyone has a mother (∀∃\forall\exists) vs one person is everyone's mother (∃∀\exists\forall).

Analysis: continuity vs uniform continuity is exactly a swap of "∀x\forall x" and "∃δ\exists\delta".

RemarkCheck: writing a negation

A reliable routine for negating a mathematical statement:

  1. Write it fully in symbols, with every quantifier explicit (hidden quantifiers: "a multiple of 33" means "∃k∈Z\exists k\in\mathbb{Z}, n=3kn = 3k").
  2. Swap each ∀↔∃\forall\leftrightarrow\exists, keeping the order and the ranges.
  3. Negate the innermost condition: << becomes ≥\ge; ∧↔∨\wedge\leftrightarrow\vee; P⇒QP\Rightarrow Q becomes P∧¬QP\wedge\neg Q.
  4. Sanity check: exactly one of the statement and your negation should be true in any example you try.

1. Make every quantifier visible. 2. Swap ∀↔∃\forall\leftrightarrow\exists. 3. Negate the inside (<→≥<\to\ge, and→\toor, ⇒→\Rightarrow\to "and not").

Traps: negating the range (ε>0\varepsilon > 0 stays), writing "if… then not…", and << becoming >> instead of ≥\ge.