Counterexamples and If and Only If

Watch a single counterexample demolish a universal claim, tested on four false claims — every prime is odd, 4∣n2⇒4∣n4 \mid n^2 \Rightarrow 4 \mid n, sums of irrationals are irrational, ∣x∣=∣y∣⇒x=y|x| = |y| \Rightarrow x = y. Slide nn and flip the hypothesis and conclusion lights until ¬(∀x P(x))=∃x ¬P(x)\lnot(\forall x\, P(x)) = \exists x\, \lnot P(x) feels mechanical. The mirror skill — proving each arrow of P  ⟺  QP \iff Q separately — is carried out in the problems.

¬(∀x P(x))=∃x ¬P(x)\lnot(\forall x\, P(x)) = \exists x\, \lnot P(x)
4∣n2⇒4∣n4 \mid n^2 \Rightarrow 4 \mid n
∣x∣=∣y∣⇒x=y|x| = |y| \Rightarrow x = y

Examples & Exercises

Disprove the claim "if n2n^2 is divisible by 4 then nn is divisible by 4" using the counterexample n=2n = 2. Write out the claim's logical form ∀n (4∣n2⇒4∣n)\forall n\,(4 \mid n^2 \Rightarrow 4 \mid n) and its negation ∃n (4∣n2 and 4∤n)\exists n\,(4 \mid n^2 \text{ and } 4 \nmid n) explicitly, and explain why a single witness settles the matter.

∀n (4∣n2⇒4∣n),¬(∀n P(n))=∃n ¬P(n)\forall n\,(4 \mid n^2 \Rightarrow 4 \mid n),\qquad \lnot\Big(\forall n\,P(n)\Big) = \exists n\,\lnot P(n)
n=2:n2=4,  4∣4,  but 4∤2n = 2:\quad n^2 = 4,\; 4 \mid 4,\; \text{but } 4 \nmid 2
claim 4∣n2⇒4∣n4 \mid n^2 \Rightarrow 4 \mid n, test n=2n = 2: n2=4n^2 = 4 makes the hypothesis true, the conclusion 4∣24 \mid 2 is false — counterexample confirmed.
Show proof
  1. The claim is a universal statement: ∀n (4∣n2⇒4∣n)\forall n\,(4 \mid n^2 \Rightarrow 4 \mid n). By the basic rules of logic its negation is the existential statement ∃n ¬(4∣n2⇒4∣n)\exists n\,\lnot(4 \mid n^2 \Rightarrow 4 \mid n), which by ¬(P⇒Q)=P∧¬Q\lnot(P \Rightarrow Q) = P \wedge \lnot Q equals ∃n (4∣n2∧4∤n)\exists n\,(4 \mid n^2 \wedge 4 \nmid n). So it suffices to exhibit one nn for which the hypothesis is true and the conclusion false — and conversely, one such nn is all it takes.
  2. Take n=2n = 2. Then n2=4n^2 = 4 and 4∣44 \mid 4, so the hypothesis is true. But n=2n = 2 is not divisible by 4, so the conclusion 4∣n4 \mid n is false. Hence n=2n = 2 is a witness to ∃n (4∣n2∧4∤n)\exists n\,(4 \mid n^2 \wedge 4 \nmid n), and the original universal claim is false.
    n=2:4∣n2=4 true,4∤2 false ⇒ counterexamplen = 2:\quad 4 \mid n^2 = 4\ \text{true},\qquad 4 \nmid 2\ \text{false}\ \Rightarrow\ \text{counterexample}
  3. Remark: checking a hundred values of nn where the hypothesis trails the conclusion — e.g. n=4,8,12n = 4, 8, 12 all work — never proves a universal claim. One counterexample outweighs infinitely many supporting cases. (The "fixed version" of this claim — nn is even   ⟺  \iff n2n^2 is even — is proved in both directions in problem 2 below.)

Prove completely, in both directions, that nn is even if and only if n2n^2 is even. Use a direct proof for the ⇒\Rightarrow direction (n=2kn = 2k gives n2=2(2k2)n^2 = 2(2k^2)) and the contrapositive for the ⇐\Leftarrow direction (odd n=2k+1n = 2k+1 gives odd n2=2(2k2+2k)+1n^2 = 2(2k^2+2k)+1), and state explicitly why the two directions are different proofs.

