feat(algebra/algebra/basic): Algebras are bimodules#10716
feat(algebra/algebra/basic): Algebras are bimodules#10716eric-wieser wants to merge 214 commits intomasterfrom
Conversation
0ef4ae3 to
5e55c1e
Compare
29d7f71 to
eae7d2d
Compare
5d4f350 to
342f300
Compare
2910c07 to
cb8f851
Compare
…eser/algebra-bimodule
…ser/algebra-bimodule
What was the resolution of this issue? |
Vierkantor
left a comment
There was a problem hiding this comment.
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]?
| @[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.
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.
The advantage of this spelling is that lean automatically picks up the instance as an instance argument if it already exists
|
|
||
| variables (R : Type*) [ring R] | ||
|
|
||
| -- FIXME |
There was a problem hiding this comment.
What should be fixed, or has it been fixed now?
There was a problem hiding this comment.
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 |
This merge was performed without any cache available, so will almost certainly fail CI.
This changes the definition of
algebrato include a right action, such thatalgebra R Aautomatically implies a compatible left- and right- R-module structure.The
module ℕᵐᵒᵖ Randmodule ℤᵐᵒᵖ Rinstances this introduces create diamonds whenR=ℕandR=ℤwithsemiring.to_opposite_module(sincemul_commis not true definitionally), but fixing those would require adding anop_nsmulfield toadd_comm_monoidwhich would make this PR huge!The same change that is made to
algebra R Aalso ends up being made tolie_algebra R L, although this is less in the way sincelie_algebra R Lalready extendsmodule R L, unlikealgebra R Awhich does not directly extendmodule R A.Most of the extra typeclass arguments that are needed in various places stem from
module.End R Mnow only being anR-algebra ifMis anR-bimodule.This is running into an issue flagged by the
fails_quicklylinter, which can be reproduced as:(pseudo_?)(e?)metricanduniform_space#12120has_uniform_continuous_const_smul.op#12434is_central_scalarinstance #13710restrict_scalarsdefinitions #13995