The Central Idea

Suppose every object under consideration must satisfy at least one of the conditions

\[ C_1,C_2,\ldots,C_r. \]

If we prove

\[ C_1\Longrightarrow P, \] \[ C_2\Longrightarrow P, \]

and so on through

\[ C_r\Longrightarrow P, \]

then \(P\) holds in every possible situation.

Symbolically,

\[ \boxed{ (C_1\lor C_2\lor\cdots\lor C_r) \land \bigwedge_{i=1}^{r}(C_i\Rightarrow P) \Longrightarrow P. } \]

Why Case Analysis Works

A proof by cases does not prove the theorem by inspecting examples.

Instead, it partitions the entire logical domain into categories and proves the result for every category.

The essential requirement is

\[ \boxed{\text{every permitted object belongs to at least one case}.} \]

If even one possible situation is omitted, the proof is incomplete.

Exhaustive Cases

A collection of cases is exhaustive when the cases cover all possible situations relevant to the claim.

For integers, the division

\[ n\text{ is even} \]

or

\[ n\text{ is odd} \]

is exhaustive.

Every integer belongs to exactly one of these categories.

Disjoint Cases

Cases are disjoint when no object can belong to more than one case.

Even and odd integers are disjoint because no integer can be both even and odd.

Disjointness is useful because it prevents overlap, but it is not always required.

Exhaustiveness is the essential requirement.

Cases May Overlap

Suppose a proof uses:

These cases overlap at

\[ x=0. \]

That overlap does not invalidate the proof.

The cases still cover every real number.

The Basic Procedure

  1. Identify the full domain of possibilities.
  2. Choose cases that collectively cover the domain.
  3. State why the cases are exhaustive.
  4. Assume the condition for the first case.
  5. Prove the desired conclusion in that case.
  6. Repeat for every remaining case.
  7. Conclude that the theorem holds in all cases.

Example: The Square of an Integer Is Congruent to \(0\) or \(1\) Modulo \(4\)

Every integer is either even or odd.

We prove:

\[ \boxed{n^2\equiv0\text{ or }1\pmod4.} \]

We divide the proof into two cases.

Case 1: \(n\) Is Even

If \(n\) is even, then

\[ n=2k \]

for some integer \(k\).

Therefore,

\[ n^2=4k^2. \]

Hence

\[ n^2\equiv0\pmod4. \]

Case 2: \(n\) Is Odd

If \(n\) is odd, then

\[ n=2k+1 \]

for some integer \(k\).

Then

\[ n^2=(2k+1)^2 \] \[ =4k^2+4k+1 \] \[ =4(k^2+k)+1. \]

Therefore,

\[ n^2\equiv1\pmod4. \]

Since every integer is either even or odd,

\[ \boxed{n^2\equiv0\text{ or }1\pmod4.} \]

Case Analysis through Remainders

The division algorithm gives natural case structures.

For any integer \(n\) and positive integer \(m\), there is a unique remainder

\[ r\in\{0,1,\ldots,m-1\} \]

such that

\[ n=mq+r. \]

Therefore residue classes modulo \(m\) create an exhaustive set of cases.

Example: Every Integer Square Is \(0\), \(1\), or \(4\) Modulo \(8\)

Every integer is congruent modulo \(4\) to exactly one of

\[ 0,1,2,3. \]

We examine these four cases.

Case 1: \(n=4k\)

\[ n^2=16k^2. \]

Therefore,

\[ n^2\equiv0\pmod8. \]

Case 2: \(n=4k+1\)

\[ n^2=(4k+1)^2 \] \[ =16k^2+8k+1. \]

Therefore,

\[ n^2\equiv1\pmod8. \]

Case 3: \(n=4k+2\)

\[ n^2=(4k+2)^2 \] \[ =16k^2+16k+4. \]

Therefore,

\[ n^2\equiv4\pmod8. \]

Case 4: \(n=4k+3\)

\[ n^2=(4k+3)^2 \] \[ =16k^2+24k+9. \]

Reducing modulo \(8\),

\[ n^2\equiv1\pmod8. \]

Therefore every integer square is congruent to

\[ \boxed{0,1,\text{ or }4\pmod8.} \]

Case Analysis with Absolute Value

The definition of absolute value is itself piecewise:

\[ |x|= \begin{cases} x,&x\ge0,\\ -x,&x<0. \end{cases} \]

Proofs involving absolute value often naturally divide into sign cases.

Example: \(|x|\ge x\)

Prove that for every real number \(x\),

\[ |x|\ge x. \]

We use two cases.

Case 1: \(x\ge0\)

Then

\[ |x|=x. \]

Therefore,

\[ |x|\ge x \]

