Zulip Chat Archive

Stream: Is there code for X?

Topic: A multivariate polynomial is the sum of its monomials


Yaël Dillies (Jan 24 2025 at 10:42):

Do we have the fact that p : MvPolynomial σ R is equal to its sum of monomials p.sum (fun i ↦ monomial i)? The corresponding statement for p : R[X] is docs#Polynomial.sum_monomial_eq, but docs#MvPolynomial.sum_monomial_eq is a completely different statement...

Yaël Dillies (Jan 24 2025 at 10:42):

cc @Junyan Xu since this was prompted by your comment here: https://github.com/leanprover-community/mathlib4/pull/20989/files#r1927835697

Ruben Van de Velde (Jan 24 2025 at 10:49):

Doesn't seem like it. (Why is that using Finsupp.sum?)

Edward van de Meent (Jan 24 2025 at 10:50):

(because there is no Polynomial.sum, likely?)

Yaël Dillies (Jan 24 2025 at 10:50):

Aha! docs#MvPolynomial.as_sum and docs#MvPolynomial.support_sum_monomial_coeff it is

Yaël Dillies (Jan 24 2025 at 10:51):

Ruben Van de Velde said:

Why is that using Finsupp.sum?

I was following whatever Polynomial.sum_monomial_eq was doing

Yaël Dillies (Jan 24 2025 at 10:51):

Would be good to make names more consistent around here

Ruben Van de Velde (Jan 24 2025 at 10:53):

Which is also the reverse direction of docs#MvPolynomial.support_sum_monomial_coeff just above

Ruben Van de Velde (Jan 24 2025 at 10:53):

(We do have Polynomial.sum, but apparently not MvPolynomial.sum)

Eric Wieser (Jan 24 2025 at 11:00):

Finsupp.sum is the name of MvPolynomial.sum

Eric Wieser (Jan 24 2025 at 11:02):

I claim the inconsistency here is because we have:

structure Finsupp where ...

def AddMonoidAlgebra := Finsupp

structure Polynomial where toFinsupp : AddMonoidAlgebra

def MvPolynomial := AddMonoidAlgebra

but we ought to have

structure Finsupp where ...

structure AddMonoidAlgebra where toFinsupp : Finsupp

abbrev Polynomial := AddMonoidAlgebra

abbrev MvPolynomial := AddMonoidAlgebra

Junyan Xu (Jan 24 2025 at 11:02):

Yaël Dillies said:

cc Junyan Xu since this was prompted by your comment here: https://github.com/leanprover-community/mathlib4/pull/20989/files#r1927835697

Do you have to write it as a sum? Could you not use some induction principle?

Junyan Xu (Jan 24 2025 at 11:03):

Maybe you should show coeffsIn is the span of elements of the form m * X^k


Last updated: May 02 2025 at 03:31 UTC