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(algebra/add_torsor): torsors of additive group actions #2720

Closed
wants to merge 15 commits into from

Conversation

jsm28
Copy link
Collaborator

@jsm28 jsm28 commented May 17, 2020

Define torsors of additive group actions, to the extent needed for
(and with notation motivated by) affine spaces, to the extent needed
for Euclidean spaces. See
https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/Some.20olympiad.20formalisations
for the discussion leading to this particular structure.

jsm28 added 4 commits May 17, 2020 22:39
…actions

Define torsors of additive commutative group actions, to the extent
needed for (and with notation motivated by) affine spaces, to the
extent needed for Euclidean spaces.  See
https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/Some.20olympiad.20formalisations
for the discussion leading to this particular structure.
@urkud urkud changed the title feat(algebra/add_comm_torsor): torsors of additive commutative group … feat(algebra/add_comm_torsor): torsors of additive commutative group actions May 18, 2020
Copy link
Collaborator

@sgouezel sgouezel left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

src/algebra/add_comm_torsor.lean Outdated Show resolved Hide resolved
src/algebra/add_comm_torsor.lean Outdated Show resolved Hide resolved
src/algebra/add_comm_torsor.lean Outdated Show resolved Hide resolved
src/algebra/add_comm_torsor.lean Outdated Show resolved Hide resolved
@urkud
Copy link
Member

urkud commented May 18, 2020

jsm28 and others added 2 commits May 18, 2020 23:38
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
@jsm28
Copy link
Collaborator Author

jsm28 commented May 19, 2020

I've made +ᵥ act with the vector on the left and renamed lemmas following the discussion on Zulip.

@rwbarton
Copy link
Collaborator

I'd like to step back and think about how this fits into the rest of the library. Presumably we will want torsors for a (multiplicative) group at some point, which raises the following questions.

  • Should additive torsors be related to multiplicative torsors via to_additive? They will satisfy the same basic theorems after all.
  • Especially if the answer is yes, but also if not, is "vector" really a good name for the group elements at this level of generality? I'm trying to think of other examples where additive notation for a torsor is natural, but one wouldn't call the group elements "vectors". I guess maybe one is the points of a genus one curve?
  • We have mul_action already, with smul corresponding to vadd, and it seems logical for a multiplicative torsor to extend that. For parallelism, should an additive torsor be split into add_action and add_torsor?

I know these can be annoying questions to think about when you just want to do Euclidean geometry, but otherwise these questions will just come up in the future when it's more difficult to modify the foundations.

@jsm28
Copy link
Collaborator Author

jsm28 commented May 19, 2020

From observation of mathlib development over the past few months, it seems pretty good at large-scale refactorings whenever someone wants to do something that implies refactoring existing code (and the further something is from the foundations, the fewer changes are needed to it in such a refactoring beyond simple renaming of results). Changing names (of lemmas, classes, "vector" and notation) is easy, now (if someone can say what the names should be) or in future, if desired (but don't keep switching back and forth between wanting +ᵥ to act on the left and the right).

@jcommelin
Copy link
Member

@jsm28 It's possible, but it's usually not so much fun. So if we can avoid such a refactor with a bit of careful planning ahead, I would very much prefer that 😉

@jsm28 jsm28 changed the title feat(algebra/add_comm_torsor): torsors of additive commutative group actions feat(algebra/add_torsor): torsors of additive group actions May 19, 2020
@jsm28
Copy link
Collaborator Author

jsm28 commented May 19, 2020

I've now changed this to define separate has_vadd, has_vsub, add_action and add_torsor (with a nonempty field), with those lemmas not needing commutativity no longer needing it (I don't know if the others actually need commutativity, or if it might just be my proofs that do in some cases). Group elements are referred to as such rather than as vectors, but it still uses vadd, vsub, +ᵥ and -ᵥ in the absence of suggested better alternatives.

@jsm28 jsm28 added the awaiting-review The author would like community review of the PR label May 20, 2020
src/algebra/add_torsor.lean Outdated Show resolved Hide resolved
src/algebra/add_torsor.lean Outdated Show resolved Hide resolved
src/algebra/add_torsor.lean Outdated Show resolved Hide resolved
src/algebra/add_torsor.lean Outdated Show resolved Hide resolved
@urkud
Copy link
Member

