Zulip Chat Archive
Stream: Is there code for X?
Topic: polynomial.eval_prod for multiset
Riccardo Brasca (Nov 04 2021 at 13:55):
I don't find the analogue of docs#polynomial.eval_prod for multiset. Is this my fault or it is really missing?
Eric Wieser (Nov 04 2021 at 13:58):
I'd say its not there, else the version you link to would be a one line proof as multiset.eval_prod _
Riccardo Brasca (Nov 04 2021 at 13:58):
Let's prove it :)
Riccardo Brasca (Nov 04 2021 at 14:16):
Well, it's not there but the statement is longer than the proof :grinning:
import data.polynomial.eval
universes u v
namespace polynomial
open multiset
lemma eval_prod_multiset {R : Type u} [comm_semiring R] {ι : Type v} (s : multiset ι)
(p : ι → polynomial R) (x : R) : eval x (multiset.map p s).prod =
(multiset.map (λ i, eval x (p i)) s).prod :=
multiset.induction_on s (by simp) (λ _ _ h, by simp [h])
end polynomial
Yury G. Kudryashov (Nov 04 2021 at 14:42):
Or you can use (polynomial.eval_ring_hom x).map_multiset_prod
.
Riccardo Brasca (Nov 04 2021 at 14:56):
Nice!
Last updated: Dec 20 2023 at 11:08 UTC