Documentation

Mathlib.RingTheory.Binomial

Binomial rings #

In this file we introduce the binomial property as a mixin, and define the multichoose and choose functions generalizing binomial coefficients.

According to our main reference [elliott2006binomial] (which lists many equivalent conditions), a binomial ring is a torsion-free commutative ring R such that for any x ∈ R and any k ∈ ℕ, the product x(x-1)⋯(x-k+1) is divisible by k!. The torsion-free condition lets us divide by k! unambiguously, so we get uniquely defined binomial coefficients.

The defining condition doesn't require commutativity or associativity, and we get a theory with essentially the same power by replacing subtraction with addition. Thus, we consider any additive commutative monoid with a notion of natural number exponents in which multiplication by positive integers is injective, and demand that the evaluation of the ascending Pochhammer polynomial X(X+1)⋯(X+(k-1)) at any element is divisible by k!. The quotient is called multichoose r k, because for r a natural number, it is the number of multisets of cardinality k taken from a type of cardinality n.

References #

TODO #

class BinomialRing (R : Type u_1) [AddCommMonoid R] [Pow R ℕ] :
Type u_1

A binomial ring is a ring for which ascending Pochhammer evaluations are uniquely divisible by suitable factorials. We define this notion for a additive commutative monoids with natural number powers, but retain the ring name. We introduce Ring.multichoose as the uniquely defined quotient.

  • nsmul_right_injective : ∀ (n : ℕ), n ≠ 0 → Function.Injective fun (x : R) => n • x

    Scalar multiplication by positive integers is injective

  • multichoose : R → ℕ → R

    A multichoose function, giving the quotient of Pochhammer evaluations by factorials.

  • factorial_nsmul_multichoose : ∀ (r : R) (n : ℕ), n.factorial • BinomialRing.multichoose r n = (ascPochhammer ℕ n).smeval r

    The nth ascending Pochhammer polynomial evaluated at any element is divisible by n!