n even  ⟺  n2 evenn\ \text{even} \iff n^2\ \text{even}
⇒: n=2k  ⇒  n2=2(2k2),⇐: ¬(n even)⇒¬(n2 even)\Rightarrow:\ n = 2k \;\Rightarrow\; n^2 = 2(2k^2),\qquad \Leftarrow:\ \lnot(n\ \text{even}) \Rightarrow \lnot(n^2\ \text{even})
The scene has no preset directly testing this biconditional (only the counterexample claims), so this preset marks the smallest-counterexample position n=2n = 2 — this problem is proof practice.
Show proof
  1. (⇒\Rightarrow) Suppose nn is even. Then n=2kn = 2k for some integer kk. Squaring gives n2=4k2=2(2k2)n^2 = 4k^2 = 2(2k^2), and since 2k22k^2 is an integer, n2n^2 is even. This is a direct proof — it starts from the assumption, unfolds the definition, and reaches the conclusion.
  2. (⇐\Leftarrow) The reverse direction resists a direct proof: from the assumption "n2n^2 is even" there is no way to extract nn. Prove the contrapositive instead: if nn is odd then n2n^2 is odd. Write n=2k+1n = 2k+1; then n2=4k2+4k+1=2(2k2+2k)+1n^2 = 4k^2 + 4k + 1 = 2(2k^2 + 2k) + 1, and since 2k2+2k2k^2 + 2k is an integer, n2n^2 is odd. The contrapositive holds, so the original implication "n2n^2 even ⇒\Rightarrow nn even" holds.
    (2k+1)2=4k2+4k+1=2(2k2+2k)+1 odd(2k+1)^2 = 4k^2 + 4k + 1 = 2(2k^2 + 2k) + 1\ \text{odd}
  3. The two directions are genuinely different proofs: ⇒\Rightarrow unfolds the definition of even, n=2kn = 2k, directly, while ⇐\Leftarrow goes around it via the contrapositive. Proving only one direction establishes an implication, not an equivalence. To claim "P  ⟺  QP \iff Q" both arrows are needed, and they usually require different arguments like this.

Prove that for real x,yx, y, x2=y2x^2 = y^2 holds if and only if x=yx = y or x=−yx = -y. For the ⇒\Rightarrow direction use the factorization x2−y2=(x−y)(x+y)=0x^2 - y^2 = (x-y)(x+y) = 0 together with the zero-product property; for the ⇐\Leftarrow direction substitute directly in each case.

x2=y2  ⟺  (x=y or x=−y)x^2 = y^2 \iff (x = y\ \text{or}\ x = -y)
⇒: x2−y2=(x−y)(x+y)=0,⇐: (−y)2=y2\Rightarrow:\ x^2 - y^2 = (x-y)(x+y) = 0,\qquad \Leftarrow:\ (-y)^2 = y^2
claim ∣x∣=∣y∣⇒x=y|x| = |y| \Rightarrow x = y, test pair (3,−3)(3, -3): ∣3∣=∣−3∣=3|3| = |-3| = 3 but 3≠−33 \ne -3 — a counterexample to the one-directional version this problem repairs both ways.
Show proof
  1. (⇒\Rightarrow) Suppose x2=y2x^2 = y^2. Subtracting y2y^2 from both sides gives x2−y2=0x^2 - y^2 = 0, and factoring yields (x−y)(x+y)=0(x-y)(x+y) = 0. For real numbers, a product of two numbers is 0 only if one of them is 0 (divide by whichever factor is nonzero), so x−y=0x - y = 0 or x+y=0x + y = 0 — i.e. x=yx = y or x=−yx = -y.
  2. (⇐\Leftarrow) The reverse direction is checked directly in each case. If x=yx = y then x2=y2x^2 = y^2 is immediate, and if x=−yx = -y then x2=(−y)2=y2x^2 = (-y)^2 = y^2. In both cases x2=y2x^2 = y^2 holds.
  3. Remark: this biconditional explains the scene's counterexample — since ∣x∣=∣y∣|x| = |y| is equivalent to x2=y2x^2 = y^2, what is actually forced is not "x=yx = y" but "x=yx = y or x=−yx = -y". The scene's pairs (n,−n)(n, -n) are witnesses to the second alternative. This is the classic pattern: a counterexample shows how the claim must be repaired.

1. Foundations of Proof