holds with equality.

Case 2: \(x<0\)

Then

\[ |x|=-x. \]

Since \(x<0\),

\[ -x>0>x. \]

Thus

\[ |x|=-x>x. \]

Therefore,

\[ \boxed{|x|\ge x} \]

for every real number \(x\).

Example: \(|xy|=|x||y|\)

One way to prove

\[ |xy|=|x||y| \]

is to divide according to the signs of \(x\) and \(y\).

There are four sign combinations:

\[ x\ge0,\;y\ge0; \] \[ x\ge0,\;y<0; \] \[ x<0,\;y\ge0; \] \[ x<0,\;y<0. \]

Case 1: Both Nonnegative

If \(x\ge0\) and \(y\ge0\), then \(xy\ge0\).

\[ |xy|=xy \]

and

\[ |x||y|=xy. \]

Hence the two sides are equal.

Case 2: \(x\ge0\) and \(y<0\)

Then \(xy\le0\), so

\[ |xy|=-xy. \]

Also,

\[ |x||y|=x(-y)=-xy. \]

Therefore the identity holds.

Case 3: \(x<0\) and \(y\ge0\)

Then \(xy\le0\), so

\[ |xy|=-xy. \]

Also,

\[ |x||y|=(-x)y=-xy. \]

Again the identity holds.

Case 4: Both Negative

If \(x<0\) and \(y<0\), then \(xy>0\).

\[ |xy|=xy. \]

Meanwhile,

\[ |x||y|=(-x)(-y)=xy. \]

Therefore,

\[ \boxed{|xy|=|x||y|} \]

in all four cases.

Cases from Logical Alternatives

Sometimes the hypotheses themselves provide a disjunction.

Suppose we know

\[ P\lor Q. \]

To prove \(R\), we may prove

\[ P\Longrightarrow R \]

and

\[ Q\Longrightarrow R. \]

Since at least one of \(P\) or \(Q\) holds, \(R\) follows.

Example: A Product Is Zero

Suppose

\[ ab=0. \]

Over the real numbers,

\[ a=0 \quad\text{or}\quad b=0. \]

Therefore any statement that follows from either alternative can be proved by cases.

Example: If \(ab=0\), Then \(a^2b+ab^2=0\)

Case 1:

\[ a=0. \]

Then

\[ a^2b+ab^2=0. \]

Case 2:

\[ b=0. \]

Again,

\[ a^2b+ab^2=0. \]

Therefore the result holds in every possible case.

Cases from Order Relations

Two real numbers \(a\) and \(b\) satisfy exactly one of

\[ ab. \]

This trichotomy often provides a natural three-case proof.

Example: \(\max(a,b)+\min(a,b)=a+b\)

We prove

\[ \boxed{\max(a,b)+\min(a,b)=a+b} \]

for all real \(a,b\).

If \(a\ge b\), then

\[ \max(a,b)=a \]

and

\[ \min(a,b)=b. \]

Thus the sum is \(a+b\).

