-
Notifications
You must be signed in to change notification settings - Fork 299
feat(algebra/algebra/basic): Algebras are bimodules #10716
Conversation
0ef4ae3
to
5e55c1e
Compare
29d7f71
to
eae7d2d
Compare
5d4f350
to
342f300
Compare
2910c07
to
cb8f851
Compare
What was the resolution of this issue? |
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.
I'm a bit worried about the loss of usability we'll get, especially because of having to insert [module Rᵐᵒᵖ M] [is_central_scalar R M]
everywhere. I'd like to see a nicer way (ideally closer to standard mathematical notation), how about a new typeclass [bimodule R M]
?
@@ -115,10 +118,14 @@ See the implementation notes in this file for discussion of the details of this | |||
@[nolint has_inhabited_instance] | |||
class algebra (R : Type u) (A : Type v) [comm_semiring R] [semiring A] | |||
extends has_smul R A, R →+* A := | |||
[to_has_opposite_smul : has_smul Rᵐᵒᵖ A] |
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.
I'd argue that it would be more convenient, adding a field op_smul
and making to_has_opposite_smul
an instance.
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.
The advantage of this spelling is that lean automatically picks up the instance as an instance argument if it already exists
@@ -1359,13 +1408,15 @@ section int | |||
|
|||
variables (R : Type*) [ring R] | |||
|
|||
-- FIXME |
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.
What should be fixed, or has it been fixed now?
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.
I think this is referring to the fact that we would need a add_comm_group.rzsmul
field otherwise we end up with another diamond again.
It was to mess with the unfolding of some of the |
…tive rings (#18384) This changes the definition of multiplication on `triv_sq_zero_ext R M` as follows ```diff -x * y = (x.1 * y.1, x.1 • y.2 + y.1 • x.2) +x * y = (x.1 * y.1, x.1 • y.2 + op y.1 • x.2) ``` which for `R=M` gives the more natural `x.1 * y.2 + x.2 * y.1` in the second term instead of `x.1 * y.2 + y.1 * x.2`. This adds some slightly annoying typeclass arguments that could eventually be cleaned up by #10716; but that PR has rotted under the mathlib4 tide. Either way, the weird typeclass arguments needed with `triv_sq_zero_ext R M` are all invisible when working with `dual_number R`. This is motivated by wanting to talk about `dual_number (quaternion R)` or `dual_number (matrix n n R)`. Unfortunately this breaks the `topological_semiring` instance (making it need an `@` and trigger the `fails_quickly` linter), but this instance isn't really interesting anyway.
This merge was performed without any cache available, so will almost certainly fail CI.
b3bc3d5
to
523e82e
Compare
This changes the definition of
algebra
to include a right action, such thatalgebra R A
automatically implies a compatible left- and right- R-module structure.The
module ℕᵐᵒᵖ R
andmodule ℤᵐᵒᵖ R
instances this introduces create diamonds whenR=ℕ
andR=ℤ
withsemiring.to_opposite_module
(sincemul_comm
is not true definitionally), but fixing those would require adding anop_nsmul
field toadd_comm_monoid
which would make this PR huge!The same change that is made to
algebra R A
also ends up being made tolie_algebra R L
, although this is less in the way sincelie_algebra R L
already extendsmodule R L
, unlikealgebra R A
which does not directly extendmodule R A
.Most of the extra typeclass arguments that are needed in various places stem from
module.End R M
now only being anR
-algebra ifM
is anR
-bimodule.This is running into an issue flagged by the
fails_quickly
linter, which can be reproduced as:(pseudo_?)(e?)metric
anduniform_space
#12120has_uniform_continuous_const_smul.op
#12434is_central_scalar
instance #13710restrict_scalars
definitions #13995