-
Notifications
You must be signed in to change notification settings - Fork 371
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] - chore(Algebra.Lie): do not always coerce a LieSubmodule
to a Submodule
to get a type
#16509
Conversation
PR summary c170d9258e
|
File | Base Count | Head Count | Change |
---|---|---|---|
Mathlib.Algebra.Lie.Subalgebra | 1011 | 1224 | +213 (+21.07%) |
Import changes for all files
Files | Import difference |
---|---|
Mathlib.Algebra.Lie.Subalgebra |
213 |
Declarations diff
+ instUniqueBot
+ instance (L' : LieSubalgebra R L) [IsArtinian R L] : IsArtinian R L'
+ instance (priority := high) coeSort : CoeSort (LieSubmodule R L M) (Type w)
+ instance (priority := mid) coeSubmodule : CoeOut (LieSubmodule R L M) (Submodule R M)
+ instance : Unique {x // x ∈ (⊥ : LieIdeal R L)}
+ instance [IsArtinian R M] (N : LieSubmodule R L M) : IsArtinian R N
+ instance [IsNoetherian R M] (N : LieSubmodule R L M) : IsNoetherian R N
+ instance [NoZeroSMulDivisors R M] : NoZeroSMulDivisors R N
- coeSubmodule
- instCanLiftSubmoduleLieSubmodule
- instance : Module R N
- instance {S : Type*} [Semiring S] [SMul S R] [SMul Sᵐᵒᵖ R] [Module S M] [Module Sᵐᵒᵖ M]
- module'
You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>
The doc-module for script/declarations_diff.sh
contains some details about this script.
!bench |
@@ -107,6 +107,9 @@ instance [SMul R₁ R] [Module R₁ L] [IsScalarTower R₁ R L] (L' : LieSubalge | |||
instance (L' : LieSubalgebra R L) [IsNoetherian R L] : IsNoetherian R L' := | |||
isNoetherian_submodule' _ | |||
|
|||
instance (L' : LieSubalgebra R L) [IsArtinian R L] : IsArtinian R L' := |
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 could probably be moved downstream to avoid additional imports.
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.
Agreed but I'm fine with the import bump if you are.
Here are the benchmark results for commit 0c698ba. Benchmark Metric Change
===========================================================
- ~Mathlib.Algebra.Lie.Abelian instructions 49.8%
- ~Mathlib.Algebra.Lie.Submodule instructions 17.4%
- ~Mathlib.Algebra.Lie.TensorProduct instructions 23.0%
- ~Mathlib.Algebra.Lie.TraceForm instructions 12.1%
- ~Mathlib.Algebra.Lie.Weights.Basic instructions 20.8%
- ~Mathlib.Algebra.Lie.Weights.Cartan instructions 25.4%
- ~Mathlib.Algebra.Lie.Weights.Chain instructions 18.6%
- ~Mathlib.Algebra.Lie.Weights.Linear instructions 41.8% |
I suspect this will reverse if the coercion from |
I haven't forgotten about this PR, I'm just very busy but I will get to it soon. |
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 all this work.
bors d+
@@ -107,6 +107,9 @@ instance [SMul R₁ R] [Module R₁ L] [IsScalarTower R₁ R L] (L' : LieSubalge | |||
instance (L' : LieSubalgebra R L) [IsNoetherian R L] : IsNoetherian R L' := | |||
isNoetherian_submodule' _ | |||
|
|||
instance (L' : LieSubalgebra R L) [IsArtinian R L] : IsArtinian R L' := |
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.
Agreed but I'm fine with the import bump if you are.
✌️ mattrobball can now approve this pull request. To approve and merge a pull request, simply reply with |
Co-authored-by: Oliver Nash <[email protected]>
bors merge |
…dule` to get a type (#16509) We add ```lean instance (priority := high) coeSort : CoeSort (LieSubmodule R L M) (Type w) where coe N := { x : M // x ∈ N } ``` to avoid the coercion to a `Sort` being `{ x : M // x ∈ N.toSubmodule }` and instead be `N` itself. This allows removal of all `adapation_note`s from leanprover/lean4#5020. Ultimately the API here should be expanded and `Coe (LieSubmodule R L M) (Submodule R M)` should be minimized or removed to avoid forcing Lean to unify `LieSubmodule` and `Submodule` unnecessarily. Co-authored-by: Matthew Robert Ballard <[email protected]>
Pull request successfully merged into master. Build succeeded: |
LieSubmodule
to a Submodule
to get a typeLieSubmodule
to a Submodule
to get a type
We add
to avoid the coercion to a
Sort
being{ x : M // x ∈ N.toSubmodule }
and instead beN
itself.This allows removal of all
adapation_note
s from leanprover/lean4#5020.Ultimately the API here should be expanded and
Coe (LieSubmodule R L M) (Submodule R M)
should be minimized or removed to avoid forcing Lean to unify
LieSubmodule
andSubmodule
unnecessarily.