If \(a \[ \max(a,b)=b \]

and

\[ \min(a,b)=a. \]

Again the sum is \(a+b\).

Case Analysis with Parity

Parity gives one of the most common discrete case splits:

\[ n\text{ even} \quad\text{or}\quad n\text{ odd}. \]

Many expressions behave differently under these two forms:

\[ n=2k \]

versus

\[ n=2k+1. \]

Example: \(n(n+1)\) Is Always Even

Let \(n\) be any integer.

Case 1: \(n\) is even.

Then \(n(n+1)\) contains the even factor \(n\), so the product is even.

Case 2: \(n\) is odd.

Then \(n+1\) is even, so \(n(n+1)\) contains the even factor \(n+1\).

Therefore,

\[ \boxed{n(n+1)\text{ is even for every integer }n.} \]

A Shorter Structural Observation

The previous theorem can also be proved without explicitly labeling two cases by observing that consecutive integers always have opposite parity.

Therefore one of

\[ n,\qquad n+1 \]

is even.

This illustrates that a case-based fact may sometimes be compressed once its structure is familiar.

Case Analysis with Modular Classes

For any integer \(n\), exactly one of the following holds:

\[ n\equiv0\pmod3, \] \[ n\equiv1\pmod3, \] \[ n\equiv2\pmod3. \]

These three residue classes can support a complete three-case proof.

Example: \(n(n+1)(n+2)\) Is Divisible by \(3\)

Let \(n\) be any integer.

Case 1:

\[ n\equiv0\pmod3. \]

Then \(3\mid n\).

Case 2:

\[ n\equiv1\pmod3. \]

Then

\[ n+2\equiv0\pmod3. \]

Case 3:

\[ n\equiv2\pmod3. \]

Then

\[ n+1\equiv0\pmod3. \]

In every case, one of

\[ n,\qquad n+1,\qquad n+2 \]

is divisible by \(3\).

Hence

\[ \boxed{3\mid n(n+1)(n+2).} \]

Case Analysis with Set Membership

Set statements may naturally split according to whether an element belongs to a particular set.

For any element \(x\),

\[ x\in A \quad\text{or}\quad x\notin A. \]

If the desired conclusion behaves differently in these two situations, a case proof may be appropriate.

Case Analysis in Algorithms

Algorithms frequently branch according to conditions.

A correctness proof may mirror those branches:

If every possible execution enters one of the branches and the desired property holds in each branch, the algorithm is correct for that step.

Case Analysis in Piecewise Functions

A piecewise function already divides its domain into cases.

For example,

\[ f(x)= \begin{cases} x^2,&x\ge0,\\ -x,&x<0. \end{cases} \]

Any global statement about \(f\) may require analyzing both pieces.

Case Analysis and Proof by Contradiction

Proof methods can be combined.

A proof by cases may contain a contradiction argument inside one of its cases.

For example:

  1. split into even and odd cases;
  2. handle the even case directly;
  3. assume a subclaim fails in the odd case;
  4. derive a contradiction.

The outer structure remains case analysis.

Case Analysis and Induction

An inductive step may itself require cases.

For example, while proving \(P(k+1)\), the argument might depend on whether

\[ k \]

is even or odd.

The induction supplies the overall proof structure, while case analysis resolves different forms inside the inductive step.

Cases Should Reflect Real Structure

A good case split reduces complexity.

Useful distinctions often come from:

Arbitrary case splits can make a proof longer without making it clearer.

Common Error: Cases Are Not Exhaustive

Suppose a proof about real \(x\) uses only:

The case

\[ x=0 \]

has been omitted.

Unless the theorem excludes \(x=0\), the proof is incomplete.

Common Error: Cases Are Examples Instead of Categories

Checking

\[ n=2,\qquad n=4,\qquad n=6 \]

does not constitute the “even case.”

A genuine parity case begins with an arbitrary even integer:

\[ n=2k. \]

Cases must represent entire classes of objects.

Common Error: Proving Different Conclusions in Different Cases

The purpose of case analysis is to establish the same final theorem in every case.

If Case 1 proves \(P\) but Case 2 proves only an unrelated statement \(Q\), the proof has not established \(P\) universally.

Each case must return to the same required conclusion.

Common Error: Introducing Impossible Cases

A case split should respect the hypotheses.

If the theorem already assumes

\[ x>0, \]

then a case

\[ x<0 \]

is impossible and adds nothing to the proof.

Build cases from possibilities that actually remain after all hypotheses are considered.

Common Error: Overlapping Cases without Recognizing the Overlap

Overlap is not automatically wrong, but it can create confusion.

For example,

\[ x\ge0 \]

and

\[ x\le0 \]

both include \(x=0\).

If the proof depends on cases being mutually exclusive, the boundaries must be chosen carefully.

Common Error: Too Many Cases

A proof may be valid but inefficient if it divides the problem more finely than necessary.

For example, if only parity matters, splitting integers into residue classes modulo \(8\) may create eight cases when two would suffice.

Prefer the coarsest case structure that still makes the proof work.

Common Error: Case Labels Do Not Match the Algebra

If a case says

\[ n\equiv2\pmod3, \]

then the algebraic representation should be

\[ n=3k+2. \]

Writing \(n=3k+1\) would analyze the wrong case.

Each symbolic form must match the stated condition exactly.

Common Error: Forgetting the Final Exhaustiveness Statement

After proving every case, connect them back to the full domain.

A useful ending is:

These cases exhaust all possibilities. Therefore the desired conclusion holds for every permitted object.

That sentence closes the logical structure of the proof.

A Reliable Procedure for Case Analysis

  1. State the theorem and identify the domain.
  2. Find a structural distinction that covers the domain.
  3. List all cases explicitly.
  4. Verify that the cases are exhaustive.
  5. Note whether overlap matters.
  6. Choose an arbitrary object satisfying the first case.
  7. Prove the required conclusion in that case.
  8. Repeat for every remaining case.
  9. Check that every case proves the same final claim.
  10. Conclude that the theorem holds because all possibilities were covered.

Example: Full Case-Analysis Workflow

Prove that for every integer \(n\),

\[ n^2+n \]

is even.

Step 1: Choose exhaustive cases.

Every integer is either even or odd.

Case 1: \(n\) is even.

Write

\[ n=2k. \]

Then

\[ n^2+n = 4k^2+2k \] \[ = 2(2k^2+k), \]

so \(n^2+n\) is even.

Case 2: \(n\) is odd.

Write

\[ n=2k+1. \]

Then

\[ n^2+n = (2k+1)^2+(2k+1) \] \[ = 4k^2+6k+2 \] \[ = 2(2k^2+3k+1), \]

so \(n^2+n\) is even.

Step 3: Conclude.

The even and odd cases exhaust all integers. Therefore,

\[ \boxed{n^2+n\text{ is even for every integer }n.} \]

Practice 1: Parity

Prove by cases that for every integer \(n\),

\[ n^2\equiv0\text{ or }1\pmod4. \]

Practice 2: Consecutive Product

Prove by cases that

\[ n(n+1) \]

is even for every integer \(n\).

Practice 3: Three Consecutive Integers

Prove by cases modulo \(3\) that

\[ 3\mid n(n+1)(n+2) \]

for every integer \(n\).

Practice 4: Absolute Value

Prove by cases that

\[ |x|\ge x \]

for every real \(x\).

Practice 5: Maximum and Minimum

Prove by cases:

\[ \max(a,b)+\min(a,b)=a+b. \]

Practice 6: Exhaustiveness

A proof about real numbers uses the cases

\[ x>0 \]

and

\[ x<0. \]

Explain what is missing.

Practice 7: Modular Cases

List the exhaustive residue classes for an integer \(n\) modulo \(5\).

Practice 8: Product Zero

Suppose \(ab=0\). Prove by cases that

\[ a^2b^2=0. \]

Practice 9: Overlap

Are the cases

\[ x\ge0 \]

and

\[ x\le0 \]

exhaustive? Are they disjoint?

Practice 10: Identify the Error

A student claims to prove a statement for all integers by checking only the cases

\[ n\equiv0\pmod4, \] \[ n\equiv1\pmod4, \]

and

\[ n\equiv2\pmod4. \]

Explain why the proof is incomplete.

Practice Answers

Practice 1

If \(n=2k\), then

\[ n^2=4k^2\equiv0\pmod4. \]

If \(n=2k+1\), then

\[ n^2=4(k^2+k)+1\equiv1\pmod4. \]

These cases exhaust all integers.

Practice 2

If \(n\) is even, then \(n\) is an even factor of the product.

If \(n\) is odd, then \(n+1\) is even.

Therefore \(n(n+1)\) is even in both cases.

Practice 3

Every integer satisfies exactly one of

\[ n\equiv0,1,2\pmod3. \]

If \(n\equiv0\), then \(3\mid n\).

If \(n\equiv1\), then \(3\mid(n+2)\).

If \(n\equiv2\), then \(3\mid(n+1)\).

Therefore the product of the three consecutive integers is divisible by \(3\).

Practice 4

If \(x\ge0\), then \(|x|=x\).

If \(x<0\), then \(|x|=-x>x\).

Hence \(|x|\ge x\) for every real \(x\).

Practice 5

If \(a\ge b\), then

\[ \max(a,b)=a,\qquad \min(a,b)=b. \]

If \(a \[ \max(a,b)=b,\qquad \min(a,b)=a. \]

In either case, the sum is \(a+b\).

Practice 6

The case

\[ \boxed{x=0} \]

is missing. The two stated cases are not exhaustive over the real numbers.

Practice 7

The exhaustive residue classes are

\[ \boxed{ n\equiv0,1,2,3,\text{ or }4\pmod5. } \]

Practice 8

Since \(ab=0\), either \(a=0\) or \(b=0\).

If \(a=0\), then

\[ a^2b^2=0. \]

If \(b=0\), then

\[ a^2b^2=0. \]

Therefore the result holds in all cases.

Practice 9

The cases are exhaustive because every real number satisfies at least one of them.

They are not disjoint because

\[ x=0 \]

belongs to both.

Practice 10

The residue class

\[ \boxed{n\equiv3\pmod4} \]

has been omitted.

Therefore the cases do not cover all integers, so the proof is incomplete.

What to Remember

Case analysis proves a theorem by covering the full domain with manageable alternatives:

\[ \boxed{ C_1\lor C_2\lor\cdots\lor C_r } \]

together with

\[ \boxed{ C_i\Longrightarrow P \quad\text{for every case }i. } \]

The strategic question is: What finite set of possibilities covers every object in the problem while making each branch easier to analyze?

Where We Go Next

Case analysis handles a problem by separating possibilities. Another class of discrete proofs instead tracks a quantity or property that remains fixed or changes in only one direction while a process evolves.

The next lesson, Invariants and Monovariants, develops those ideas for analyzing repeated moves, transformations, algorithms, and state changes.