6. Combinatorial Identities
For all n, k, \binom{n}{k} + \binom{n}{k+1} = \binom{n+1}{k+1}.
Lean code for Definition6.1●1 definition
Associated Lean declarations
-
PascalIdentity[complete]
-
PascalIdentity[complete]
-
defdefined in DifferentProofs/CombinatorialIdentities/Defs.leancomplete
def PascalIdentity : Prop
def PascalIdentity : Prop
Pascal's identity for binomial coefficients.
Note that Nat.choose is "defined" via Pascal's identity. Still the following proofs are valid and compile.
Pascal's identity holds.
Lean code for Theorem6.2●1 theorem
Associated Lean declarations
-
PascalIdentity_counting[complete]
-
PascalIdentity_counting[complete]
-
theoremdefined in DifferentProofs/CombinatorialIdentities/Pascal/Counting.leancomplete
theorem PascalIdentity_counting : PascalIdentity
theorem PascalIdentity_counting : PascalIdentity
**Pascal's rule**, by counting the `(k + 1)`-element subsets of `{0, 1, …, n}` in two ways: directly, and after splitting them according to whether they contain the distinguished element `n`. Those that do biject with the `k`-element subsets of `{0, 1, …, n - 1}` by deleting `n`; those that do not are exactly the `(k + 1)`-element subsets of `{0, 1, …, n - 1}`.
Count the subsets of cardinality k + 1 of \{0, 1, \dots, n\} in two ways.
There are \binom{n+1}{k+1} of them.
On the other hand, split them according to whether they contain the distinguished
element n: deleting n is a bijection between those that do and the subsets of
cardinality k of \{0, 1, \dots, n-1\}, of which there are \binom{n}{k},
while those that do not are exactly the subsets of cardinality k + 1 of
\{0, 1, \dots, n-1\}, of which there are \binom{n}{k+1}.
Pascal's identity holds.
Lean code for Theorem6.3●1 theorem
Associated Lean declarations
-
PascalIdentity_binomial[complete]
-
PascalIdentity_binomial[complete]
-
theoremdefined in DifferentProofs/CombinatorialIdentities/Pascal/Binomial.leancomplete
theorem PascalIdentity_binomial : PascalIdentity
theorem PascalIdentity_binomial : PascalIdentity
**Pascal's rule**, by comparing coefficients in `(1 + X) ^ (n + 1) = (1 + X) * (1 + X) ^ n`. The binomial theorem identifies the coefficient of `X ^ k` in `(1 + X) ^ n` as `n.choose k` (`Polynomial.coeff_one_add_X_pow`, which mathlib proves by induction on `n`); multiplying by `1 + X` shifts a copy of those coefficients by one, so the coefficient of `X ^ (k + 1)` on the right is `n.choose (k + 1) + n.choose k`, and on the left it is `(n + 1).choose (k + 1)`.
Compare the coefficients of X^{k+1} on the two sides of
(1 + X)^{n+1} = (1 + X)(1 + X)^n.
By the binomial theorem, which is proved by induction on n, the coefficient of X^j
in (1 + X)^n is \binom{n}{j}. So the left-hand side contributes \binom{n+1}{k+1},
while multiplying by 1 + X adds a copy of the coefficients shifted by one, making the
right-hand side \binom{n}{k+1} + \binom{n}{k}.
For all n, k, \sum_{i=0}^{n} \binom{i+k}{k} = \binom{n+k+1}{k+1}.
Lean code for Definition6.4●1 definition
Associated Lean declarations
-
HockeyStickIdentity[complete]
-
HockeyStickIdentity[complete]
-
defdefined in DifferentProofs/CombinatorialIdentities/Defs.leancomplete
def HockeyStickIdentity : Prop
def HockeyStickIdentity : Prop
The hockey-stick identity for binomial coefficients.
The hockey-stick identity holds.
Lean code for Theorem6.5●1 theorem
Associated Lean declarations
-
HockeyStickIdentity_induction[complete]
-
HockeyStickIdentity_induction[complete]
-
theoremdefined in DifferentProofs/CombinatorialIdentities/HockeyStick/Induction.leancomplete
theorem HockeyStickIdentity_induction : HockeyStickIdentity
theorem HockeyStickIdentity_induction : HockeyStickIdentity
Induct on n. The successor step adds the last summand and then uses
Pascal's identity at the end of the diagonal.
The hockey-stick identity holds.
Lean code for Theorem6.6●1 theorem
Associated Lean declarations
-
HockeyStickIdentity_doubleCounting[complete]
-
HockeyStickIdentity_doubleCounting[complete]
-
theoremdefined in DifferentProofs/CombinatorialIdentities/HockeyStick/DoubleCounting.leancomplete
theorem HockeyStickIdentity_doubleCounting : HockeyStickIdentity
theorem HockeyStickIdentity_doubleCounting : HockeyStickIdentity
**Hockey-stick identity**, by counting the `(k + 1)`-element subsets of `{0, 1, …, n + k}` in two ways: directly, and after partitioning them according to their largest element `m`, which ranges over `k, k + 1, …, n + k`.
Count the subsets of cardinality k + 1 of \{0, 1, \dots, n + k\} in two ways.
There are \binom{n+k+1}{k+1} of them.
On the other hand, sort them by their largest element m, which ranges over
k, k+1, \dots, n+k: deleting m is a bijection between the subsets with largest
element m and the subsets of cardinality k of \{0, 1, \dots, m-1\}, of which
there are \binom{m}{k}. Summing over m = i + k for 0 \le i \le n gives the
left-hand side.