MathLabs

Competition mathematics and problem solving

Case analysis and extremal principle

Solving problems by splitting into exhaustive cases, or by examining an extreme (largest/smallest) element.

IntuitionSplitting an impossible-looking problem into cases you can handle

Imagine a round-robin chess tournament with 55 players, no draws allowed: every pair plays exactly once, and one player always wins. Can the players always be lined up in some order v1,v2,…,v5v_1, v_2, \dots, v_5 so that each one beat the very next player in line? Checking all 5!=1205! = 120 orderings by hand is wasteful, and the answer may look like it depends on who beat whom. Instead, pick out the single longest winning chain that already exists among the players — the most extreme chain — and a short argument shows it cannot be improved, which forces it to already include everyone.

Interactive directed tournament graph with the longest winning path highlighted.
A tournament graph on 55 players: each arrow points from winner to loser. The highlighted path is a longest existing winning chain; the extremal principle shows it must already visit every player.

UndergraduateTwo complementary strategies: exhaustive case split and the extremal principle

Definition: Exhaustive case analysis and the extremal principle

Exhaustive case analysis partitions the set of all possibilities SS into finitely many pairwise-disjoint cases S1,…,SkS_1,\dots,S_k whose union is all of SS, then verifies the claim separately inside each case; because no possibility is left out and none is double-counted, proving the claim in every case proves it for SS. The extremal principle instead looks at a single most extreme member of a finite (or well-ordered) collection — the largest, the smallest, the longest — with respect to some quantity, and exploits the fact that this element cannot be improved upon to derive a contradiction or a direct construction.

S=S1∪S2∪⋯∪Sk,Si∩Sj=∅ for i≠jS = S_1 \cup S_2 \cup \cdots \cup S_k,\quad S_i \cap S_j = \varnothing \text{ for } i \neq j

Here SS is the entire universe of possibilities under consideration, kk is the number of cases, and the two conditions say the cases are exhaustive (their union recovers SS, so nothing is missed) and mutually exclusive (their pairwise intersections are empty, so nothing is counted twice).

∅≠A⊆Z≥0  ⟹  ∃ m∈A with m≤a for all a∈A\varnothing \neq A \subseteq \mathbb{Z}_{\ge 0} \implies \exists\, m \in A \text{ with } m \le a \text{ for all } a \in A

This well-ordering principle is what makes the extremal principle rigorous on integers: any nonempty set AA of nonnegative integers has a least element mm, so 'the smallest counterexample' or 'the shortest path' is never a vacuous phrase — it is guaranteed to exist, and by symmetry the same holds for a maximum whenever AA is additionally finite or bounded above.

M=max⁡x∈Af(x)  ⟹  f(x)≤M for every x∈AM = \max_{x \in A} f(x) \implies f(x) \le M \text{ for every } x \in A

This says nothing more than the definition of a maximum — but it is the engine of every extremal-principle proof: once MM is fixed as the maximum, every competitor xx must satisfy f(x)≤Mf(x) \le M, including cleverly constructed competitors that the proof builds specifically to expose a contradiction if MM were not already extreme enough.

Case analysis and the extremal principle side by side
TechniqueCore ideaTypical use
Exhaustive case splitPartition all possibilities into finitely many disjoint cases and verify each oneParity/remainder arguments modulo nn, small finite enumeration
Extremal principle (maximum)Take the element maximizing some quantity and show it cannot be strictly improvedLongest path in a graph, farthest pair of points, largest counterexample
Extremal principle (minimum)Take the element minimizing some quantity and show it cannot be strictly beatenNearest point–line distance (Sylvester–Gallai), smallest counterexample (infinite descent)
Well-ordering of Z≥0\mathbb{Z}_{\ge 0}Guarantees a minimum exists in any nonempty set of nonnegative integersMakes 'the extremal element' rigorous; foundation of infinite descent

UndergraduateKey theorems: an ordinary line via minimum distance, and Hamiltonian paths in tournaments

If n≥3n \ge 3 points in the plane are not all collinear, then there exists a line passing through exactly 22 of the points (an ordinary line).

Why is it true?

Among the finitely many pairs (point, line-through-two-points) where the point does not lie on the line, pick the pair achieving the strictly smallest distance; if that closest line had a third point on it, geometry would produce an even closer pair, which is impossible by minimality.

Proof

Step 1 (set up the extremal choice). Let PP be the given finite set of n≥3n \ge 3 points, not all collinear. Consider the finite set of pairs (Q,ℓ)(Q, \ell) where ℓ\ell is a line through at least 22 points of PP and Q∈PQ \in P is a point not on ℓ\ell. This set is nonempty (since PP is not all collinear) and finite, so by the extremal principle we may choose a pair (Q0,ℓ0)(Q_0, \ell_0) minimizing the distance d(Q0,ℓ0)d(Q_0, \ell_0) from the point to the line.

