Documentation

LeanPool.IsTranscendentalPi.SubsetSumPolynomial

Subset-sum polynomial #

The polynomial ∏ x ∈ s, (X - C x) attached to a multiset s and its factorization according to the vanishing subset sums, used to track integer divisibility in Niven's argument.

noncomputable def polyOfMultiset {S : Type u_1} [CommRing S] (s : Multiset S) :

The polynomial ∏ x ∈ s, (X - C x) associated to a multiset s.

Equations
Instances For

    ∏_{a ∈ s} (X - a) = X^{#{a ∈ s, a = 0}} ∏_{a ∈ s, a ≠ 0} (X - a).

    noncomputable def varsFin (n : ℕ) :

    The multiset {X₀, …, Xₙ₋₁} inside ℤ[X₀, …, Xₙ₋₁].

    Equations
    Instances For
      noncomputable def polyOfSubsetSums {S : Type u_1} [CommRing S] (s : Multiset S) :

      The polynomial whose roots are { ∑_{x ∈ t} x | t ⊆ s } for a given multiset s.

      Equations
      Instances For
        noncomputable def polyOfNonzeroSubsetSums {S : Type u_1} [CommRing S] [DecidableEq S] (s : Multiset S) :

        The polynomial whose roots are { ∑_{x ∈ t} x ≠ 0 | t ⊆ s } for a given multiset s.

        Equations
        Instances For

          The polynomial whose roots are { ∑_{x ∈ t} x ≠ 0 | t ⊆ s } for a given multiset s is monic.

          theorem ne_zero_of_nonzeroSubsetSums_eq_valuesFin {S : Type u_1} [AddCommMonoid S] [DecidableEq S] {s : Multiset S} {n : ℕ} {a : Fin n → S} (ha : nonzeroSubsetSums s = valuesFin a) (i : Fin n) :
          a i ≠ 0

          If { ∑_{x ∈ t} x ≠ 0 | t ⊆ s } is indexed by a : Fin n → S, then every a i is nonzero.

          noncomputable def esymmVarsFinSubsetSums (n r : ℕ) :

          The r-th elementary symmetric polynomial in { ∑_{i ∈ I} Xᵢ | I ⊆ {0, …, n-1} }.

          Equations
          Instances For
            theorem powerset_map_eq {α : Type u_1} {β : Type u_2} (f : α → β) (s : Multiset α) :

            Taking powersets commutes with mapping a function over a multiset.

            The multiset {X₀, …, Xₙ₋₁} is invariant under permutation of the variables.

            The multiset of subset sums of X₀, …, Xₙ₋₁ is invariant under permutation of the variables.

            Renaming variables commutes with the elementary symmetric polynomial of a multiset.

            The r-th elementary symmetric polynomial in { ∑_{i ∈ I} Xᵢ | I ⊆ {0, …, n-1} } is symmetric.

            theorem aeval_varsFin {S : Type u_1} [CommRing S] (n : ℕ) (b : Fin n → S) :

            Evaluating {X₀, …, Xₙ₋₁} at b gives the multiset {b₀, …, bₙ₋₁}.

            theorem aeval_subsetSums {S : Type u_1} [CommRing S] (n : ℕ) (b : Fin n → S) :

            Evaluating the subset sums of {X₀, …, Xₙ₋₁} at b is the subset sums of {b₀, …, bₙ₋₁}.

            Evaluating the r-th elementary symmetric polynomial in { ∑_{i ∈ I} Xᵢ | I ⊆ {0, …, n-1} } at b gives the r-th elementary symmetric polynomial in the subset sums of {b₀, …, bₙ₋₁}.

            theorem coeff_polyOfSubsetSums {S : Type u_1} [CommRing S] (n : ℕ) (b : Fin n → S) (k : ℕ) (hk : k ≤ (subsetSums (valuesFin b)).card) :

            The k-th coefficient of the polynomial whose roots are { ∑_{x ∈ t} x | t ⊆ b } is given by an elementary symmetric polynomial in { ∑_{i ∈ I} Xᵢ | I ⊆ {0, …, n-1} } at b.

            theorem coeff_polyOfSubsetSums_as_coeff_poly {R : Type u_1} {S : Type u_2} [CommRing R] [Field S] [Algebra R S] [IsAlgClosed S] {n : ℕ} (B : Polynomial R) (b : Fin n → S) (hmonic : B.Monic) (hroots : B.aroots S = valuesFin b) {k : ℕ} (hk : k ≤ (subsetSums (valuesFin b)).card) :
            ∃ (Q : MvPolynomial (Fin n) ℤ), (polyOfSubsetSums (valuesFin b)).coeff k = (algebraMap R S) ((MvPolynomial.aeval fun (i : Fin n) => (-1) ^ (↑i + 1) * B.coeff (n - (↑i + 1))) Q)

            If B is monic with roots b₀, …, bₙ₋₁, then the coefficients of the polynomial whose roots are { ∑_{x ∈ t} x | t ⊆ b } are polynomials in the coefficients of B.

            theorem coeff_polyOfNonzeroSubsetSums_as_coeff_poly {R : Type u_1} {S : Type u_2} [CommRing R] [Field S] [Algebra R S] [IsAlgClosed S] [DecidableEq S] {n k : ℕ} (B : Polynomial R) (b : Fin n → S) (hmonic : B.Monic) (hroots : B.aroots S = valuesFin b) (hk : k + Multiset.count 0 (subsetSums (valuesFin b)) ≤ (subsetSums (valuesFin b)).card) :
            ∃ (Q : MvPolynomial (Fin n) ℤ), (polyOfNonzeroSubsetSums (valuesFin b)).coeff k = (algebraMap R S) ((MvPolynomial.aeval fun (i : Fin n) => (-1) ^ (↑i + 1) * B.coeff (n - (↑i + 1))) Q)

            If B is monic with roots b₀, …, bₙ₋₁, then the coefficients of the polynomial whose roots are { ∑_{x ∈ t} x ≠ 0 | t ⊆ b } are polynomials in the coefficients of B.

            theorem polyOfNonzeroSubsetSums_as_poly {R : Type u_1} {S : Type u_2} [CommRing R] [Field S] [Algebra R S] [IsAlgClosed S] [DecidableEq S] {n : ℕ} (B : Polynomial R) (a : Fin n → S) (hmonic : B.Monic) (hroots : B.aroots S = valuesFin a) :

            From a monic polynomial B with roots a₀, …, aₙ₋₁, one obtains a polynomial over the base ring whose image has roots the nonzero subset sums of the a_i.

            theorem ClearDenominatorOf (T' : Polynomial ℚ) :
            ∃ (T : Polynomial ℤ) (c : ℤ), c ≠ 0 ∧ Polynomial.map (algebraMap ℤ ℚ) T = c • T'

            Clearing denominators for a polynomial over ℚ: every rational polynomial is a nonzero integer multiple of the image of some polynomial over ℤ.

            def monicRescaleCoeff (T : Polynomial ℤ) (d : ℕ) (c : ℤ) (k : ℕ) :

            The rescaled coefficient used to build the monic degree d polynomial attached to T. Precisely, they are cᵈ⁻¹⁻ᵏ Tₖ for k < d, = 1 for k = d, and = 0 for k > d

            Equations
            Instances For

              The monic degree d polynomial obtained by rescaling the lower coefficients of T. Precisely, it is the polynomial Xᵈ + ∑ₖ₌₀ᵈ⁻¹ cᵈ⁻¹⁻ᵏ Tₖ Xᵏ

              Equations
              Instances For
                theorem coeff_monicRescaleOf (T : Polynomial ℤ) (d : ℕ) (c : ℤ) (k : ℕ) :

                The coefficients of Xᵈ + ∑ₖ₌₀ᵈ⁻¹ cᵈ⁻¹⁻ᵏ Tₖ Xᵏ.

                Xᵈ + ∑ₖ₌₀ᵈ⁻¹ cᵈ⁻¹⁻ᵏ Tₖ Xᵏ has degree d.

                theorem monic_monicRescaleOf (T : Polynomial ℤ) (d : ℕ) (c : ℤ) :

                Xᵈ + ∑ₖ₌₀ᵈ⁻¹ cᵈ⁻¹⁻ᵏ Tₖ Xᵏ is monic.

                theorem coeff_monicRescaleOf_scaleRoots (T : Polynomial ℤ) (T' : Polynomial ℚ) (d : ℕ) (c : ℤ) (hmonic : T'.Monic) (hd : T'.natDegree = d) (hT : Polynomial.map (algebraMap ℤ ℚ) T = Polynomial.C ↑c * T') (k : ℕ) :

                Coefficients of Xᵈ + ∑ₖ₌₀ᵈ⁻¹ cᵈ⁻¹⁻ᵏ Tₖ Xᵏ correspond to the coefficients of scaleRoots.

                theorem monicRescaleOf_scaleRoots (T : Polynomial ℤ) (T' : Polynomial ℚ) (d : ℕ) (c : ℤ) (hmonic : T'.Monic) (hd : T'.natDegree = d) (hT : Polynomial.map (algebraMap ℤ ℚ) T = Polynomial.C ↑c * T') :

                After mapping to ℚ, the monic rescaling is the scaleRoots of the monic rational polynomial T'.

                theorem aroots_monicRescaleOf (T : Polynomial ℤ) (T' : Polynomial ℚ) (d : ℕ) (c : ℤ) (a : Fin d → ℂ) (hc : c ≠ 0) (hmonic : T'.Monic) (hd : T'.natDegree = d) (hT : Polynomial.map (Int.castRingHom ℚ) T = Polynomial.C ↑c * T') (hroots' : T'.aroots ℂ = valuesFin a) :
                (monicRescaleOf T d c).aroots ℂ = valuesFin fun (j : Fin d) => ↑c * a j

                If T = c T' with T' monic of degree d and roots a₀, …, a_{d-1}, then Xᵈ + ∑ₖ₌₀ᵈ⁻¹ cᵈ⁻¹⁻ᵏ Tₖ Xᵏ is the monic polynomial whose roots are c a₀, …, c a_{d-1}.

                If T' is the polynomial whose roots are { ∑_{x ∈ t} x ≠ 0 | t ⊆ s }, then T' is monic.

                theorem natDegree_of_T' (T' : Polynomial ℚ) (d n : ℕ) (r : Fin d → ℂ) (a : Fin n → ℂ) (hT' : Polynomial.map (algebraMap ℚ ℂ) T' = polyOfNonzeroSubsetSums (valuesFin r)) (ha : nonzeroSubsetSums (valuesFin r) = valuesFin a) :

                If T' is the polynomial whose roots are { ∑_{x ∈ t} x ≠ 0 | t ⊆ s }, then deg(T') is the number of those roots.

                If T' is the polynomial whose roots are { ∑_{x ∈ t} x ≠ 0 | t ⊆ s }, then its roots are exactly that multiset.

                If T' is the polynomial whose roots are { ∑_{x ∈ t} x ≠ 0 | t ⊆ s }, then T'(0) ≠ 0.

                theorem aroots_of_T (T : Polynomial ℤ) (T' : Polynomial ℚ) (c : ℤ) (d n : ℕ) (r : Fin d → ℂ) (a : Fin n → ℂ) (hc : c ≠ 0) (hT : Polynomial.map (Int.castRingHom ℚ) T = c • T') (hT' : Polynomial.map (algebraMap ℚ ℂ) T' = polyOfNonzeroSubsetSums (valuesFin r)) (ha : nonzeroSubsetSums (valuesFin r) = valuesFin a) :

                If T = c • T', and T' is the polynomial whose roots are { ∑_{x ∈ t} x ≠ 0 | t ⊆ s }, then the roots of T are also { ∑_{x ∈ t} x ≠ 0 | t ⊆ s }.

                theorem RescaledOf_nonZero (T : Polynomial ℤ) (T' : Polynomial ℚ) (c : ℤ) (hc : c ≠ 0) (hT' : T' ≠ 0) (hT : Polynomial.map (algebraMap ℤ ℚ) T = Polynomial.C ↑c * T') :
                T ≠ 0

                If c ≠ 0, T' ≠ 0, and c * T' = T ∈ ℤ[X], then T ≠ 0.

                theorem RescaledOf_natDegree (T : Polynomial ℤ) (T' : Polynomial ℚ) (c : ℤ) (hc : c ≠ 0) (hT : Polynomial.map (Int.castRingHom ℚ) T = Polynomial.C ↑c * T') :

                If c ≠ 0 and c * T' = T ∈ ℤ[X], then deg(T) = deg(T').

                theorem RescaledOf_nonZero_at_Zero (T : Polynomial ℤ) (T' : Polynomial ℚ) (c : ℤ) (hc : c ≠ 0) (hT : Polynomial.map (Int.castRingHom ℚ) T = Polynomial.C ↑c * T') (hT'0 : (Polynomial.aeval 0) T' ≠ 0) :

                If T'(0) ≠ 0 and c * T' = T ∈ ℤ[X], then T(0) ≠ 0.

                theorem aeval_zero_ne_zero_of_T (T : Polynomial ℤ) (T' : Polynomial ℚ) (c : ℤ) (d n : ℕ) (r : Fin d → ℂ) (a : Fin n → ℂ) (hc : c ≠ 0) (hT : Polynomial.map (Int.castRingHom ℚ) T = c • T') (hT' : Polynomial.map (algebraMap ℚ ℂ) T' = polyOfNonzeroSubsetSums (valuesFin r)) (ha : nonzeroSubsetSums (valuesFin r) = valuesFin a) :

                If T = c • T', and T' is the polynomial whose roots are { ∑_{x ∈ t} x ≠ 0 | t ⊆ s }, then T(0) ≠ 0.