Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

[Merged by Bors] - feat(ring_theory/polynomial/vieta): add version of prod_X_add_C_eq_sum_esymm for multiset #15008

Closed
wants to merge 101 commits into from

Conversation

xroblot
Copy link
Collaborator

@xroblot xroblot commented Jun 27, 2022

This is a proof of Vieta's formula for multiset:

lemma multiset.prod_X_add_C_eq_sum_esymm (s : multiset R) :
  (s.map (λ r, polynomial.X  + polynomial.C r)).prod 
 = ∑ j in finset.range (s.card + 1), (polynomial.C (s.esymm j) * polynomial.X ^ (s.card - j))

where

def multiset.esymm (s : multiset R) (n : ℕ) : R := ((s.powerset_len n).map multiset.prod).sum

From this, we deduce the proof of the formula for mv_polynomial:

lemma prod_C_add_X_eq_sum_esymm :
  (∏ i : σ, (polynomial.X + polynomial.C (X i)) : polynomial (mv_polynomial σ R) )=
  ∑ j in range (card σ + 1),  (polynomial.C (esymm σ R j) * polynomial.X ^ (card σ - j))

with

def mv_polynomial.esymm (n : ℕ) : mv_polynomial σ R := ∑ t in powerset_len n univ, ∏ i in t, X i

It is better to go in this direction since there does not seem to be a natural way to prove the multiset version from the mv_polynomial version due to the difficulty to enumerate the elements of a multiset with a fintype, see this Zulip thread and the discussion from #14908.

We prove, as suggested in #14908 , that mv_polynomial.esymm is obtained by specialising multiset.esymm. However, we do not refactor the results of ring_theory/polynomial/symmetric in terms of multiset.esymm.

From flt-regular


Open in Gitpod

@xroblot xroblot added the WIP Work in progress label Jun 27, 2022
@xroblot xroblot changed the title Xfr vieta feat(ring_theory/polynomial/vieta): add version of prod_X_add_C_eq_sum_esymm for multiset Jun 27, 2022
xroblot added 2 commits June 30, 2022 12:29
Clean some proofs & names
Change from C + X to X + C
@xroblot xroblot removed the WIP Work in progress label Jun 30, 2022
@xroblot xroblot marked this pull request as ready for review June 30, 2022 13:25
@xroblot xroblot added the awaiting-review The author would like community review of the PR label Jun 30, 2022
@mathlib-dependent-issues-bot mathlib-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Aug 11, 2022
@jcommelin jcommelin added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Aug 15, 2022
@jcommelin
Copy link
Member

It seems to me that some of the preliminary stuff was already added in other PRs.