Step 2 (assume a contradiction). Suppose, for contradiction, that ℓ0\ell_0 contains at least 33 points of PP. Let FF be the foot of the perpendicular from Q0Q_0 to ℓ0\ell_0. Since there are ≥3\ge 3 points of PP on ℓ0\ell_0 and they lie on at most 22 rays emanating from FF along ℓ0\ell_0, the pigeonhole principle gives two of them, BB and CC, on the same ray, with BB between FF and CC (allowing B=FB = F).

Step 3 (build a closer pair via similar triangles). Drop a perpendicular from BB to the line Q0CQ_0C, with foot GG. The right triangles △BGC\triangle BGC and △Q0FC\triangle Q_0FC share the angle at CC, so they are similar, giving BGQ0F=BCQ0C\dfrac{BG}{Q_0F} = \dfrac{BC}{Q_0C}. Since BB lies between FF and CC we have BC≤FCBC \le FC, and since △Q0FC\triangle Q_0FC has a right angle at FF, the hypotenuse satisfies FC<Q0CFC < Q_0C; combining these, BC<Q0CBC < Q_0C, hence BG<Q0F=d(Q0,ℓ0)BG < Q_0F = d(Q_0, \ell_0).

Step 4 (contradiction). The line Q0CQ_0C passes through 22 points of PP (namely Q0Q_0 and CC), and BB is a point of PP not on it, so (B,Q0C)(B, Q_0C) is a valid pair in our finite set with d(B,Q0C)=BG<d(Q0,ℓ0)d(B, Q_0C) = BG < d(Q_0, \ell_0), contradicting the minimality of (Q0,ℓ0)(Q_0, \ell_0).

Step 5 (conclusion). The contradiction shows ℓ0\ell_0 cannot contain 33 or more points of PP; since it was chosen to contain at least 22, it contains exactly 22, so ℓ0\ell_0 is the required ordinary line.

In every tournament on nn vertices (a complete directed graph where, for each pair of distinct vertices u,vu, v, exactly one of the arcs u→vu \to v or v→uv \to u is present), there exists a Hamiltonian path v1→v2→⋯→vnv_1 \to v_2 \to \cdots \to v_n visiting every vertex exactly once.

Why is it true?

Take a directed path of maximum length; if some vertex were left out, the tournament property (every pair has a directed edge) would let us either extend the path at one end or insert the missing vertex in the middle, contradicting maximality.

Proof

Step 1 (extremal choice). Among all directed paths in the tournament, choose one, P:v1→v2→⋯→vkP: v_1 \to v_2 \to \cdots \to v_k, with the largest possible number of vertices kk; such a maximum exists because there are only finitely many vertices. Suppose, for contradiction, that k<nk < n, and let uu be a vertex not on PP.

Step 2 (case split at the two ends). Since the tournament has exactly one of u→v1u \to v_1 or v1→uv_1 \to u: if u→v1u \to v_1 held, prepending uu would give the longer path u→v1→⋯→vku \to v_1 \to \cdots \to v_k, contradicting the maximality of kk; hence v1→uv_1 \to u holds. Symmetrically, exactly one of vk→uv_k \to u or u→vku \to v_k holds: if vk→uv_k \to u held, appending uu would give a longer path, contradicting maximality; hence u→vku \to v_k holds.

Step 3 (locate an insertion point). We now know v1→uv_1 \to u and u→vku \to v_k. Let jj be the largest index in {1,…,k−1}\{1, \dots, k-1\} such that vj→uv_j \to u holds; this set of indices is nonempty since j=1j = 1 works, so by the extremal principle jj exists. By maximality of jj, the arc vj+1→uv_{j+1} \to u does not hold, so the tournament property forces u→vj+1u \to v_{j+1}.

Step 4 (contradiction by insertion). Combining vj→uv_j \to u with u→vj+1u \to v_{j+1}, we insert uu between vjv_j and vj+1v_{j+1} to form the path v1→⋯→vj→u→vj+1→⋯→vkv_1 \to \cdots \to v_j \to u \to v_{j+1} \to \cdots \to v_k, which has k+1k + 1 vertices, contradicting the maximality of kk.

Step 5 (conclusion). No such vertex uu can exist, so k=nk = n and PP is a Hamiltonian path.

AdvancedReal-World Applications and Worked Examples

In sports analytics and ranking algorithms, Rédei's theorem guarantees that the results of any round-robin tournament — even a cyclic upset like AA beats BB, BB beats CC, CC beats AA — can always be arranged into at least one linear ranking where each competitor beats the next, which is exactly the ordering produced by 'insert the odd one out' scheduling heuristics. In algebraic complexity theory, quantitative versions of the Sylvester–Gallai theorem bound how many linear forms can pairwise satisfy restrictive collinearity conditions, and are a key tool for proving lower bounds on arithmetic circuits that compute a sum of powers of linear forms. In algorithm design and program verification, the extremal principle in the guise of 'take the minimal counterexample' is the standard engine behind infinite-descent correctness proofs for greedy and exchange algorithms.

