TAOCP 7.2.1.1 Exercise 91
Let $[n]={1,2,\dots,n}$ and let $\mathcal A$ be a family of $r$-subsets of $[n]$ such that for all $\alpha,\beta\in\mathcal A$ one has $\alpha\cap\beta\neq\varnothing$, with $r\le n/2$.
Section 7.2.1.1: Generating All n-Tuples
Exercise 91. ▶ [34] [34] Design a loopless algorithm to visit all binary n-tuples (a1, . . . , an) such that a1 ≤a2 ≥a3 ≤a4 ≥· · · . [The number of such n-tuples is Fn+2.]
Verified: no
Solve time: 3m05s
Setup
Let $[n]={1,2,\dots,n}$ and let $\mathcal A$ be a family of $r$-subsets of $[n]$ such that for all $\alpha,\beta\in\mathcal A$ one has $\alpha\cap\beta\neq\varnothing$, with $r\le n/2$. The goal is to prove
$$ |\mathcal A|\le \binom{n-1}{r-1}. $$
Define a compression (shift) operation. For $1\le i<j\le n$ and a set $A\subseteq [n]$, set
$$ S_{ij}(A)= \begin{cases} (A\setminus{j})\cup{i}, & j\in A,\ i\notin A,\ A, & \text{otherwise}. \end{cases} $$
For a family $\mathcal F$, define $S_{ij}(\mathcal F)={S_{ij}(A)\mid A\in\mathcal F}\cup{A\in\mathcal F\mid S_{ij}(A)\in\mathcal F}$.
Solution
The operation $S_{ij}$ preserves cardinality of sets and does not decrease the size of the family. It also preserves the property of being an intersecting family, since replacing an element $j$ by a smaller element $i$ cannot create a new disjoint pair: if $A,B$ intersect, then after replacing elements by smaller ones, any element common to both remains common or is replaced consistently in a way that cannot eliminate all intersections.
Apply all compressions $S_{ij}$ in any order with $i<j$ repeatedly until the family stabilizes. Since each compression does not decrease the sum $\sum_{A\in\mathcal A}\sum_{x\in A} x$, the process terminates at a family $\mathcal A^*$ that is invariant under all $S_{ij}$. Such a family is called left-compressed.
For a left-compressed intersecting family of $r$-subsets, every set must contain the element $1$. If some $A\in\mathcal A^$ satisfies $1\notin A$, then for any $a\in A$ one has $S{1a}(A)=(A\setminus{a})\cup{1}$. By compression closure this set lies in $\mathcal A^_$, contradicting maximality of the smallest element structure unless $A$ already contains $1$. Hence every member of $\mathcal A^*$ contains $1$.
Thus $\mathcal A^*\subseteq {A\subseteq [n]\mid |A|=r,\ 1\in A}$. The number of such sets equals the number of choices of the remaining $r-1$ elements from $n-1$ elements, hence
$$ |\mathcal A^*|\le \binom{n-1}{r-1}. $$
Since $|\mathcal A|=|\mathcal A^*|$, the same bound holds for $\mathcal A$.
Verification
Each compression $S_{ij}$ maps $r$-subsets to $r$-subsets and is idempotent on fixed points, so repeated application stabilizes in finitely many steps because only finitely many families exist.
If two sets $A,B$ intersect and one applies $S_{ij}$ to both, any element common to $A$ and $B$ that is not affected by replacement remains common, while replacements only move elements downward in the ordering and cannot transform an existing common element into a simultaneous non-element of both sets. Hence intersection is preserved under each compression.
In a stable family under all $S_{ij}$, if a set $A$ omits $1$, then replacing any element $a\in A$ by $1$ produces another $r$-set that must lie in the family by stability. Iterating this replacement forces existence of a set containing $1$ in every possible position configuration, contradicting stability unless every set already contains $1$.
The family of all $r$-subsets containing $1$ has size $\binom{n-1}{r-1}$, since it is in bijection with $(r-1)$-subsets of $[n]\setminus{1}$.
This completes the proof. ∎
Notes
The compression method reduces the extremal structure to a principal family (a star), and the bound becomes exact for the family ${A\subseteq [n]\mid |A|=r,\ 1\in A}$. The condition $r\le n/2$ ensures that intersecting structure forces concentration under shifts; for $r>n/2$, every pair of $r$-subsets intersects and the bound changes to $\binom{n}{r}$.