The ring_theory/* looks good to me.

bors d+

@bors
Copy link

bors bot commented Aug 15, 2022

✌️ xroblot can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@github-actions github-actions bot added the delegated The PR author may merge after reviewing final suggestions. label Aug 15, 2022
@xroblot
Copy link
Collaborator Author

xroblot commented Aug 15, 2022

bors r+

@bors
Copy link

bors bot commented Aug 15, 2022

Canceled.

@eric-wieser
Copy link
Member

bors r+

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-author A reviewer has asked the author a question or requested changes labels Aug 15, 2022
bors bot pushed a commit that referenced this pull request Aug 16, 2022
…m_esymm for multiset (#15008)

This is a proof of Vieta's formula for `multiset`: 
```lean
lemma multiset.prod_X_add_C_eq_sum_esymm (s : multiset R) :
  (s.map (λ r, polynomial.X  + polynomial.C r)).prod 
 = ∑ j in finset.range (s.card + 1), (polynomial.C (s.esymm j) * polynomial.X ^ (s.card - j))
```
where
```lean
def multiset.esymm (s : multiset R) (n : ℕ) : R := ((s.powerset_len n).map multiset.prod).sum
```
From this, we deduce the proof of the  formula for `mv_polynomial`:
```lean
lemma prod_C_add_X_eq_sum_esymm :
  (∏ i : σ, (polynomial.X + polynomial.C (X i)) : polynomial (mv_polynomial σ R) )=
  ∑ j in range (card σ + 1),  (polynomial.C (esymm σ R j) * polynomial.X ^ (card σ - j))
```
with 
```lean
def mv_polynomial.esymm (n : ℕ) : mv_polynomial σ R := ∑ t in powerset_len n univ, ∏ i in t, X i
```

It is better to go in this direction since there does not seem to be a natural way to prove the `multiset` version from the `mv_polynomial` version due to the difficulty to enumerate the elements of a `multiset` with a `fintype`, see this [Zulip thread](https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/.E2.9C.94.20fintype.20enumerating.20a.20multiset) and the discussion from #14908.

We prove, as suggested in [#14908](#14908 (comment)) , that `mv_polynomial.esymm` is obtained by specialising `multiset.esymm`. However, we do not refactor the results of  `ring_theory/polynomial/symmetric` in terms of `multiset.esymm`.

From flt-regular
@bors
Copy link

bors bot commented Aug 16, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(ring_theory/polynomial/vieta): add version of prod_X_add_C_eq_sum_esymm for multiset [Merged by Bors] - feat(ring_theory/polynomial/vieta): add version of prod_X_add_C_eq_sum_esymm for multiset Aug 16, 2022
@bors bors bot closed this Aug 16, 2022
@bors bors bot deleted the xfr_vieta branch August 16, 2022 06:42
@alreadydone alreadydone restored the xfr_vieta branch August 16, 2022 14:55
@alreadydone alreadydone deleted the xfr_vieta branch August 17, 2022 00:15
bors bot pushed a commit that referenced this pull request Aug 20, 2022
….roots` (#14908)

Specialize `multiset.prod_X_sub_C_coeff` to the root multiset of a split polynomial over an integral domain to derive the familiar Vieta's formula; update *undergrad.yaml*.

Make various stylistic improvements to *polynomial/vieta.lean*: most notably, `open polynomial` to be able to omit the prefix in `polynomial.X` and `polynomial.C`. Instead, write `mv_polynomial.X` with the prefix because it's less frequent.

Prove miscellaneous lemmas `list.prod_map_neg`, `multiset.prod_map_neg`, `list.map_nth_le` and `multiset.length_to_list`, which are remnants of a previous approach to prove `polynomial.vieta` superseded by #15008. See below/#14908 for the original motivation for introducing them.
bors bot pushed a commit that referenced this pull request Sep 19, 2022
… version of `prod_X_sub_C_coeff` (#16424)

In #15008, [`prod_X_add_C_coeff`](https://github.com/leanprover-community/mathlib/pull/15008/files#diff-08ead07a5e3b20f4db52e932b309a2ff767e486e4a0bf7d90b5520d25d95dc57L79-L81) was changed to use `multiset.esymm` in its RHS, which is defined in terms of `multiset.powerset_len` and not defeq to the original version which involves `finset.powerset_len` instead. This PR restores the `finset` version by introducing `finset.esymm_map_val`, a generalized version of `mv_polynomial.esymm_eq_multiset_esymm` (this lemma is renamed from `mv_polynomial.esymm_eq_multiset.esymm` to better conform with mathlib convention).

Co-authored-by: negiizhao <[email protected]>

[Zulip](https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/Help.20with.20mv_polynomial/near/297702031)



Co-authored-by: Junyan Xu <[email protected]>
bors bot pushed a commit that referenced this pull request Sep 19, 2022
… version of `prod_X_sub_C_coeff` (#16424)

In #15008, [`prod_X_add_C_coeff`](https://github.com/leanprover-community/mathlib/pull/15008/files#diff-08ead07a5e3b20f4db52e932b309a2ff767e486e4a0bf7d90b5520d25d95dc57L79-L81) was changed to use `multiset.esymm` in its RHS, which is defined in terms of `multiset.powerset_len` and not defeq to the original version which involves `finset.powerset_len` instead. This PR restores the `finset` version by introducing `finset.esymm_map_val`, a generalized version of `mv_polynomial.esymm_eq_multiset_esymm` (this lemma is renamed from `mv_polynomial.esymm_eq_multiset.esymm` to better conform with mathlib convention).

Co-authored-by: negiizhao <[email protected]>

[Zulip](https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/Help.20with.20mv_polynomial/near/297702031)



Co-authored-by: Junyan Xu <[email protected]>
b-mehta pushed a commit that referenced this pull request Sep 21, 2022
… version of `prod_X_sub_C_coeff` (#16424)

In #15008, [`prod_X_add_C_coeff`](https://github.com/leanprover-community/mathlib/pull/15008/files#diff-08ead07a5e3b20f4db52e932b309a2ff767e486e4a0bf7d90b5520d25d95dc57L79-L81) was changed to use `multiset.esymm` in its RHS, which is defined in terms of `multiset.powerset_len` and not defeq to the original version which involves `finset.powerset_len` instead. This PR restores the `finset` version by introducing `finset.esymm_map_val`, a generalized version of `mv_polynomial.esymm_eq_multiset_esymm` (this lemma is renamed from `mv_polynomial.esymm_eq_multiset.esymm` to better conform with mathlib convention).

Co-authored-by: negiizhao <[email protected]>

[Zulip](https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/Help.20with.20mv_polynomial/near/297702031)



Co-authored-by: Junyan Xu <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
delegated The PR author may merge after reviewing final suggestions. ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) t-algebra Algebra (groups, rings, fields etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants