Documentation

AlgebraicCombinatorics.Partitions.QBinomialFormulas

q-Binomial Formulas #

This file formalizes the q-binomial formulas from the Algebraic Combinatorics text, including:

Main Definitions (in namespace AlgebraicCombinatorics.QBinomialRec) #

Namespace structure: All definitions in this file are in the sub-namespace AlgebraicCombinatorics.QBinomialRec to avoid conflicts with the canonical definitions in QBinomialBasic.lean. The canonical definitions use the monotone function sum formula, while this file uses the q-Pascal recurrence. Both are equivalent (see qBinomial_eq_sum_monotone).

To use definitions from this file:

Main Results #

References #

Sub-namespace for Recursive q-Binomial Definitions #

The definitions qNat, qFactorial, qBinomial, and related theorems in this file use the q-Pascal recurrence, which is different from the monotone function sum definition in QBinomialBasic.lean. To avoid namespace conflicts when both files are imported together, these definitions are placed in the QBinomialRec sub-namespace.

The equivalence between the two definitions is proven in qBinomial_eq_sum_monotone.

To use these definitions, either:

  1. Open the namespace: open AlgebraicCombinatorics.QBinomialRec
  2. Use the full path: AlgebraicCombinatorics.QBinomialRec.qBinomial

Definition def.pars.qbinom.qint: q-integers and q-factorials #

This section formalizes the q-analogs of integers and factorials from Definition 2.3.2.

Part (a): The q-integer [n]_q = q^0 + q^1 + ... + q^{n-1} ∈ ℤ[q]

Part (b): The q-factorial [n]_q! = [1]_q · [2]_q · ... · [n]_q ∈ ℤ[q]

Part (c): For any element a of a ring A, [n]_a and [n]_a! denote the results of substituting a for q in [n]_q and [n]_q!, respectively.

Remark rmk.pars.qbinom.qint.frac #

For any n ∈ ℕ:

noncomputable def AlgebraicCombinatorics.QBinomialRec.qNat {R : Type u_1} [CommRing R] (q : R) (n : ) :
R

Definition def.pars.qbinom.qint (a): The q-integer [n]_q.

The q-analog of a natural number is defined as the sum: [n]_q = q^0 + q^1 + q^2 + ... + q^{n-1}

This equals (1 - q^n)/(1 - q) in appropriate rings (see qNat_eq_geom_sum). When evaluated at q = 1, this equals n (see qNat_at_one).

