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] - chore(Algebra/Algebra/Defs): add an algebraMap field to Algebra instead of extending RingHom #20518

Closed
wants to merge 14 commits into from

Conversation

edegeltje
Copy link
Collaborator

as proposed on zulip


Open in Gitpod

@edegeltje edegeltje added WIP Work in progress t-algebra Algebra (groups, rings, fields, etc) labels Jan 6, 2025
Copy link

github-actions bot commented Jan 6, 2025

PR summary 118b2fe326

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

-+-+ algebra'
-+-+-+ algebra

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.


Decrease in tech debt: (relative, absolute) = (1.00, 0.00)
Current number Change Type
4816 -1 porting notes

Current commit 118b2fe326
Reference commit 7466910ec3

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@edegeltje edegeltje removed the WIP Work in progress label Jan 6, 2025
@kbuzzard
Copy link
Member

kbuzzard commented Jan 6, 2025

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit 2890b28.
The entire run failed.
Found no significant differences.

@kbuzzard
Copy link
Member

kbuzzard commented Jan 7, 2025

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit e85e968.
The entire run failed.
Found no significant differences.

@kbuzzard
Copy link
Member

kbuzzard commented Jan 7, 2025

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit 6fb5948.
The entire run failed.
Found no significant differences.

@kbuzzard
Copy link
Member

kbuzzard commented Jan 9, 2025

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit 6fb5948.
The entire run failed.
Found no significant differences.

@kbuzzard
Copy link
Member

kbuzzard commented Jan 9, 2025

I should say that I have no particular suspicion that mathlib will compile more quickly or more slowly, but I thought it was worth benchmarking giving that we're changing such a fundamental definition and that typeclass inference can sometimes be very delicate. I hadn't realised that there were problems with the benchmarking bot.

@kbuzzard kbuzzard mentioned this pull request Jan 9, 2025
@kbuzzard
Copy link
Member

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit 02cc50f.
There were no significant changes against commit 7466910.

Copy link

File Instructions %
build -4.214⬝10⁹ (+0.00%)
Mathlib.RingTheory.Kaehler.CotangentComplex +1.883⬝10⁹ (+0.67%)
Mathlib.RingTheory.Kaehler.JacobiZariski -2.397⬝10⁹ (-0.28%)
CI run

Copy link
Member

@kbuzzard kbuzzard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maintainer delegate

I am not an expert in the finer parts of typeclass inference so I'd like another maintainer to sign off on this, but it's great to see that this change decreases build time a little and the diff looks fine to me (github is making much more of a meal of it than it could do).

Mathlib/Geometry/Manifold/Algebra/SmoothFunctions.lean Outdated Show resolved Hide resolved
@@ -64,7 +64,7 @@ attribute [simp] algebraMap_σ
noncomputable instance {R₀} [CommRing R₀] [Algebra R₀ R] [Algebra R₀ S] [IsScalarTower R₀ R S] :
Algebra R₀ P.Ring where
__ := Module.compHom P.Ring (algebraMap R₀ R)
__ := (algebraMap R P.Ring).comp (algebraMap R₀ R)
algebraMap := (algebraMap R P.Ring).comp (algebraMap R₀ R)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the Module.compHom thing on line 66 still necessary?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it is. There's Algebra.compHom that can replace the whole def now but this is probably not in scope of the PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR at #20708

Copy link

🚀 Pull request has been placed on the maintainer queue by kbuzzard.

Copy link
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors d+

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jan 13, 2025

✌️ edegeltje can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@edegeltje
Copy link
Collaborator Author

bors r+

@edegeltje
Copy link
Collaborator Author

bors r+

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jan 13, 2025

Already running a review

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jan 13, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore(Algebra/Algebra/Defs): add an algebraMap field to Algebra instead of extending RingHom [Merged by Bors] - chore(Algebra/Algebra/Defs): add an algebraMap field to Algebra instead of extending RingHom Jan 13, 2025
@mathlib-bors mathlib-bors bot closed this Jan 13, 2025
@mathlib-bors mathlib-bors bot deleted the blizzard_inc/fieldify_algebraMap branch January 13, 2025 13:56
mathlib-bors bot pushed a commit that referenced this pull request Jan 13, 2025
…20708)

As suggested in the conversation around #20518 , the algebra instance has been subsumed by a definition, and this PR makes the replacement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated maintainer-merge t-algebra Algebra (groups, rings, fields, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants