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 nS} (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 nS) :

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

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

            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 nS) (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 nS) (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 nS) (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 nS) (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
              noncomputable def monicRescaleOf (T : Polynomial ) (d : ) (c : ) :

              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.