Mathwords logoMathwords

Case Analysis — Definition & Example

Case analysis is a proof method where you split a problem into a few situations that together cover every possibility, then prove the statement separately in each situation. It is also called proof by cases.

To prove a statement RR, choose statements P1,P2,…,PnP_1, P_2, \ldots, P_n whose disjunction P1∨P2∨⋯∨PnP_1 \lor P_2 \lor \cdots \lor P_n is known to be true. Then prove each conditional Pi→RP_i \to R. The inference is valid because RR follows from whichever PiP_i actually holds.

Key Formula

[(P∨Q)∧(P→R)∧(Q→R)]  →  R\big[(P \lor Q) \land (P \to R) \land (Q \to R)\big] \;\to\; R
Where:
  • P,QP, Q = The cases. At least one of them must be true, so together they cover every possibility.
  • RR = The statement you want to prove, the same in every case.
  • ∨\lor = Logical 'or' (disjunction).
  • ∧\land = Logical 'and' (conjunction).
  • →\to = Logical 'implies' (conditional).

Worked Example

Problem: Prove that for every integer nn, the number n2n^2 leaves a remainder of 0 or 1 when divided by 3.
Step 1: Every integer has a remainder of 0, 1, or 2 when divided by 3. So n=3kn = 3k, n=3k+1n = 3k+1, or n=3k+2n = 3k+2 for some integer kk. These three cases are exhaustive. Case 1: n=3kn = 3k.
n2=9k2=3(3k2)+0n^2 = 9k^2 = 3(3k^2) + 0
Step 2: Case 2: n=3k+1n = 3k+1. Expand and group a multiple of 3.
n2=9k2+6k+1=3(3k2+2k)+1n^2 = 9k^2 + 6k + 1 = 3(3k^2 + 2k) + 1
Step 3: Case 3: n=3k+2n = 3k+2. Here the constant term is 4, so you move a 3 into the multiple of 3. The remainder that is left is 1.
n2=9k2+12k+4=3(3k2+4k+1)+1n^2 = 9k^2 + 12k + 4 = 3(3k^2 + 4k + 1) + 1
Answer: In every possible case, n2n^2 leaves a remainder of 0 or 1 when divided by 3. Since the cases cover all integers, the statement holds for every integer nn. As a consequence, no perfect square has the form 3m+23m + 2.

Why It Matters

Case analysis is the standard way to prove facts about absolute value, parity, and remainders in a discrete math or intro-to-proofs course. For example, you prove ∣x+y∣≤∣x∣+∣y∣|x+y| \le |x| + |y| by splitting on the signs of xx and yy. In computer science, the same idea shows up when you verify that an algorithm handles every branch of an if-else statement.

Common Mistakes

Mistake: Choosing cases that do not cover everything, such as splitting a real number into x>0x > 0 and x<0x < 0 and forgetting x=0x = 0.
Correction: Before you prove anything, state why your cases are exhaustive. Use a fact such as 'every real number is positive, negative, or zero,' or the division algorithm for remainders. The cases may overlap, but they cannot leave a gap. If one value is missed, the proof is incomplete.

Related Terms

  • Disjunction — The 'or' statement that guarantees the cases are exhaustive
  • Conditional — Each case is proved as one if-then statement
  • Conclusion — The single statement every case must reach
  • Counterexample — One failing case is enough to disprove a claim
  • Contrapositive — An alternative proof strategy often used inside a case
  • Conjunction — Joins the case proofs that must all hold together
  • Proof — General concept that case analysis is one method of
  • Parity — Even and odd cases split integer proofs