-
Notifications
You must be signed in to change notification settings - Fork 297
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] - feat(linear_algebra/affine_space/combination, analysis/convex/combination): basic lemmas about affine combinations, center of mass, centroid #9103
Conversation
…basic lemmas about affine combinations, center of mass, centroid
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.
Very nice!
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.
This is very much needed glue between affine_combination
, finset.center_mass
and finset.centroid
!
Could you also add this lemma? I feel like it belongs in this PR.
lemma affine_combination_eq_center_mass {ι : Type*} {t : finset ι} {p : ι → E} {w : ι → ℝ}
(hw₂ : ∑ i in t, w i = 1) :
affine_combination t p w = center_mass t w p :=
begin
rw affine_combination_eq_weighted_vsub_of_point_vadd_of_sum_eq_one _ w _ hw₂ (0 : E),
simp only [vsub_eq_sub, add_zero, finset.weighted_vsub_of_point_apply, vadd_eq_add, sub_zero],
rw center_mass_eq_of_sum_1 _ _ hw₂,
end
Note that it suggests swapping the arguments of finset.center_mass
.
I’m afraid I’m traveling until Sep 21 and have phone-only internet. Thank you for the review! I will be delighted to take up these good suggestions when I return, or else please feel free to adopt this PR. |
Note that this will conflict with #9268 but afterwards |
EricW pointed out this is a special case of extant lemma `finset.prod_image`
This reverts commit e2e4389.
Thanks 🎉 bors merge |
…tion): basic lemmas about affine combinations, center of mass, centroid (#9103) Co-authored-by: YaelDillies <yael.dillies@gmail.com>
Build failed (retrying...): |
The typeclass `add_comm_group E` was relaxed to `add_comm_monoid E` in ##9356 but the instance `add_group_is_add_torsor` demands an `add_group` and not just an `add_monoid`.
Canceled. |
bors r+ |
…tion): basic lemmas about affine combinations, center of mass, centroid (#9103) Co-authored-by: YaelDillies <yael.dillies@gmail.com>
Pull request successfully merged into master. Build succeeded: |
Split off from other work to simplify later review.