Equations
Instances For
    noncomputable def AlgebraicCombinatorics.QBinomialRec.qFactorial {R : Type u_1} [CommRing R] (q : R) (n : ) :
    R

    Definition def.pars.qbinom.qint (b): The q-factorial [n]_q!.

    The q-factorial is defined as the product: [n]_q! = [1]_q · [2]_q · ... · [n]_q

    When evaluated at q = 1, this equals n! (see qFactorial_at_one).

    Equations
    Instances For
      noncomputable def AlgebraicCombinatorics.QBinomialRec.qBinomial {R : Type u_1} [CommRing R] (q : R) :
      R

      The q-binomial coefficient (Gaussian binomial coefficient) [n choose k]_q = [n]_q! / ([k]_q! · [n-k]_q!).

      This is defined as a polynomial in q with integer coefficients. It counts partitions that fit in a k × (n-k) box, weighted by q^|λ|.

      We use the recurrence relation (q-Pascal's identity): [n choose k]_q = [n-1 choose k-1]_q + q^k · [n-1 choose k]_q

      This avoids division and works over any commutative ring.

      This definition is equivalent to AlgebraicCombinatorics.qBinomial in QBinomialBasic.lean, which uses the monotone function sum definition. The equivalence is proven in qBinomial_eq_sum_monotone. The argument order here is (q : R) (n k : ℕ) vs (n k : ℕ) (q : R) in QBinomialBasic.lean.

      Equations
      Instances For
        @[simp]
        @[simp]
        theorem AlgebraicCombinatorics.QBinomialRec.qNat_one {R : Type u_1} [CommRing R] (q : R) :
        qNat q 1 = 1
        theorem AlgebraicCombinatorics.QBinomialRec.qNat_succ {R : Type u_1} [CommRing R] (q : R) (n : ) :
        qNat q (n + 1) = 1 + q * qNat q n
        theorem AlgebraicCombinatorics.QBinomialRec.qFactorial_succ {R : Type u_1} [CommRing R] (q : R) (n : ) :
        qFactorial q (n + 1) = qFactorial q n * qNat q (n + 1)

        Remark rmk.pars.qbinom.qint.frac: Properties of q-integers and q-factorials #

        The following lemmas formalize the key properties from Remark 2.3.3:

        theorem AlgebraicCombinatorics.QBinomialRec.qNat_mul_one_sub {R : Type u_1} [CommRing R] (q : R) (n : ) :
        qNat q n * (1 - q) = 1 - q ^ n

        Remark rmk.pars.qbinom.qint.frac (part 1): The q-integer equals the geometric series formula. [n]_q · (1 - q) = 1 - q^n

        This is the "cleared denominator" form of [n]_q = (1 - q^n)/(1 - q). The equality holds in any commutative ring.

        theorem AlgebraicCombinatorics.QBinomialRec.qNat_eq_geom_sum {F : Type u_2} [Field F] (q : F) (n : ) (hq : q 1) :
        qNat q n = (1 - q ^ n) / (1 - q)

        Remark rmk.pars.qbinom.qint.frac (part 1, field version): In a field where q ≠ 1, we have [n]_q = (1 - q^n)/(1 - q).

        @[simp]

        Remark rmk.pars.qbinom.qint.frac (part 2): [n]_1 = n.

        When we substitute q = 1 into the q-integer, we get the ordinary integer. This follows from 1^0 + 1^1 + ... + 1^{n-1} = n.

        @[simp]

        Remark rmk.pars.qbinom.qint.frac (part 3): [n]_1! = n!.

        When we substitute q = 1 into the q-factorial, we get the ordinary factorial. This follows from [1]_1 · [2]_1 · ... · [n]_1 = 1 · 2 · ... · n = n!.

        @[simp]

        The q-binomial coefficient at q = 1 equals the ordinary binomial coefficient.

        This follows from the recurrence relation and the fact that [n]_1 = n.

        @[simp]
        theorem AlgebraicCombinatorics.QBinomialRec.qBinomial_gt {R : Type u_1} [CommRing R] (q : R) (n k : ) (h : k > n) :
        qBinomial q n k = 0

        Proposition prop.pars.qbinom.0: If k > n, then [n choose k]_q = 0.

        This generalizes Proposition prop.binom.0 (that C(n,k) = 0 when k > n) to q-binomial coefficients.

        The proof uses the partition-theoretic interpretation: [n choose k]_q is a sum over partitions with largest part ≤ n-k and length ≤ k. When k > n, we have n-k < 0, so no such partition exists, and the sum is empty (equals 0).

        Alternatively, the proof proceeds by induction using the q-Pascal recurrence.

        theorem AlgebraicCombinatorics.QBinomialRec.qBinomial_eq_zero_of_lt {R : Type u_1} [CommRing R] (q : R) (n k : ) (h : n < k) :
        qBinomial q n k = 0

        Alias for qBinomial_gt with the hypothesis stated as n < k. This is the form used in Proposition prop.pars.qbinom.0.

        Proposition prop.pars.qbinom.n0: We have [n choose 0]_q = [n choose n]_q = 1 for each n ∈ ℕ.

        This is a fundamental boundary condition for q-binomial coefficients, analogous to the classical binomial coefficient identities C(n,0) = C(n,n) = 1.

        Proposition prop.pars.qbinom.alt-defs: Alternative definitions of q-binomial coefficients #

        This section formalizes the three equivalent characterizations of q-binomial coefficients from Proposition 11.2.4 (prop.pars.qbinom.alt-defs) of the textbook.

        Part (a): Sum over weakly increasing tuples [n choose k]_q = ∑_{0 ≤ i₁ ≤ i₂ ≤ ... ≤ i_k ≤ n-k} q^{i₁ + i₂ + ... + i_k}

        Part (b): Sum over k-element subsets [n choose k]_q = ∑_{S ⊆ {1,...,n}, |S| = k} q^{sum(S) - (1 + 2 + ... + k)}

        Part (c): Evaluation at q = 1 gives ordinary binomial coefficient [n choose k]_1 = C(n, k)

        Part (c) is already proved as qBinomial_at_one above.

        The triangular number T(k) = 1 + 2 + ... + k = k(k+1)/2.

        Equations
        Instances For

          The triangular number equals the sum of the first k positive integers.

          The set of monotone (weakly increasing) functions from Fin k to Fin (m + 1). This represents k-tuples (i₁, ..., i_k) with 0 ≤ i₁ ≤ i₂ ≤ ... ≤ i_k ≤ m.

          This is definitionally equal to AlgebraicCombinatorics.monotoneFunctions.

          Equations
          Instances For

            The sum of values of a function from Fin k to Fin (m + 1).

            Equations
            Instances For

              The set of k-element subsets of {1, 2, ..., n}.

              Equations
              Instances For

                The sum of elements in a finite set of natural numbers.

                Note: This is named finsetSumNat to distinguish from AlgebraicCombinatorics.CauchyBinet.finsetSumFin, which computes the sum of elements in a Finset (Fin n) by extracting their .val. Both compute "the sum of elements" but for different element types.

                Equations
                Instances For
                  theorem AlgebraicCombinatorics.QBinomialRec.qBinomial_eq_sum_monotone {R : Type u_1} [CommRing R] (q : R) (n k : ) (hk : k n) :
                  qBinomial q n k = fmonotoneFunctions k (n - k), q ^ sumValues k (n - k) f
                  theorem AlgebraicCombinatorics.QBinomialRec.qBinomial_eq_prod_div {F : Type u_2} [Field F] (q : F) (n k : ) (hk : k n) (hq : i < k, qNat q (i + 1) 0) :
                  qBinomial q n k = iFinset.range k, qNat q (n - i) / qNat q (i + 1)

                  The q-binomial coefficient satisfies the product formula over a field: [n choose k]q = ∏{i=0}^{k-1} [n-i]_q / [i+1]_q

                  This is equivalent to the recursive definition when q is not a root of unity.

                  Combinatorial Definition of q-Binomial Coefficients (Definition def.pars.qbinom.qbinom) #

                  This section formalizes Definition 4.3.2 from the textbook, which defines the q-binomial coefficient (Gaussian binomial coefficient) as a sum over partitions:

                  (a) The q-binomial coefficient [n choose k]_q is the polynomial ∑_{λ} q^|λ| where λ ranges over all partitions with largest part ≤ n-k and length ≤ k.

                  (b) For any ring element a, the evaluation [n choose k]_a is obtained by substituting a for q in the polynomial [n choose k]_q.

                  Key Properties #

                  A partition has largest part ≤ m if all parts are ≤ m. This is used in the combinatorial definition of q-binomial coefficients.

                  Equations
                  Instances For

                    A partition has length ≤ k if it has at most k parts. This is used in the combinatorial definition of q-binomial coefficients.

                    Equations
                    Instances For

                      The set of partitions of a given size that fit in a k × m box (i.e., have length ≤ k and largest part ≤ m).

                      For the q-binomial [n choose k]_q, we use m = n - k.

                      Argument order: (size k m : ℕ) where:

                      • size is the partition size
                      • k is the maximum number of parts (length ≤ k)
                      • m is the maximum part size (largest part ≤ m)

                      This matches the convention in AlgebraicCombinatorics.partitionsInBox from QBinomialBasic.lean.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        The count of partitions of a given size that fit in a k × m box.

                        Equations
                        Instances For

                          Partitions with exactly k parts (not just at most k parts), fitting in a box with largest part ≤ m. Used in the q-Pascal identity proof to split partitions by exact number of parts.

                          Equations
                          Instances For
                            theorem AlgebraicCombinatorics.QBinomialRec.partitionsInBoxExact_card_eq (s k m : ) (hm : m 1) (hs : s k + 1) :
                            (partitionsInBoxExact s (k + 1) m).card = countPartitionsInBox (s - (k + 1)) (k + 1) (m - 1)

                            Key cardinality equality: partitions with exactly k+1 parts in (k+1) × m box biject with partitions with at most k+1 parts in (k+1) × (m-1) box, via the "subtract 1 from each part" bijection. This is the combinatorial heart of the q-Pascal identity.

                            The bijection:

                            • Forward: subtract 1 from each part, filter zeros (using ofSums)
                            • Inverse: add 1 to each part, pad with 1s to get exactly k+1 parts

                            The q-binomial coefficient as a polynomial in ℤ[q]. (Definition def.pars.qbinom.qbinom (a))

                            [n choose k]_q = ∑_{λ} q^|λ|

                            where λ ranges over all partitions with largest part ≤ n-k and length ≤ k.

                            This is a polynomial (not just a formal power series) because there are finitely many such partitions - they all fit in a k × (n-k) box, so their size is at most k · (n-k).

                            When k > n, this is 0 (the empty sum, since n - k < 0 means no partitions qualify).

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              @[simp]

                              When k > n, the combinatorial q-binomial coefficient is 0.

                              @[simp]

                              [n choose 0]_q = 1 for all n.

                              @[simp]

                              [n choose n]_q = 1 for all n.

                              noncomputable def AlgebraicCombinatorics.QBinomialRec.qBinomialEval {R : Type u_1} [CommRing R] (n k : ) (a : R) :
                              R

                              The q-binomial coefficient evaluated at a ring element. (Definition def.pars.qbinom.qbinom (b))

                              [n choose k]_a = ∑_{λ} a^|λ|

                              where λ ranges over all partitions with largest part ≤ n-k and length ≤ k.

                              This is the result of substituting a for q in the polynomial [n choose k]_q.

                              Equations
                              Instances For

                                Alternative definition: directly sum over partitions.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For

                                  The two definitions of qBinomialEval agree.

                                  @[simp]
                                  theorem AlgebraicCombinatorics.QBinomialRec.qBinomialEval_of_gt {R : Type u_1} [CommRing R] (n k : ) (h : k > n) (a : R) :

                                  When k > n, the evaluated q-binomial is 0.

                                  @[simp]

                                  [n choose 0]_a = 1 for all n and a.

                                  @[simp]

                                  [n choose n]_a = 1 for all n and a.

                                  The q-Pascal identity for qBinomialPolyDef (polynomial version). This is the combinatorial heart of the proof connecting the two definitions.

                                  The identity states: [n+1 choose k+1]_q = [n choose k]_q + q^{k+1} · [n choose k+1]_q

                                  Combinatorially, partitions in a (k+1) × (n-k) box split into two types:

                                  1. Those with length ≤ k (same as partitions in k × (n-k) box)
                                  2. Those with length = k+1, which biject with partitions in (k+1) × (n-k-1) box via "removing a column" (subtracting 1 from each of the k+1 parts), with size decreased by k+1 (hence the factor q^{k+1}).

                                  The combinatorial definition agrees with the recursive definition. This connects Definition def.pars.qbinom.qbinom with the recurrence-based qBinomial.

                                  The proof shows that both definitions satisfy the same recurrence relation (q-Pascal's identity) and boundary conditions.

                                  theorem AlgebraicCombinatorics.QBinomialRec.prod_add_eq_sum_over_subsets {L : Type u_1} [CommRing L] {n : } (a b : Fin nL) :
                                  i : Fin n, (a i + b i) = S : Finset (Fin n), (∏ iS, a i) * iS, b i

                                  Lemma lem.prodrule.sum-ai-plus-bi: Product expansion rule. When expanding ∏ᵢ (aᵢ + bᵢ), we get a sum over all subsets S of [n], where each term is (∏{i ∈ S} aᵢ) · (∏{i ∉ S} bᵢ).

                                  This is a fundamental identity used in proofs of the q-binomial theorems and determinant formulas.

                                  A rigorous proof can be found in [detnotes, Exercise 6.1 (a)].

                                  theorem AlgebraicCombinatorics.QBinomialRec.qBinomial_induction_identity {K : Type u_1} [CommRing K] (q : K) (n k : ) :
                                  q ^ k * qBinomial q n (k + 1) + q ^ n * qBinomial q n k = q ^ k * qBinomial q n k + q ^ (k + 1) * q ^ k * qBinomial q n (k + 1)

                                  Key algebraic identity for the induction step of qBinomial_sum_subsets.

                                  This identity holds because qBinomial satisfies specific algebraic relations. The proof uses induction on n, showing that the identity follows from the recurrence relation for qBinomial.

                                  Specifically, we need: q^k * qBinomial q n (k+1) + q^n * qBinomial q n k = q^k * qBinomial q n k + q^(2k+1) * qBinomial q n (k+1)

                                  This is equivalent to: (q^n - q^k) * qBinomial q n k = q^k * (q^(k+1) - 1) * qBinomial q n (k+1)

                                  The proof proceeds by induction on n, using the specific structure of qBinomial coefficients. The identity follows from the fact that qBinomial can be expressed as a geometric sum.

                                  theorem AlgebraicCombinatorics.QBinomialRec.qBinomial_sum_subsets {K : Type u_1} [CommRing K] (q : K) (n k : ) :
                                  S(Finset.range n).powerset with S.card = k, q ^ iS, i = q ^ (k * (k - 1) / 2) * qBinomial q n k

                                  Key lemma: The sum over k-element subsets of {0, 1, ..., n-1} of q^{sum(S)} equals q^{k(k-1)/2} * [n choose k]_q.

                                  This is the combinatorial interpretation of q-binomial coefficients from Proposition prop.pars.qbinom.alt-defs part (b) in the textbook.

                                  The formula arises because:

                                  • [n choose k]_q counts k-element subsets weighted by q^{sum(S) - (1+2+...+k)}
                                  • In 0-indexed form, this becomes q^{sum(S)} = q^{k(k-1)/2} * [n choose k]_q

                                  The proof proceeds by induction on n, using the q-Pascal recurrence.

                                  theorem AlgebraicCombinatorics.QBinomialRec.qBinomial_first_theorem {K : Type u_1} [CommRing K] (a b q : K) (n : ) :
                                  iFinset.range n, (a * q ^ i + b) = kFinset.range (n + 1), q ^ (k * (k - 1) / 2) * qBinomial q n k * a ^ k * b ^ (n - k)

                                  Theorem thm.pars.qbinom.binom1: First q-binomial theorem. For a, b ∈ K and n ∈ ℕ, in the polynomial ring K[q], we have: (aq⁰ + b)(aq¹ + b)···(aqⁿ⁻¹ + b) = ∑_{k=0}^{n} q^{k(k-1)/2} · [n choose k]_q · aᵏ · bⁿ⁻ᵏ

                                  Setting q = 1 recovers the classical binomial formula (a + b)ⁿ.

                                  The proof uses the product expansion lemma (lem.prodrule.sum-ai-plus-bi):

                                  • Expand the product as a sum over subsets S ⊆ {0, 1, ..., n-1}
                                  • For each S, the contribution is a^|S| * q^{∑_{i ∈ S} i} * b^{n - |S|}
                                  • Group by cardinality k = |S|
                                  • Use qBinomial_sum_subsets to evaluate the sum over k-element subsets
                                  theorem AlgebraicCombinatorics.QBinomialRec.qBinomial_first_theorem_at_one {K : Type u_1} [CommRing K] (a b : K) (n : ) :
                                  _iFinset.range n, (a + b) = kFinset.range (n + 1), (n.choose k) * a ^ k * b ^ (n - k)

                                  The first q-binomial theorem specializes to the binomial formula when q = 1.

                                  theorem AlgebraicCombinatorics.QBinomialRec.b_mul_pow_a {L : Type u_1} [CommRing L] {A : Type u_2} [Ring A] [Algebra L A] (ω : L) (a b : A) (hab : b * a = ω (a * b)) (k : ) :
                                  b * a ^ k = ω ^ k (a ^ k * b)

                                  Helper lemma: b * a^k = ω^k * a^k * b for the twisted commutativity relation.

                                  theorem AlgebraicCombinatorics.QBinomialRec.qBinomial_second_theorem {L : Type u_1} [CommRing L] {A : Type u_2} [Ring A] [Algebra L A] (ω : L) (a b : A) (hab : b * a = ω (a * b)) (n : ) :
                                  (a + b) ^ n = kFinset.range (n + 1), qBinomial ω n k (a ^ k * b ^ (n - k))

                                  Theorem thm.pars.qbinom.binom2: Second q-binomial theorem (Potter's binomial theorem). Let A be a noncommutative L-algebra, and let a, b ∈ A satisfy ba = ω·ab for some ω ∈ L. Then (a + b)ⁿ = ∑_{k=0}^{n} [n choose k]_ω · aᵏ · bⁿ⁻ᵏ.

                                  This generalizes the binomial formula to the noncommutative setting with a "twisted" commutativity relation.

                                  theorem AlgebraicCombinatorics.QBinomialRec.linearIndependent_iff_not_mem_span_of_lt {F : Type u_1} [Field F] {V : Type u_2} [AddCommGroup V] [Module F V] {k : } (v : Fin kV) :
                                  LinearIndependent F v ∀ (i : Fin k), v iSubmodule.span F (v '' {j : Fin k | j < i})

                                  Lemma lem.linalg.lin-ind-via-span: A k-tuple (v₁, v₂, ..., vₖ) is linearly independent if and only if each vᵢ ∉ span{v₁, ..., vᵢ₋₁}.

                                  This is the inductive characterization of linear independence.

                                  Lemma lem.pars.qbinom.lin-ind-count: The number of linearly independent k-tuples of vectors in an n-dimensional F-vector space V is ∏_{i=0}^{k-1} (|F|ⁿ - |F|ⁱ).

                                  The proof proceeds by induction on k:

                                  • Base case (k = 0): There is exactly one 0-tuple, which is vacuously linearly independent.
                                  • Inductive step: A linearly independent (k+1)-tuple (v₁, ..., v_{k+1}) corresponds to a linearly independent k-tuple (v₂, ..., v_{k+1}) together with a choice of v₁ outside the span of {v₂, ..., v_{k+1}}. The span has |F|^k elements, so there are |F|^n - |F|^k choices for v₁.

                                  This uses card_linearIndependent from Mathlib which proves this via the equivalence equiv_linearIndependent.

                                  theorem AlgebraicCombinatorics.QBinomialRec.card_eq_mul_of_fibers {A : Type u_3} {B : Type u_4} [Fintype A] [Fintype B] [DecidableEq B] (f : AB) (m : ) (hf : ∀ (b : B), Fintype.card { a : A // f a = b } = m) :

                                  Lemma lem.count.multijection: Multijection principle. If f : A → B is a map such that each b ∈ B has exactly m preimages, then |A| = m · |B|.

                                  This is a fundamental counting principle used throughout combinatorics. A map f satisfying this assumption is called an m-to-1 map.

                                  The proof uses the fiber decomposition: |A| = Σ_{b ∈ B} |fiber(b)|, where each fiber has cardinality m by assumption.

                                  noncomputable def AlgebraicCombinatorics.QBinomialRec.spanMap {F : Type u_1} [Field F] {V : Type u_2} [AddCommGroup V] [Module F V] (k : ) :
                                  { v : Fin kV // LinearIndependent F v }{ W : Submodule F V // Module.finrank F W = k }

                                  The span map sends a linearly independent k-tuple to its span (a k-dimensional subspace).

                                  Equations
                                  Instances For
                                    theorem AlgebraicCombinatorics.QBinomialRec.spanMap_fiber_card {F : Type u_1} [Field F] [Fintype F] {V : Type u_2} [AddCommGroup V] [Module F V] [Module.Finite F V] (k : ) (W : { W : Submodule F V // Module.finrank F W = k }) :
                                    Nat.card { v : { v : Fin kV // LinearIndependent F v } // spanMap k v = W } = iFinset.range k, (Fintype.card F ^ k - Fintype.card F ^ i)

                                    Key lemma for thm.pars.qbinom.subsp-count: Each k-dimensional subspace W has exactly ∏_{i=0}^{k-1} (q^k - q^i) preimages under the span map.

                                    This is because the preimages are exactly the ordered bases of W:

                                    • A linearly independent k-tuple v with span(v) = W must lie entirely in W
                                    • Since W is k-dimensional and v has k linearly independent vectors, v spans W automatically
                                    • Thus the preimages are exactly the linearly independent k-tuples in W
                                    • By card_linearIndependent, the count is ∏_{i=0}^{k-1} (q^k - q^i)

                                    This is the key step in the proof of qBinomial_subspace_count.

                                    theorem AlgebraicCombinatorics.QBinomialRec.qBinomial_subspace_count {F : Type u_1} [Field F] [Fintype F] {V : Type u_2} [AddCommGroup V] [Module F V] [Module.Finite F V] (n k : ) (hn : Module.finrank F V = n) :
                                    qBinomial (↑(Fintype.card F)) n k = (Nat.card { W : Submodule F V // Module.finrank F W = k })

                                    Theorem thm.pars.qbinom.subsp-count: The q-binomial coefficient at |F| counts k-dimensional subspaces. If V is an n-dimensional vector space over a finite field F, then [n choose k]_{|F|} = (# of k-dimensional subspaces of V).

                                    This is the "linear analogue" of the fact that C(n,k) counts k-element subsets of an n-element set.

                                    Proof outline #

                                    The proof uses the multijection principle (Lemma lem.count.multijection):

                                    1. Define the span map f : (linearly independent k-tuples in V) → (k-dim subspaces of V) that sends a tuple v to its span span(v).

                                    2. By card_linearIndependent_tuples: |linearly independent k-tuples in V| = ∏_{i=0}^{k-1} (q^n - q^i)

                                    3. By spanMap_fiber_card, each k-dimensional subspace W has exactly ∏_{i=0}^{k-1} (q^k - q^i) preimages under f (the number of ordered bases of W).

                                    4. By the multijection principle: ∏{i=0}^{k-1} (q^n - q^i) = (∏{i=0}^{k-1} (q^k - q^i)) × (# of k-dim subspaces)

                                    5. Therefore: (# of k-dim subspaces) = ∏{i=0}^{k-1} (q^n - q^i) / ∏{i=0}^{k-1} (q^k - q^i) = [n choose k]_q

                                    The number of partitions of n with at most k parts.

                                    Equations
                                    Instances For

                                      Proposition prop.pars.qbinom.lim1: Limit of q-binomial coefficients. As n → ∞, the q-binomial coefficient [n choose k]q converges coefficientwise to ∑{n ∈ ℕ} (p₀(n) + p₁(n) + ... + pₖ(n)) qⁿ = ∏_{i=1}^{k} 1/(1 - qⁱ)

                                      where pᵢ(n) is the number of partitions of n with exactly i parts.

                                      This is stated for power series over a field where inverses exist.

                                      The limit of q-binomial coefficients equals the generating function for partitions with at most k parts.

                                      This is the second equality in Proposition prop.pars.qbinom.lim1: ∑{n ∈ ℕ} (p₀(n) + p₁(n) + ... + pₖ(n)) qⁿ = ∏{i=1}^{k} 1/(1 - qⁱ)

                                      Combined with Theorem thm.pars.main-gf-0n from the partition generating functions section.