Counterexamples and If and Only If

Demolish false claims with a single counterexample. Four plausible claims go on trial, one by one.

A 'for all' claim falls to one counterexample. A single failing case makes the whole claim false. An if-and-only-if claim is the opposite job. Each direction needs its own separate proof.

For example, take 'every πŸ§‘ classmate wears glasses'. One classmate without glasses ends the claim. One person is enough.

Β¬(βˆ€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

Counterexample

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∈Z (4∣n2β‡’4∣n)\forall n \in \mathbb{Z}\,(4 \mid n^2 \Rightarrow 4 \mid n) and its negation βˆƒn∈Z (4∣n2Β andΒ 4∀n)\exists n \in \mathbb{Z}\,(4 \mid n^2 \text{ and } 4 \nmid n) explicitly, and explain why a single witness settles the matter.

βˆ€n∈Z (4∣n2β‡’4∣n),Β¬(βˆ€n∈Z P(n))=βˆƒn∈Z ¬P(n)\forall n \in \mathbb{Z}\,(4 \mid n^2 \Rightarrow 4 \mid n),\qquad \lnot\Big(\forall n \in \mathbb{Z}\,P(n)\Big) = \exists n \in \mathbb{Z}\,\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
Verdict

The claim is false β€” n=2n = 2 is a counterexample (4∣224 \mid 2^2 but 4∀24 \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

Counterexample and verification

  1. The claim is a universal statement: βˆ€n∈Z (4∣n2β‡’4∣n)\forall n \in \mathbb{Z}\,(4 \mid n^2 \Rightarrow 4 \mid n) β€” the domain is n∈Zn \in \mathbb{Z}.

    By the basic rules of logic its negation is the existential statement βˆƒn∈Z ¬(4∣n2β‡’4∣n)\exists n \in \mathbb{Z}\,\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∈Z (4∣n2∧4∀n)\exists n \in \mathbb{Z}\,(4 \mid n^2 \wedge 4 \nmid n).

    So it suffices to exhibit one n∈Zn \in \mathbb{Z} 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Β (i.e.Β 4∀2Β true)β‡’Β counterexamplen = 2:\quad 4 \mid n^2 = 4\ \text{true},\qquad 4 \mid 2\ \text{false (i.e. } 4 \nmid 2\ \text{true)} \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 β€” first prove ∣x∣=∣yβˆ£β€…β€ŠβŸΊβ€…β€Šx2=y2|x| = |y| \iff x^2 = y^2 itself, in both directions.

    (β‡’)(\Rightarrow) If ∣x∣=∣y∣|x| = |y|, squaring gives x2=∣x∣2=∣y∣2=y2x^2 = |x|^2 = |y|^2 = y^2 (using ∣t∣2=t2|t|^2 = t^2).

    (⇐)(\Leftarrow) If x2=y2x^2 = y^2 then ∣x∣2=∣y∣2|x|^2 = |y|^2; since ∣x∣,∣y∣β‰₯0|x|, |y| \ge 0 and squaring is injective (strictly increasing) on [0,∞)[0, \infty), it follows that ∣x∣=∣y∣|x| = |y|.

    Hence ∣x∣=∣y∣|x| = |y| is equivalent to x2=y2x^2 = y^2, so 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