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 0Function.Injective fun (x : R) => n x

    Scalar multiplication by positive integers is injective

  • multichoose : RR

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