Skip to content
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

Closed
wants to merge 20 commits into from

Conversation

ocfnash
Copy link
Collaborator

@ocfnash ocfnash commented Sep 8, 2021


Split off from other work to simplify later review.

Open in Gitpod

…basic lemmas about affine combinations, center of mass, centroid
@ocfnash ocfnash added the awaiting-review The author would like community review of the PR label Sep 8, 2021
Copy link
Member

@kbuzzard kbuzzard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Sep 11, 2021
Copy link
Collaborator

@YaelDillies YaelDillies left a 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.

src/linear_algebra/affine_space/combination.lean Outdated Show resolved Hide resolved
src/analysis/convex/basic.lean Outdated Show resolved Hide resolved
src/linear_algebra/affine_space/combination.lean Outdated Show resolved Hide resolved
@ocfnash
Copy link
Collaborator Author

ocfnash commented Sep 12, 2021

Could you also add this lemma? I feel like it belongs in this PR.

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.

@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Sep 13, 2021
@YaelDillies YaelDillies self-assigned this Sep 13, 2021
@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Sep 17, 2021
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Sep 17, 2021
@ocfnash ocfnash 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 Sep 22, 2021
@YaelDillies
Copy link
Collaborator

Note that this will conflict with #9268 but afterwards affine_combination_eq_center_mass will become unconditional.

@ocfnash ocfnash added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Sep 22, 2021
@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Sep 22, 2021
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Sep 22, 2021
@jcommelin
Copy link
Member

Thanks 🎉

bors merge

@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-review The author would like community review of the PR labels Sep 28, 2021
@YaelDillies YaelDillies changed the title feat(linear_algebra/affine_space/combination,analysis/convex/basic): basic lemmas about affine combinations, center of mass, centroid feat(linear_algebra/affine_space/combination, analysis/convex/combination): basic lemmas about affine combinations, center of mass, centroid Sep 28, 2021
bors bot pushed a commit that referenced this pull request Sep 28, 2021
…tion): basic lemmas about affine combinations, center of mass, centroid (#9103)




Co-authored-by: YaelDillies <yael.dillies@gmail.com>
@bors
Copy link

bors bot commented Sep 28, 2021

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`.
@bors
Copy link

bors bot commented Sep 28, 2021

Canceled.

@sgouezel
Copy link
Collaborator

bors r+

bors bot pushed a commit that referenced this pull request Sep 29, 2021
…tion): basic lemmas about affine combinations, center of mass, centroid (#9103)




Co-authored-by: YaelDillies <yael.dillies@gmail.com>
@bors
Copy link

bors bot commented Sep 29, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(linear_algebra/affine_space/combination, analysis/convex/combination): basic lemmas about affine combinations, center of mass, centroid [Merged by Bors] - feat(linear_algebra/affine_space/combination, analysis/convex/combination): basic lemmas about affine combinations, center of mass, centroid Sep 29, 2021
@bors bors bot closed this Sep 29, 2021
@bors bors bot deleted the center_mass_centroid branch September 29, 2021 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants