-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - chore(RingTheory/Polynomial/Basic): add lemma aeval_natDegree_le #10659
Conversation
This lemma is used in the proof of existence of Cartan subalgebras
rw [MvPolynomial.aeval_def, MvPolynomial.eval₂] | ||
apply (Polynomial.natDegree_sum_le _ _).trans | ||
apply Finset.sup_le | ||
intro d hd | ||
simp_rw [Function.comp_apply, ← C_eq_algebraMap] | ||
apply (Polynomial.natDegree_C_mul_le _ _).trans | ||
apply (Polynomial.natDegree_prod_le _ _).trans | ||
have : ∑ i in d.support, (d i) * n ≤ m * n := by | ||
rw [← Finset.sum_mul] | ||
apply mul_le_mul' (.trans _ hF) le_rfl | ||
rw [MvPolynomial.totalDegree] | ||
exact Finset.le_sup_of_le hd le_rfl | ||
apply (Finset.sum_le_sum _).trans this | ||
rintro i - | ||
apply Polynomial.natDegree_pow_le.trans | ||
exact mul_le_mul' le_rfl (hf i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
golf (untested)
rw [MvPolynomial.aeval_def, MvPolynomial.eval₂] | |
apply (Polynomial.natDegree_sum_le _ _).trans | |
apply Finset.sup_le | |
intro d hd | |
simp_rw [Function.comp_apply, ← C_eq_algebraMap] | |
apply (Polynomial.natDegree_C_mul_le _ _).trans | |
apply (Polynomial.natDegree_prod_le _ _).trans | |
have : ∑ i in d.support, (d i) * n ≤ m * n := by | |
rw [← Finset.sum_mul] | |
apply mul_le_mul' (.trans _ hF) le_rfl | |
rw [MvPolynomial.totalDegree] | |
exact Finset.le_sup_of_le hd le_rfl | |
apply (Finset.sum_le_sum _).trans this | |
rintro i - | |
apply Polynomial.natDegree_pow_le.trans | |
exact mul_le_mul' le_rfl (hf i) | |
rw [aeval_def, eval₂] | |
refine (natDegree_sum_le _ _).trans <| Finset.sup_le fun d hd ↦ ?_ | |
simp_rw [Function.comp_apply, ← C_eq_algebraMap] | |
refine (natDegree_C_mul_le _ _).trans <| (natDegree_prod_le _ _).trans <| | |
(Finset.sum_le_sum fun i _ ↦ natDegree_pow_le.trans (mul_le_mul' le_rfl (hf i))).trans ?_ | |
rw [← Finset.sum_mul] | |
exact mul_le_mul' (.trans (Finset.le_sup_of_le hd le_rfl) hF) le_rfl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not golf quite this much (although some of it is probably okay). For instance, the original with the separate .trans
applications is much more readable.
apply (Polynomial.natDegree_C_mul_le _ _).trans
apply (Polynomial.natDegree_prod_le _ _).trans
Arguably, with this many .trans
applications (there's one other), this should be a calc
block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The calc proof looks like this. I'm not sure it actually increases readability.
rw [MvPolynomial.aeval_def, MvPolynomial.eval₂] | |
apply (Polynomial.natDegree_sum_le _ _).trans | |
apply Finset.sup_le | |
intro d hd | |
simp_rw [Function.comp_apply, ← C_eq_algebraMap] | |
apply (Polynomial.natDegree_C_mul_le _ _).trans | |
apply (Polynomial.natDegree_prod_le _ _).trans | |
have : ∑ i in d.support, (d i) * n ≤ m * n := by | |
rw [← Finset.sum_mul] | |
apply mul_le_mul' (.trans _ hF) le_rfl | |
rw [MvPolynomial.totalDegree] | |
exact Finset.le_sup_of_le hd le_rfl | |
apply (Finset.sum_le_sum _).trans this | |
rintro i - | |
apply Polynomial.natDegree_pow_le.trans | |
exact mul_le_mul' le_rfl (hf i) | |
calc natDegree ((aeval f) F) | |
= natDegree (F.sum fun s a ↦ (algebraMap R R[X]) a * s.prod fun n e ↦ f n ^ e) := by | |
rw [MvPolynomial.aeval_def, MvPolynomial.eval₂] | |
_ ≤ F.support.fold max 0 | |
(natDegree ∘ fun i ↦ ((algebraMap R R[X]) (F.coeff i) * i.prod fun n e ↦ f n ^ e)) := | |
Polynomial.natDegree_sum_le _ _ | |
_ ≤ m * n := Finset.sup_le ?_ | |
intro d hd | |
have aux : ∑ i in d.support, (d i) * n ≤ m * n := by | |
rw [← Finset.sum_mul] | |
apply mul_le_mul' (.trans _ hF) le_rfl | |
rw [MvPolynomial.totalDegree] | |
exact Finset.le_sup_of_le hd le_rfl | |
calc natDegree ((algebraMap R R[X]) (coeff d F) * d.prod fun n e ↦ f n ^ e) | |
= natDegree (Polynomial.C (coeff d F) * d.prod fun n e ↦ f n ^ e) := by rw [C_eq_algebraMap] | |
_ ≤ natDegree (Finsupp.prod d fun n e ↦ f n ^ e) := Polynomial.natDegree_C_mul_le _ _ | |
_ ≤ ∑ i in d.support, natDegree (f i ^ (d i)) := Polynomial.natDegree_prod_le _ _ | |
_ ≤ m * n := (Finset.sum_le_sum ?_).trans aux | |
rintro i - | |
calc natDegree (f i ^ d i) | |
≤ d i * natDegree (f i) := Polynomial.natDegree_pow_le | |
_ ≤ d i * n := mul_le_mul' le_rfl (hf i) |
Consider a bors d+ |
✌️ jcommelin can now approve this pull request. To approve and merge a pull request, simply reply with |
We seem to have several reasonable proofs none of which is obviously superior. More importantly, the statement is good. bors merge |
Pull request successfully merged into master. Build succeeded: |
This lemma is used in the proof of existence of Cartan subalgebras