Example: Enumerating all solutions of x2−y2=45x^2 - y^2 = 45 by case analysis

Find all pairs of positive integers (x,y)(x, y) with x>yx > y satisfying x2−y2=45x^2 - y^2 = 45.

Solution

Factor the left side: x2−y2=(x−y)(x+y)=45x^2 - y^2 = (x - y)(x + y) = 45. Since x,yx, y are positive integers with x>yx > y, both d1=x−yd_1 = x - y and d2=x+yd_2 = x + y are positive divisors of 4545 with d1<d2d_1 < d_2 and d1d2=45d_1 d_2 = 45; they must also share the same parity (because d1+d2=2xd_1 + d_2 = 2x is even), which is automatic here since 4545 is odd and hence every divisor of 4545 is odd.

The positive divisors of 45=32×545 = 3^2 \times 5 are 1,3,5,9,15,451, 3, 5, 9, 15, 45, and pairing each divisor below 45\sqrt{45} with the complementary one above it gives exactly 33 exhaustive cases: (d1,d2)∈{(1,45),(3,15),(5,9)}(d_1, d_2) \in \{(1, 45), (3, 15), (5, 9)\}. No other case is possible, since every divisor of 4545 appears in exactly one of these three pairs.

Solving x=d1+d22x = \dfrac{d_1 + d_2}{2} and y=d2−d12y = \dfrac{d_2 - d_1}{2} in each case: (1,45)(1, 45) gives (x,y)=(23,22)(x, y) = (23, 22); (3,15)(3, 15) gives (x,y)=(9,6)(x, y) = (9, 6); (5,9)(5, 9) gives (x,y)=(7,2)(x, y) = (7, 2). Having checked every case exhaustively, these 33 pairs are the complete solution set.

Example: Proving 2\sqrt{2} is irrational via the extremal principle (infinite descent)

Prove that 2\sqrt{2} is irrational, using the extremal (well-ordering) principle instead of the usual argument with lowest-terms fractions.

Solution

Suppose, for contradiction, that 2\sqrt{2} is rational. Then the set A={ q∈Z>0:q2∈Z>0 }A = \{\, q \in \mathbb{Z}_{>0} : q\sqrt{2} \in \mathbb{Z}_{>0} \,\} is nonempty, so by the well-ordering principle it has a least element q0q_0; let p0=q02∈Z>0p_0 = q_0\sqrt{2} \in \mathbb{Z}_{>0}.

Since 1<2<21 < \sqrt{2} < 2, multiplying by q0q_0 gives q0<p0<2q0q_0 < p_0 < 2q_0. Define q1=p0−q0q_1 = p_0 - q_0 and p1=2q0−p0p_1 = 2q_0 - p_0; both inequalities show 0<q1<q00 < q_1 < q_0 and 0<p1<q00 < p_1 < q_0, so q1q_1 is a positive integer strictly smaller than q0q_0.

Compute q12=(p0−q0)2=p02−q02=p02−p0q_1\sqrt{2} = (p_0 - q_0)\sqrt{2} = p_0\sqrt{2} - q_0\sqrt{2} = p_0\sqrt{2} - p_0. But p0=q02p_0 = q_0\sqrt{2} gives p02=q02⋅2=2q0p_0\sqrt{2} = q_0\sqrt{2}\cdot\sqrt{2} = 2q_0, so q12=2q0−p0=p1q_1\sqrt{2} = 2q_0 - p_0 = p_1, a positive integer.

Thus q1∈Aq_1 \in A and q1<q0q_1 < q_0, contradicting the minimality of q0q_0 as the least element of AA. The contradiction shows AA must in fact be empty, so 2\sqrt{2} is irrational.

The Sylvester–Gallai theorem guarantees an ordinary line (through exactly 22 points) for any finite set of n≥3n \ge 3 points in the plane, provided that:

A round-robin tournament (no ties) is played among 66 teams. By Rédei's theorem, how many of the 6!=7206! = 720 possible orderings of the teams are guaranteed to be a valid Hamiltonian path (a full ranking where each team beat the next)?

Using exhaustive case analysis on remainders modulo 33, how many integers from 11 to 300300 are not divisible by 33?

A proof 'by minimal counterexample' assumes the statement is false, takes the smallest failing instance, and derives an even smaller failing instance to reach a contradiction. Which property must the set of potential counterexamples have for this argument to be valid?

References

  1. Martin Aigner, Günter M. Ziegler (2018). Proofs from THE BOOK · DOI:10.1007/978-3-662-57265-8
  2. Thomas Schweser, Michael Stiebitz, Bjarne Toft (2025). The Tournament Theorem of Rédei revisited · arXiv:2510.10659 [preprint, not peer-reviewed]