Zulip Chat Archive

Stream: Is there code for X?

Topic: linear maps of polynomials


Heather Macbeth (Jan 13 2022 at 20:08):

I would like to break the abstraction barrier between polynomials and finsupp ℕ briefly for the following purpose: I have a linear map from finsupp ℕ R to finsupp ℕ R and would like to interpret it as a linear map from polynomial R to polynomial R. Is there a good way to do this?

Yaël Dillies (Jan 13 2022 at 20:10):

This sounds like you need the "identity" equivalences between the type and its synonym, in the vein of docs#order_dual.to_dual, docs#order_dual.of_dual, docs#to_lex, docs#of_lex.

Heather Macbeth (Jan 13 2022 at 20:11):

That's so ugly, though! In my opinion what ought to exist is some kind of constructor for linear maps to/from polynomials, right before polynomial is marked irreducible. I haven't thought through the exact right form though, so I wondered if someone else had.

Adam Topaz (Jan 13 2022 at 20:12):

I'm surprised we don't have a finsupp version of docs#polynomial.coeff

Adam Topaz (Jan 13 2022 at 20:12):

Or a polynomial.of_finsupp.

Adam Topaz (Jan 13 2022 at 20:13):

Ah we do have docs#polynomial.to_finsupp (which is the field in the structure defining a polynomial)

Heather Macbeth (Jan 13 2022 at 20:13):

Even that, though, is not a linear map.

Adam Topaz (Jan 13 2022 at 20:14):

Right.

Adam Topaz (Jan 13 2022 at 20:14):

We do have docs#polynomial.basis_monomials so you could use that to obtain the linear iso.

Heather Macbeth (Jan 13 2022 at 20:16):

I wonder if @Gabriel Ebner has thought about this, he was behind the irreducible refactor I think.

Adam Topaz (Jan 13 2022 at 20:17):

import ring_theory.mv_polynomial.basic

variables (R : Type*) [comm_ring R]

noncomputable
example : polynomial R ≃ₗ[R]  →₀ R :=
(polynomial.basis_monomials _).repr

Heather Macbeth (Jan 13 2022 at 20:19):

But it should also work to just define polynomial.to_finsupp.linear_map as linear_equiv.refl, before the irreducible attribute is introduced.

Yaël Dillies (Jan 13 2022 at 20:19):

... which is exactly what I proposed

Eric Wieser (Jan 13 2022 at 20:19):

polynomial isn't irreducible, it's a structure

Adam Topaz (Jan 13 2022 at 20:20):

Ah, we have docs#polynomial.to_finsupp_iso_alg

Heather Macbeth (Jan 13 2022 at 20:20):

Yaël Dillies said:

... which is exactly what I proposed

But what I'm saying is that I hate it :)

Eric Wieser (Jan 13 2022 at 20:20):

We do have polynomial.of_finsupp, it's the constructor of the src#polynomial structure

Adam Topaz (Jan 13 2022 at 20:21):

The docstring of to_finsupp_iso_alg is

Algebra isomorphism between polynomial R and add_monoid_algebra R ℕ. This is just an implementation detail, but it can be useful to transfer results from finsupp to polynomials.

Heather Macbeth (Jan 13 2022 at 20:21):

We have our general mathlib principle never to use an equiv if you can do it for a morphism ... it'd be great if there were a more functorial version here

Heather Macbeth (Jan 13 2022 at 20:21):

so "lift" rather than "transport"

Eric Wieser (Jan 13 2022 at 20:22):

It seems that doc-gen doesn't record constructor names which is why you couldn't find of_finsupp


Last updated: Dec 20 2023 at 11:08 UTC