-
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(data/set_like): remove repeated boilerplate from subobjects #6768
Conversation
I think this is a very good idea! One note, in category theory terms, Did you already consider how this would integrate with subobjects that use |
The duplication I'm trying to eliminate always picks an order that matches coe; I think exposing an order-embedding as part of the API is sensible, but I don't think it should be part of the construction of the structure
I was thinking about this, yes; but I figured I'd try and keep the scope of this PR somewhat constrained for now. I think my intent with this PR is to just propagate the lemma removals and see if typeclass resolution gets stuck anywhere. There's almost certainly a more powerful generalization to be made, but that will be much easier to build on top of the weak generalization with half the lemmas already deduplicated. |
1c66c71
to
5ff2867
Compare
I had a quick go with |
I fear this will go stale quite quickly, as PRs seem to appear that use the |
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.
Thanks! 🎉
bors r+
This just scratches the surface, and removes all of the boilerplate that is just a consequence of the injective map to a `set`. Already this trims more than 150 lines. For every lemma of the form `set_like.*` added in this PR, the corresponding `submonoid.*`, `add_submonoid.*`, `sub_mul_action.*`, `submodule.*`, `subsemiring.*`, `subring.*`, `subfield.*`, `subalgebra.*`, and `intermediate_field.*` lemmas have been removed. Often these lemmas only existed for one or two of these subtypes, so this means that we have lemmas for more things not fewer. Note that while the `ext_iff`, `ext'`, and `ext'_iff` lemmas have been removed, we still need the `ext` lemma as `set_like.ext` cannot directly be tagged `@[ext]`.
Build failed (retrying...): |
This just scratches the surface, and removes all of the boilerplate that is just a consequence of the injective map to a `set`. Already this trims more than 150 lines. For every lemma of the form `set_like.*` added in this PR, the corresponding `submonoid.*`, `add_submonoid.*`, `sub_mul_action.*`, `submodule.*`, `subsemiring.*`, `subring.*`, `subfield.*`, `subalgebra.*`, and `intermediate_field.*` lemmas have been removed. Often these lemmas only existed for one or two of these subtypes, so this means that we have lemmas for more things not fewer. Note that while the `ext_iff`, `ext'`, and `ext'_iff` lemmas have been removed, we still need the `ext` lemma as `set_like.ext` cannot directly be tagged `@[ext]`.
Build failed: |
… eric-wieser/has_injective_coe_set
Let's try it again: bors merge |
✌️ eric-wieser can now approve this pull request. To approve and merge a pull request, simply reply with |
This just scratches the surface, and removes all of the boilerplate that is just a consequence of the injective map to a `set`. Already this trims more than 150 lines. For every lemma of the form `set_like.*` added in this PR, the corresponding `submonoid.*`, `add_submonoid.*`, `sub_mul_action.*`, `submodule.*`, `subsemiring.*`, `subring.*`, `subfield.*`, `subalgebra.*`, and `intermediate_field.*` lemmas have been removed. Often these lemmas only existed for one or two of these subtypes, so this means that we have lemmas for more things not fewer. Note that while the `ext_iff`, `ext'`, and `ext'_iff` lemmas have been removed, we still need the `ext` lemma as `set_like.ext` cannot directly be tagged `@[ext]`.
Pull request successfully merged into master. Build succeeded: |
This just scratches the surface, and removes all of the boilerplate that is just a consequence of the injective map to a `set`. Already this trims more than 150 lines. For every lemma of the form `set_like.*` added in this PR, the corresponding `submonoid.*`, `add_submonoid.*`, `sub_mul_action.*`, `submodule.*`, `subsemiring.*`, `subring.*`, `subfield.*`, `subalgebra.*`, and `intermediate_field.*` lemmas have been removed. Often these lemmas only existed for one or two of these subtypes, so this means that we have lemmas for more things not fewer. Note that while the `ext_iff`, `ext'`, and `ext'_iff` lemmas have been removed, we still need the `ext` lemma as `set_like.ext` cannot directly be tagged `@[ext]`.
This just scratches the surface, and removes all of the boilerplate that is just a consequence of the injective map to a
set
.Already this trims more than 150 lines.
For every lemma of the form
set_like.*
added in this PR, the correspondingsubmonoid.*
,add_submonoid.*
,sub_mul_action.*
,submodule.*
,subsemiring.*
,subring.*
,subfield.*
,subalgebra.*
, andintermediate_field.*
lemmas have been removed.Often these lemmas only existed for one or two of these subtypes, so this means that we have lemmas for more things not fewer.
Note that while the
ext_iff
,ext'
, andext'_iff
lemmas have been removed, we still need theext
lemma asset_like.ext
cannot directly be tagged@[ext]
.