-
Notifications
You must be signed in to change notification settings - Fork 298
[Merged by Bors] - feat(ring_theory/derivations): stab on derivations #3688
Conversation
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.
Thank you for the PR!
I would have preferred it if you submitted three different PRs, one for cancel_monoid
, one for compat_semimodule
and one for derivation
. Together they are still small enough, so I can review them.
Sorry for noticing it later on: could you move |
I'm delighted to see this work taking shape but I wonder if bundling derivations into a structure is the best approach. I came here to comment that, mathematically, what is really being proved in Unfortunately I am running late for an appointment so I haven't time to finish this but here's another approach that might be worth considering: -- Test this out by dropping it in at the end of your final section.
def is_derivation (D : A →ₗ[R] M) := ∀ ⦃a b⦄, D (a * b) = (a • D b) + (b • D a)
lemma is_derivation.eq (D : A →ₗ[R] M) (h : is_derivation D) :
∀ {a b}, D (a * b) = (a • D b) + (b • D a) := h
def submodule : submodule R (module.End R A) :=
{ carrier := is_derivation,
zero_mem' := λ a b, by simp,
add_mem' := λ a b ha hb, by sorry,
smul_mem' := λ c a ha, by sorry, }
def lie_subalgebra : lie_subalgebra R (module.End R A) :=
{ lie_mem := λ D₁ D₂ h₁ h₂ a b, by { -- Awful proof but haven't time to fix.
simp only [lie_ring.of_associative_ring_bracket,
id.smul_eq_mul, linear_map.mul_app, linear_map.sub_apply],
rw [h₁, h₂],
simp only [id.smul_eq_mul, linear_map.map_add],
rw [h₁, h₂, h₁, h₂],
simp only [id.smul_eq_mul],
ring, },
..submodule } You should have a bit less work to do this way because module and Lie algebra structures will be automatically induced and I expect it will be very useful later to know not just that the derivations form a module / Lie algebra but actually submodule / Lie subalgebra. |
Hi Oliver, thanks for commenting! I am perfectly aware of this problem (I was also when I did define derivations) and it actually arose before in the topology and geometry sections of the library with continuous and smooth bundled maps, where it is not possible to treat eg continuous maps valued in a group as a subgroup of all maps (see #3446). However, in order to define the Lie algebra of a Lie group I defined vector fields as derivations over the algebra of smooth maps valued in the field (next PR), and for consistency in that section of the library and for it to properly work the only possible implementation of vector fields is as structures (regardless of how the structure is defined I believe it needs to be a structure: Maybe there is a way to do state things for bundled derivations in the algebra section as well though (https://leanprover.zulipchat.com/login/#narrow/stream/113488-general/topic/Making.20a.20type.20a.20.22subtype.22.20of.20another might be relevant for the case of continuous functions: could we do something in the same style?) |
Thanks for such a comprehensive reply @Nicknamen I now understand that you had already carefully considered the bundled vs. unbundled approach. I like the approach of defining the bracket on vector fields by identifying them with the derivations as a Lie subalgebra of the linear endomorphisms of the smooth functions (I guess this uses Hadamard's Lemma?). I am a little surprised that you find an unbundled approach to derivations would not work well there but I confess I have not seen that work or thought much about it. It may well be that we need both the bundled and unbundled approaches (together with the machinery to plumb these together). If this turns out to be the case then I would advocate defining the module and Lie algebra structures on derivations via their submodule and Lie subalgebra structures using the unbundled definitions. Still, I appreciate I'm not in the weeds here so I am more than happy to leave this up to you. I mostly just wanted to make sure these ideas were being considered and I now know they are. Thanks again for doing all this excellent work. |
Ok I believe this is pretty much ready on my side. I replaced |
The last commit I pushed will not compile but is there just to illustrate a refactor I could include with this PR. Everything there compiles up to the file |
Also, there are three pending changes that I did not apply because I would like to discuss them further! |
Well this seems to happen just for the lemma |
Refactoring |
A review of derivations? Yeah sure I'd merge this first so that I can go on with the other PRs I have in cue! I am not sure it is best to review this before mathlib build succeeds, but if you don't mind go ahead! In any case we could start by resolving the three points from the previous review that are still open! |
Ok mathlib built so feel free to go on with the next review! |
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.
Just one extra comment, apart from those comments everything looks good to me!
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 for the fixes!
bors r+
Pull request successfully merged into master. Build succeeded: |
This means that `group.to_left_cancel_semigroup` is now spelt `group.to_cancel_monoid.to_left_cancel_monoid.to_left_cancel_semigroup`. The longer spelling shouldn't actually matter because type inference will do it anyway. I don't know whether this matters, but this should slightly reduce the number of connections that instance resolution must check. This shortcut wasn't added deliberately, it seems it just got added accidentally when #3688 was introduced.
Temporary stab on derivations. I will write myself the definitive definition as soon as bimodules will be there.