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] - fix(algebra/module/basic): Do not attach the and is_scalar_tower and smul_comm_class instances to a specific definition of smul #5509

Closed
wants to merge 1 commit into from

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Dec 27, 2020

These instances are in Prop, so the more the merrier.
Without this change, these instances are not available for alternative ℤ-module definitions.

An example of one of these alternate definitions is linear_map.semimodule, which provide a second non-defeq ℤ-module structure alongside add_comm_group.int_module.
With this PR, both semimodule structures are shown to satisfy smul_comm_class and is_scalar_tower; while before it, only add_comm_group.int_module was shown to satisfy these.

This PR makes the following work:

example {R : Type*} {M₁ M₂ M₃ : Type*}
  [comm_semiring R]
  [add_comm_monoid M₁] [semimodule R M₁]
  [add_comm_monoid M₂] [semimodule R M₂]
  [add_comm_monoid M₃] [semimodule R M₃]
(f : M₁ →ₗ[R] M₂ →ₗ[R] M₃) (x : M₁) (n : ℕ) : f (n • x) = n • f x :=
by simp

Zulip

…` and `smul_comm_class` instances to a specific definition of smul

These instances are in `Prop`, so the more the merrier.
Without this change, these instances are not available for alternative ℤ-module definitions.
@sgouezel
Copy link
Collaborator

sgouezel commented Jan 3, 2021

let's merge this one, everyone seemed to agree on Zulip
bors r+

@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 Jan 3, 2021
bors bot pushed a commit that referenced this pull request Jan 3, 2021
…` and `smul_comm_class` instances to a specific definition of smul (#5509)

These instances are in `Prop`, so the more the merrier.
Without this change, these instances are not available for alternative ℤ-module definitions.

An example of one of these alternate definitions is `linear_map.semimodule`, which provide a second non-defeq ℤ-module structure alongside `add_comm_group.int_module`.
With this PR, both semimodule structures are shown to satisfy `smul_comm_class` and `is_scalar_tower`; while before it, only `add_comm_group.int_module` was shown to satisfy these.

This PR makes the following work:
```lean
example {R : Type*} {M₁ M₂ M₃ : Type*}
  [comm_semiring R]
  [add_comm_monoid M₁] [semimodule R M₁]
  [add_comm_monoid M₂] [semimodule R M₂]
  [add_comm_monoid M₃] [semimodule R M₃]
(f : M₁ →ₗ[R] M₂ →ₗ[R] M₃) (x : M₁) (n : ℕ) : f (n • x) = n • f x :=
by simp
```
@bors
Copy link

bors bot commented Jan 3, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title fix(algebra/module/basic): Do not attach the ℕ and ℤ is_scalar_tower and smul_comm_class instances to a specific definition of smul [Merged by Bors] - fix(algebra/module/basic): Do not attach the ℕ and ℤ is_scalar_tower and smul_comm_class instances to a specific definition of smul Jan 3, 2021
@bors bors bot closed this Jan 3, 2021
@bors bors bot deleted the eric-wieser/scalar-tower-diamond branch January 3, 2021 23:18
pglutz pushed a commit that referenced this pull request Jan 6, 2021
…` and `smul_comm_class` instances to a specific definition of smul (#5509)

These instances are in `Prop`, so the more the merrier.
Without this change, these instances are not available for alternative ℤ-module definitions.

An example of one of these alternate definitions is `linear_map.semimodule`, which provide a second non-defeq ℤ-module structure alongside `add_comm_group.int_module`.
With this PR, both semimodule structures are shown to satisfy `smul_comm_class` and `is_scalar_tower`; while before it, only `add_comm_group.int_module` was shown to satisfy these.

This PR makes the following work:
```lean
example {R : Type*} {M₁ M₂ M₃ : Type*}
  [comm_semiring R]
  [add_comm_monoid M₁] [semimodule R M₁]
  [add_comm_monoid M₂] [semimodule R M₂]
  [add_comm_monoid M₃] [semimodule R M₃]
(f : M₁ →ₗ[R] M₂ →ₗ[R] M₃) (x : M₁) (n : ℕ) : f (n • x) = n • f x :=
by simp
```
@eric-wieser eric-wieser changed the title [Merged by Bors] - fix(algebra/module/basic): Do not attach the ℕ and ℤ is_scalar_tower and smul_comm_class instances to a specific definition of smul [Merged by Bors] - fix(algebra/module/basic): Do not attach the and is_scalar_tower and smul_comm_class instances to a specific definition of smul Feb 17, 2024
@eric-wieser eric-wieser changed the title [Merged by Bors] - fix(algebra/module/basic): Do not attach the and is_scalar_tower and smul_comm_class instances to a specific definition of smul [Merged by Bors] - fix(algebra/module/basic): Do not attach the and is_scalar_tower and smul_comm_class instances to a specific definition of smul Feb 17, 2024
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

2 participants