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] - refactor(*): rename semimodule
to module
, delete typeclasses module
and vector_space
#7322
Conversation
vector space: 'vector_space' | ||
product of vector spaces: 'prod.semimodule' | ||
vector space: 'module' | ||
product of vector spaces: 'prod.module' |
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.
Isn't that an unusual name? module.prod
would be more standard.
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.
It is the module
instance on the prod
type, therefore prod.module
.
Marking this as ready to review since it builds and the reaction on Zulip was positive. |
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 looks good to me, thanks a lot!
There is only one point about which I am unsure. After your refactor, we have both module.rank
and findim
, which don't go well together. Would finrank
make sense? (And also adding somewhere a docstring saying that dimension is called rank, that would have enough keywords in it to be easy to find by grepping?)
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
I guess I might as well go ahead and change that. Can the
In the docstring for |
We still call keep calling `finite_dimensional` the same thing, but we might decide to change that later.
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
Looks like the linter is not happy. Otherwise, let's get this merged quickly to avoid incoming conflicts. |
✌️ Vierkantor can now approve this pull request. To approve and merge a pull request, simply reply with |
bors r+ |
…ule` and `vector_space` (#7322) Splitting typeclasses between `semimodule`, `module` and `vector_space` was causing many (small) issues, so why don't we just get rid of this duplication? This PR contains the following changes: * delete the old `module` and `vector_space` synonyms for `semimodule` * find and replace all instances of `semimodule` and `vector_space` to `module` * (thereby renaming the previous `semimodule` typeclass to `module`) * rename `vector_space.dim` to `module.rank` (in preparation for generalizing this definition to all modules) * delete a couple `module` instances that have now become redundant This find-and-replace has been done extremely naïvely, but it seems there were almost no name clashes and no "clbuttic mistakes". I have gone through the full set of changes, finding nothing weird, and I'm fixing any build issues as they come up (I expect less than 10 declarations will cause conflicts). Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/module.20from.20semimodule.20over.20a.20ring A good example of a workaround required by the `module` abbreviation is the [`triv_sq_zero_ext.module` instance](https://github.com/leanprover-community/mathlib/blob/3b8cfdc905c663f3d99acac325c7dff1a0ce744c/src/algebra/triv_sq_zero_ext.lean#L164). Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
Build failed: |
bors r+ p=37 |
…ule` and `vector_space` (#7322) Splitting typeclasses between `semimodule`, `module` and `vector_space` was causing many (small) issues, so why don't we just get rid of this duplication? This PR contains the following changes: * delete the old `module` and `vector_space` synonyms for `semimodule` * find and replace all instances of `semimodule` and `vector_space` to `module` * (thereby renaming the previous `semimodule` typeclass to `module`) * rename `vector_space.dim` to `module.rank` (in preparation for generalizing this definition to all modules) * delete a couple `module` instances that have now become redundant This find-and-replace has been done extremely naïvely, but it seems there were almost no name clashes and no "clbuttic mistakes". I have gone through the full set of changes, finding nothing weird, and I'm fixing any build issues as they come up (I expect less than 10 declarations will cause conflicts). Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/module.20from.20semimodule.20over.20a.20ring A good example of a workaround required by the `module` abbreviation is the [`triv_sq_zero_ext.module` instance](https://github.com/leanprover-community/mathlib/blob/3b8cfdc905c663f3d99acac325c7dff1a0ce744c/src/algebra/triv_sq_zero_ext.lean#L164). Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com> Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
Pull request successfully merged into master. Build succeeded: |
semimodule
to module
, delete typeclasses module
and vector_space
semimodule
to module
, delete typeclasses module
and vector_space
… of `dim` (#18735) The `dim` name is left from the previous name of the function, `vector_space.dim`. When that was merged with `module.rank` in #7322, we left renaming the existing lemmas as future work. This commit was made by replacing `(\b|(?<=_))dim(\b|(?=_))` with `rank` in the `dimension` and `finite_dimensional` files, and then manually fixing downstream breakages; it's important not to rename `power_basis.dim` at the same time! Deciding whether to move some of these to the `module` namespace is left as future work, the diff is already big enough.
… of `dim` (#18741) The `dim` name is left from the previous name of the function, `vector_space.dim`. When that was merged with `module.rank` in #7322, we left renaming the existing lemmas as future work. This commit was made by replacing `(\b|(?<=_))dim(\b|(?=_))` with `rank` in the `dimension` and `finite_dimensional` files, and then manually fixing downstream breakages; it's important not to rename `power_basis.dim` at the same time! Deciding whether to move some of these to the `module` namespace is left as future work, the diff is already big enough.
… of `dim` (#18741) The `dim` name is left from the previous name of the function, `vector_space.dim`. When that was merged with `module.rank` in #7322, we left renaming the existing lemmas as future work. This commit was made by replacing `(\b|(?<=_))dim(\b|(?=_))` with `rank` in the `dimension` and `finite_dimensional` files, and then manually fixing downstream breakages; it's important not to rename `power_basis.dim` at the same time! Deciding whether to move some of these to the `module` namespace is left as future work, the diff is already big enough.
Splitting typeclasses between
semimodule
,module
andvector_space
was causing many (small) issues, so why don't we just get rid of this duplication?This PR contains the following changes:
module
andvector_space
synonyms forsemimodule
semimodule
andvector_space
tomodule
semimodule
typeclass tomodule
)vector_space.dim
tomodule.rank
(in preparation for generalizing this definition to all modules)module
instances that have now become redundantThis find-and-replace has been done extremely naïvely, but it seems there were almost no name clashes and no "clbuttic mistakes". I have gone through the full set of changes, finding nothing weird, and I'm fixing any build issues as they come up (I expect less than 10 declarations will cause conflicts).
Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/module.20from.20semimodule.20over.20a.20ring
A good example of a workaround required by the
module
abbreviation is thetriv_sq_zero_ext.module
instance.