Instances
    theorem BinomialRing.nsmul_right_injective {R : Type u_1} [AddCommMonoid R] [Pow R ℕ] [self : BinomialRing R] (n : ℕ) (h : n ≠ 0) :
    Function.Injective fun (x : R) => n • x

    Scalar multiplication by positive integers is injective

    theorem BinomialRing.factorial_nsmul_multichoose {R : Type u_1} [AddCommMonoid R] [Pow R ℕ] [self : BinomialRing R] (r : R) (n : ℕ) :
    n.factorial • BinomialRing.multichoose r n = (ascPochhammer ℕ n).smeval r

    The nth ascending Pochhammer polynomial evaluated at any element is divisible by n!

    theorem Ring.nsmul_right_injective {R : Type u_1} [AddCommMonoid R] [Pow R ℕ] [BinomialRing R] (n : ℕ) (h : n ≠ 0) :
    Function.Injective fun (x : R) => n • x
    def Ring.multichoose {R : Type u_1} [AddCommMonoid R] [Pow R ℕ] [BinomialRing R] (r : R) (n : ℕ) :
    R

    The multichoose function is the quotient of ascending Pochhammer evaluation by the corresponding factorial. When applied to natural numbers, multichoose k n describes choosing a multiset of n items from a type of size k, i.e., choosing with replacement.

    Equations
    Instances For
      @[simp]
      theorem Ring.multichoose_zero_right' {R : Type u_1} [AddCommMonoid R] [Pow R ℕ] [BinomialRing R] (r : R) :
      @[simp]
      theorem Ring.multichoose_one_right' {R : Type u_1} [AddCommMonoid R] [Pow R ℕ] [BinomialRing R] (r : R) :
      @[simp]
      theorem Ring.ascPochhammer_succ_succ {R : Type u_2} [NonAssocSemiring R] [Pow R ℕ] [NatPowAssoc R] [BinomialRing R] (r : R) (k : ℕ) :
      (ascPochhammer ℕ (k + 1)).smeval (r + 1) = (k + 1).factorial • Ring.multichoose (r + 1) k + (ascPochhammer ℕ (k + 1)).smeval r
      theorem Ring.multichoose_succ_succ {R : Type u_2} [NonAssocSemiring R] [Pow R ℕ] [NatPowAssoc R] [BinomialRing R] (r : R) (k : ℕ) :
      Ring.multichoose (r + 1) (k + 1) = Ring.multichoose r (k + 1) + Ring.multichoose (r + 1) k
      @[simp]
      theorem Polynomial.ascPochhammer_smeval_cast (R : Type u_1) [Semiring R] {S : Type u_2} [NonAssocSemiring S] [Pow S ℕ] [Module R S] [IsScalarTower R S S] [NatPowAssoc S] (x : S) (n : ℕ) :
      (ascPochhammer R n).smeval x = (ascPochhammer ℕ n).smeval x
      theorem Polynomial.descPochhammer_smeval_eq_ascPochhammer {R : Type u_1} [NonAssocRing R] [Pow R ℕ] [NatPowAssoc R] (r : R) (n : ℕ) :
      (descPochhammer ℤ n).smeval r = (ascPochhammer ℕ n).smeval (r - ↑n + 1)
      theorem Polynomial.descPochhammer_smeval_eq_descFactorial {R : Type u_1} [NonAssocRing R] [Pow R ℕ] [NatPowAssoc R] (n : ℕ) (k : ℕ) :
      (descPochhammer ℤ k).smeval ↑n = ↑(n.descFactorial k)
      theorem Polynomial.ascPochhammer_smeval_neg_eq_descPochhammer {R : Type u_1} [NonAssocRing R] [Pow R ℕ] [NatPowAssoc R] (r : R) (k : ℕ) :
      (ascPochhammer ℕ k).smeval (-r) = (-1) ^ k * (descPochhammer ℤ k).smeval r
      Equations
      • One or more equations did not get rendered due to their size.
      def Int.multichoose (n : ℤ) (k : ℕ) :

      The multichoose function for integers.

      Equations
      Instances For
        Equations
        noncomputable instance instBinomialRingOfModuleNNRat {R : Type u_1} [AddCommMonoid R] [Module ℚ≥0 R] [Pow R ℕ] :
        Equations
        • instBinomialRingOfModuleNNRat = { nsmul_right_injective := ⋯, multichoose := fun (r : R) (n : ℕ) => (↑n.factorial)⁻¹ • (ascPochhammer ℕ n).smeval r, factorial_nsmul_multichoose := ⋯ }
        @[simp]
        theorem Ring.smeval_ascPochhammer_self_neg (n : ℕ) :
        (ascPochhammer ℕ n).smeval (-↑n) = (-1) ^ n * ↑n.factorial
        @[simp]
        theorem Ring.smeval_ascPochhammer_succ_neg (n : ℕ) :
        (ascPochhammer ℕ (n + 1)).smeval (-↑n) = 0
        theorem Ring.smeval_ascPochhammer_neg_add (n : ℕ) (k : ℕ) :
        (ascPochhammer ℕ (n + k + 1)).smeval (-↑n) = 0
        @[simp]
        theorem Ring.smeval_ascPochhammer_neg_of_lt {n : ℕ} {k : ℕ} (h : n < k) :
        (ascPochhammer ℕ k).smeval (-↑n) = 0
        theorem Ring.smeval_ascPochhammer_nat_cast {R : Type u_1} [NonAssocRing R] [Pow R ℕ] [NatPowAssoc R] (n : ℕ) (k : ℕ) :
        (ascPochhammer ℕ k).smeval ↑n = ↑((ascPochhammer ℕ k).smeval n)
        @[simp]
        theorem Ring.multichoose_neg_succ (n : ℕ) :
        Ring.multichoose (-↑n) (n + 1) = 0
        theorem Ring.multichoose_neg_add (n : ℕ) (k : ℕ) :
        Ring.multichoose (-↑n) (n + k + 1) = 0
        @[simp]
        theorem Ring.multichoose_neg_of_lt (n : ℕ) (k : ℕ) (h : n < k) :
        Ring.multichoose (-↑n) k = 0
        theorem Ring.smeval_ascPochhammer_int_ofNat {R : Type u_1} [NonAssocRing R] [Pow R ℕ] [NatPowAssoc R] (r : R) (n : ℕ) :
        (ascPochhammer ℤ n).smeval r = (ascPochhammer ℕ n).smeval r
        def Ring.choose {R : Type u_1} [AddCommGroupWithOne R] [Pow R ℕ] [BinomialRing R] (r : R) (n : ℕ) :
        R

        The binomial coefficient choose r n generalizes the natural number choose function, interpreted in terms of choosing without replacement.

        Equations
        Instances For
          theorem Ring.descPochhammer_eq_factorial_smul_choose {R : Type u_1} [NonAssocRing R] [Pow R ℕ] [BinomialRing R] [NatPowAssoc R] (r : R) (n : ℕ) :
          (descPochhammer ℤ n).smeval r = n.factorial • Ring.choose r n
          theorem Ring.choose_natCast {R : Type u_1} [NonAssocRing R] [Pow R ℕ] [BinomialRing R] [NatPowAssoc R] (n : ℕ) (k : ℕ) :
          Ring.choose (↑n) k = ↑(n.choose k)
          @[deprecated Ring.choose_natCast]
          theorem Ring.choose_nat_cast {R : Type u_1} [NonAssocRing R] [Pow R ℕ] [BinomialRing R] [NatPowAssoc R] (n : ℕ) (k : ℕ) :
          Ring.choose (↑n) k = ↑(n.choose k)

          Alias of Ring.choose_natCast.