Zulip Chat Archive

Stream: Is there code for X?

Topic: X_i divides f if f=0 when X_i=0


Kevin Buzzard (Mar 04 2023 at 14:59):

The students at Imperial working on Newton's symmetric function theorem asked me on Thursday whether we had something like this:

import data.mv_polynomial.comm_ring

lemma mv_polynomial.dvd_iff (σ : Type*)  [fintype σ] [decidable_eq σ] (R : Type*) [comm_ring R]
  (p : mv_polynomial σ R) (i : σ) :
  mv_polynomial.eval₂ mv_polynomial.C (λ t, if t = i then 0 else mv_polynomial.X t) p = 0 
  mv_polynomial.X i  p :=
begin
  sorry
end

I've had a look through the mv_polynomial API and I can't find anything which looks helpful. A result of this nature is available for single-variable polynomials but it would probably be quite a kerfuffle to apply it. I must confess I am half-skeptical that this result really is in a sufficiently useful form for it to be usable elsewhere, but at the end of the day we should still be able to prove it relatively straightforwardly. The paper proof is something like: "write p=r+Xiqp=r+X_iq where rr is the monomials in pp which don't mention XiX_i, and now show that setting Xi=0X_i=0 in pp just gives you qq, so q=0q=0". Do we have the decomposition of a multivariable polynomial pp as a polynomial in one of its variables, or even just p=r+Xiqp=r+X_iq? It seems to me that /ₘ only exists for single-variable polynomials...

Eric Wieser (Mar 04 2023 at 15:25):

I think "write p=r+Xiqp = r + X_i q" is something like docs#polynomial.div_X?

Eric Wieser (Mar 04 2023 at 15:26):

Ah, I tried to do this in #15905

Eric Wieser (Mar 04 2023 at 15:28):

The result there is

lemma div_monomial_add_mod_monomial_single (x : mv_polynomial σ R) (i : σ) :
  X i * div_monomial (finsupp.single i 1) x + mod_monomial (finsupp.single i 1) x = x :=
x.div_of_add_mod_of _

Kevin Buzzard (Mar 04 2023 at 15:37):

Eric Wieser said:

I think "write p=r+Xiqp = r + X_i q" is something like docs#polynomial.div_X?

yeah exactly but it's mv_polynomials, hence the problems.

Kevin Buzzard (Mar 04 2023 at 15:38):

Eric Wieser said:

Ah, I tried to do this in https://github.com/leanprover-community/mathlib4/pull/2632

I think you might have posted the wrong URL?

Eric Wieser (Mar 04 2023 at 15:41):

Oops, #15905

Kevin Buzzard (Mar 04 2023 at 15:42):

Yes, a combination of div_monomial_add_mod_monomial_single and an assertion of the form mod_monomial (finsupp.single i 1) p = mv_polynomial.eval₂ mv_polynomial.C (λ t, if t = i then 0 else mv_polynomial.X t) p will do it. It's annoying that this sort of thing is still such a struggle.

Eric Wieser (Mar 04 2023 at 15:43):

I think I just forgot about that PR because of my internship

Kevin Buzzard (Mar 04 2023 at 15:44):

Kevin Buzzard said:

an assertion of the form mod_monomial (finsupp.single i 1) p = mv_polynomial.eval₂ mv_polynomial.C (λ t, if t = i then 0 else mv_polynomial.X t) p

This is also equal to (finset.filter (λ (f : σ →₀ ℕ), ⇑f i = 0) p.support).sum (λ (x : σ →₀ ℕ), ⇑(mv_polynomial.monomial x) (mv_polynomial.coeff x p))

Eric Wieser (Mar 04 2023 at 15:45):

@Damiano Testa had a related PR #15983, and I think we were half way through working out the set of assumptions that worked for both applications

Eric Wieser (Mar 22 2023 at 12:40):

#15905 is now merged, docs#mv_polynomial.div_monomial_add_mod_monomial_single will exist soon


Last updated: Dec 20 2023 at 11:08 UTC