Zulip Chat Archive

Stream: Is there code for X?

Topic: Polynomial divisible by Π(x - μ_i)


giacomo gallina (Mar 22 2024 at 15:21):

I have a polynomial p, and I want to write it as

p=qrp = q \cdot r

where

q(x)=μS(xμ)Sroots(p)q(x) = \prod_{μ \in S} (x - μ) \qquad S \subseteq roots(p)

Is there already some theorem in mathlib that says this? I searched but didn't find it.
And if this isn't in mathlib, how could I prove it? I found Polynomial.mul_div_eq_iff_isRoot, which is similar to what I want, but I'm not sure of how i could use it

Kevin Buzzard (Mar 22 2024 at 15:24):

You can just let SS be empty and let qq be 1.

I think it's better to ask your actual question as a #mwe rather than in informal language.

giacomo gallina (Mar 22 2024 at 15:34):

Sorry, I didn't explain myself properly, I already have S fixed, and would like to get the decomposition. Basically I would like a theorem with this signature:

theorem my_factorization (p : [X]) (S : Multiset ) (hs : S  p.roots) :  r : [X], p = r * Multiset.prod (Multiset.map (fun μ => X - Polynomial.C μ) S)

giacomo gallina (Mar 22 2024 at 15:58):

It would be enough to be able to do a proof by induction on the cardinality of S, but I don't really know how to do that

giacomo gallina (Mar 22 2024 at 16:12):

Ok, I found Multiset.induction, I think I can do it

Jireh Loreaux (Mar 22 2024 at 16:34):

How about docs#Multiset.prod_X_sub_C_dvd_iff_le_roots ?

Jireh Loreaux (Mar 22 2024 at 16:35):

In fact, just:

Jireh Loreaux (Mar 22 2024 at 16:36):

@loogle Multiset.prod, Multiset.map, Polynomial.roots, Polynomial.C

loogle (Mar 22 2024 at 16:36):

:search: Polynomial.roots_multiset_prod_X_sub_C, Polynomial.monic_prod_multiset_X_sub_C, and 10 more

Jireh Loreaux (Mar 22 2024 at 16:36):

It's the 5th hit here.

giacomo gallina (Mar 22 2024 at 16:37):

Thank you so much, I need to learn to use loogle better!

Jireh Loreaux (Mar 22 2024 at 16:39):

Adding one more bit gets the exact hit:

@loogle Multiset.prod, Multiset.map, Polynomial.roots, Polynomial.C, LE.le

loogle (Mar 22 2024 at 16:39):

:search: Multiset.prod_X_sub_C_dvd_iff_le_roots


Last updated: May 02 2025 at 03:31 UTC