Different Proofs

6. Combinatorial Identities🔗

Definition6.1
Group: Combinatorial identities. (5)
Group member previews
Preview
Theorem 6.2
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 0✓L∃∀N

For all n, k, \binom{n}{k} + \binom{n}{k+1} = \binom{n+1}{k+1}.

Lean code for Definition6.1●1 definition

Note that Nat.choose is "defined" via Pascal's identity. Still the following proofs are valid and compile.

Theorem6.2
Group: Combinatorial identities. (5)
Group member previews
Preview
Definition 6.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 0✓L∃∀N

Pascal's identity holds.

Lean code for Theorem6.2●1 theorem
  • 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}`. 
Proof for Theorem 6.2
uses 0

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}.

Theorem6.3
Group: Combinatorial identities. (5)
Group member previews
Preview
Definition 6.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 0✓L∃∀N

Pascal's identity holds.

Lean code for Theorem6.3●1 theorem
  • 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)`. 
Proof for Theorem 6.3
uses 0

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}.

Definition6.4
Group: Combinatorial identities. (5)
Group member previews
Preview
Definition 6.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 0✓L∃∀N

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
Theorem6.5
Group: Combinatorial identities. (5)
Group member previews
Preview
Definition 6.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 0✓L∃∀N

The hockey-stick identity holds.

Lean code for Theorem6.5●1 theorem
Proof for Theorem 6.5
uses 0

Induct on n. The successor step adds the last summand and then uses Pascal's identity at the end of the diagonal.

Theorem6.6
Group: Combinatorial identities. (5)
Group member previews
Preview
Definition 6.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 0✓L∃∀N

The hockey-stick identity holds.

Lean code for Theorem6.6●1 theorem
  • 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`. 
Proof for Theorem 6.6
uses 0

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.