urkud commented May 25, 2020

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 May 25, 2020
bors bot pushed a commit that referenced this pull request May 25, 2020
Define torsors of additive group actions, to the extent needed for
(and with notation motivated by) affine spaces, to the extent needed
for Euclidean spaces.  See
https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/Some.20olympiad.20formalisations
for the discussion leading to this particular structure.
@bors
Copy link

bors bot commented May 25, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(algebra/add_torsor): torsors of additive group actions [Merged by Bors] - feat(algebra/add_torsor): torsors of additive group actions May 25, 2020
@bors bors bot closed this May 25, 2020
@bors bors bot deleted the add_comm_torsor branch May 25, 2020 07:23
jsm28 added a commit that referenced this pull request Aug 18, 2020
The definition of `vsub_set` in `algebra/add_torsor` does something
similar to `set.image2`, but expressed directly with `∃` inside
`{...}`.  Various lemmas in `linear_algebra/affine_space/basic`
likewise express such sets of subtractions with a given point on one
side directly rather than using `set.image`.  These direct forms can
be inconvenient to use with lemmas about `set.image2`, `set.image` and
`set.range`; in particular, they have the equality inside the binders
expressed the other way round, leading to constructs such as `conv_lhs
{ congr, congr, funext, conv { congr, funext, rw eq_comm } }` when
it's necessary to convert one form to the other.

The form of `vsub_set` was suggested in review of #2720, the original
`add_torsor` addition, based on what was then used in
`algebra/pointwise`.  Since then, `image2` has been added to mathlib
and `algebra/pointwise` now uses `image2`.

Thus, convert these definitions to using `image2` or `''` as
appropriate, so simplifying various proofs.

This PR deliberately only addresses `vsub_set` and related definitions
for such sets of subtractions; it does not attempt to change any other
definitions in `linear_algebra/affine_space/basic` that might also be
able to use `image2` or `''` but are not such sets of subtractions,
and does not change the formulations of lemmas not involving such sets
even if a rearrangement of equalities and existential quantifiers in
some such lemmas might bring them closer to the formulations about
images of sets.
bors bot pushed a commit that referenced this pull request Aug 19, 2020
…set (#3858)

The definition of `vsub_set` in `algebra/add_torsor` does something
similar to `set.image2`, but expressed directly with `∃` inside
`{...}`.  Various lemmas in `linear_algebra/affine_space/basic`
likewise express such sets of subtractions with a given point on one
side directly rather than using `set.image`.  These direct forms can
be inconvenient to use with lemmas about `set.image2`, `set.image` and
`set.range`; in particular, they have the equality inside the binders
expressed the other way round, leading to constructs such as `conv_lhs
{ congr, congr, funext, conv { congr, funext, rw eq_comm } }` when
it's necessary to convert one form to the other.

The form of `vsub_set` was suggested in review of #2720, the original
`add_torsor` addition, based on what was then used in
`algebra/pointwise`.  Since then, `image2` has been added to mathlib
and `algebra/pointwise` now uses `image2`.

Thus, convert these definitions to using `image2` or `''` as
appropriate, so simplifying various proofs.

This PR deliberately only addresses `vsub_set` and related definitions
for such sets of subtractions; it does not attempt to change any other
definitions in `linear_algebra/affine_space/basic` that might also be
able to use `image2` or `''` but are not such sets of subtractions,
and does not change the formulations of lemmas not involving such sets
even if a rearrangement of equalities and existential quantifiers in
some such lemmas might bring them closer to the formulations about
images of sets.
cipher1024 pushed a commit to cipher1024/mathlib that referenced this pull request Mar 15, 2022
…er-community#2720)

Define torsors of additive group actions, to the extent needed for
(and with notation motivated by) affine spaces, to the extent needed
for Euclidean spaces.  See
https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/Some.20olympiad.20formalisations
for the discussion leading to this particular structure.
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

5 participants