Skip to content

[Merged by Bors] - feat(Algebra/Colimit/DirectLimit): add Algebra structure for DirectLimit#38672

Closed
drocta wants to merge 33 commits intoleanprover-community:masterfrom
drocta:algebra-direct-limit2
Closed

[Merged by Bors] - feat(Algebra/Colimit/DirectLimit): add Algebra structure for DirectLimit#38672
drocta wants to merge 33 commits intoleanprover-community:masterfrom
drocta:algebra-direct-limit2

Conversation

@drocta
Copy link
Copy Markdown
Contributor

@drocta drocta commented Apr 28, 2026

add Algebra instance to DirectLimit. also add a few lemmas for it for the algebra map, and also define the of, lift, and the of_f, lift_of and hom_ext lemmas for it.


Use of AI:
I again made some use of ChatGPT for some advice while writing this code, as well as the auto-complete in VS Code.
However, I can personally vouch for all of these contributions, and that I understand all of it.

This is the second part of my project towards supporting direct limits of $C^*$-algebras (as I described on Zulip ).

This PR adds an import of Mathlib.Algebra.Algebra.Hom (because it needs AlgHom and AlgHomClass ) in addition to the import of Mathlib.Algebra.Star.StarRingHom added in PR #38308 . In the next PR I intend to make, these two should be replaced with an import of Mathlib.Algebra.Star.StarAlgHom .

@github-actions github-actions Bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Apr 28, 2026
@github-actions
Copy link
Copy Markdown

Welcome new contributor!

Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests.

We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the awaiting-author tag, or another reason described in the Lifecycle of a PR. The review dashboard has a dedicated webpage which shows whether your PR is on the review queue, and (if not), why.

If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR.

Thank you again for joining our community.

@github-actions github-actions Bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label Apr 28, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

PR summary ea11ccc0c5

Import changes exceeding 2%

% File
+39.46% Mathlib.Algebra.Colimit.DirectLimit

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Algebra.Colimit.DirectLimit 560 781 +221 (+39.46%)
Import changes for all files
Files Import difference
6 files Mathlib.Algebra.Category.ModuleCat.EnoughInjectives Mathlib.Algebra.Category.ModuleCat.Ulift Mathlib.Algebra.Homology.LocalCohomology Mathlib.CategoryTheory.Abelian.GrothendieckCategory.ModuleEmbedding.GabrielPopescu Mathlib.RingTheory.Morita.Matrix Mathlib.RingTheory.Regular.Category
1
Mathlib.Algebra.Category.ModuleCat.Localization 2
81 files Mathlib.Algebra.Category.Grp.AB Mathlib.Algebra.Category.Grp.Abelian Mathlib.Algebra.Category.Grp.Images Mathlib.Algebra.Category.Grp.IsFinite Mathlib.Algebra.Category.ModuleCat.AB Mathlib.Algebra.Category.ModuleCat.Abelian Mathlib.Algebra.Category.ModuleCat.Biproducts Mathlib.Algebra.Category.ModuleCat.ChangeOfRings Mathlib.Algebra.Category.ModuleCat.Ext.DimensionShifting Mathlib.Algebra.Category.ModuleCat.Ext.HasExt Mathlib.Algebra.Category.ModuleCat.Images Mathlib.Algebra.Category.ModuleCat.Limits Mathlib.Algebra.Category.ModuleCat.Monoidal.Adjunction Mathlib.Algebra.Category.ModuleCat.Presheaf.Abelian Mathlib.Algebra.Category.ModuleCat.Presheaf.ChangeOfRings Mathlib.Algebra.Category.ModuleCat.Presheaf.ColimitFunctor Mathlib.Algebra.Category.ModuleCat.Presheaf.Colimits Mathlib.Algebra.Category.ModuleCat.Presheaf.EpiMono Mathlib.Algebra.Category.ModuleCat.Presheaf.Free Mathlib.Algebra.Category.ModuleCat.Presheaf.Generator Mathlib.Algebra.Category.ModuleCat.Presheaf.Limits Mathlib.Algebra.Category.ModuleCat.Presheaf.Monoidal Mathlib.Algebra.Category.ModuleCat.Presheaf.Pullback Mathlib.Algebra.Category.ModuleCat.Presheaf.PushforwardZeroMonoidal Mathlib.Algebra.Category.ModuleCat.Presheaf.Pushforward Mathlib.Algebra.Category.ModuleCat.Presheaf.Sheafification Mathlib.Algebra.Category.ModuleCat.Presheaf.Sheafify Mathlib.Algebra.Category.ModuleCat.Presheaf Mathlib.Algebra.Category.ModuleCat.ProjectiveDimension Mathlib.Algebra.Category.ModuleCat.Pseudofunctor Mathlib.Algebra.Category.ModuleCat.Sheaf.Abelian Mathlib.Algebra.Category.ModuleCat.Sheaf.ChangeOfRings Mathlib.Algebra.Category.ModuleCat.Sheaf.Colimits Mathlib.Algebra.Category.ModuleCat.Sheaf.Free Mathlib.Algebra.Category.ModuleCat.Sheaf.Generators Mathlib.Algebra.Category.ModuleCat.Sheaf.Limits Mathlib.Algebra.Category.ModuleCat.Sheaf.Localization Mathlib.Algebra.Category.ModuleCat.Sheaf.PullbackContinuous Mathlib.Algebra.Category.ModuleCat.Sheaf.PullbackFree Mathlib.Algebra.Category.ModuleCat.Sheaf.PushforwardContinuous Mathlib.Algebra.Category.ModuleCat.Sheaf.Quasicoherent Mathlib.Algebra.Category.ModuleCat.Sheaf Mathlib.Algebra.Category.ModuleCat.Stalk Mathlib.Algebra.Colimit.Finiteness Mathlib.Algebra.Colimit.Module Mathlib.Algebra.Colimit.TensorProduct Mathlib.Algebra.Homology.ConcreteCategory Mathlib.Algebra.Homology.DerivedCategory.Ext.EnoughInjectives Mathlib.Algebra.Homology.DerivedCategory.Ext.EnoughProjectives Mathlib.Algebra.Homology.DerivedCategory.Ext.ExactSequences Mathlib.Algebra.Homology.DerivedCategory.Ext.MapBijective Mathlib.Algebra.Homology.DerivedCategory.KInjective Mathlib.Algebra.Homology.DerivedCategory.KProjective Mathlib.Algebra.Homology.DerivedCategory.SmallShiftedHom Mathlib.Algebra.Homology.HomotopyCategory.HomComplexCohomology Mathlib.Algebra.Homology.HomotopyCategory.HomComplexSingle Mathlib.Algebra.Homology.ShortComplex.Ab Mathlib.Algebra.Homology.ShortComplex.ConcreteCategory Mathlib.Algebra.Homology.ShortComplex.ModuleCat Mathlib.CategoryTheory.Abelian.Ext Mathlib.CategoryTheory.Abelian.FreydMitchell Mathlib.CategoryTheory.Abelian.GrothendieckCategory.HasExt Mathlib.CategoryTheory.Abelian.GrothendieckCategory.ModuleEmbedding.Opposite Mathlib.CategoryTheory.Abelian.Injective.Basic Mathlib.CategoryTheory.Abelian.Injective.Dimension Mathlib.CategoryTheory.Abelian.Injective.Ext Mathlib.CategoryTheory.Abelian.Projective.Basic Mathlib.CategoryTheory.Abelian.Projective.Dimension Mathlib.CategoryTheory.Abelian.Projective.Ext Mathlib.CategoryTheory.Abelian.Yoneda Mathlib.CategoryTheory.Preadditive.Yoneda.Limits Mathlib.CategoryTheory.Sites.MayerVietorisSquare Mathlib.CategoryTheory.Sites.SheafCohomology.Basic Mathlib.CategoryTheory.Sites.SheafCohomology.MayerVietoris Mathlib.CategoryTheory.Triangulated.Yoneda Mathlib.LinearAlgebra.TensorProduct.DirectLimit Mathlib.RingTheory.Morita.Basic Mathlib.Topology.Sheaves.Abelian Mathlib.Topology.Sheaves.AddCommGrpCat Mathlib.Topology.Sheaves.Flasque Mathlib.Topology.Sheaves.MayerVietoris
3
Mathlib.Algebra.Colimit.DirectLimit 221

Declarations diff

+ algebraMap_def
+ instance : Algebra R (DirectLimit G f)
+ map₀MonoidHom
+ map₀RingHom
+ map₀_algebraMap
+ map₀_mul
+ map₀_one
++ hom_ext
++ lift
++ lift_comp_of
++ lift_of
++ of
++ of_f

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.


No changes to strong technical debt.
No changes to weak technical debt.

@github-actions github-actions Bot added the t-algebra Algebra (groups, rings, fields, etc) label Apr 28, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

✅ PR Title Formatted Correctly

The title of this PR has been updated to match our commit style conventions.
Thank you!

@drocta drocta changed the title Algebra direct limit feat(Algebra/Colimit/DirectLimit): add Algebra structure for DirectLimit Apr 28, 2026
@drocta drocta marked this pull request as draft April 28, 2026 23:25
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors Bot commented Apr 28, 2026

This pull request is now in draft mode. No active bors state needed cleanup.

While this PR remains draft, bors will ignore commands on this PR. Mark it ready for review before using commands like bors r+ or bors try.

@drocta
Copy link
Copy Markdown
Contributor Author

drocta commented Apr 28, 2026

I forgot to update some things to take into account changes in #38440 which made some of the steps here unnecessary. Fixing now.
Edit: fixed now.

@drocta drocta marked this pull request as ready for review April 29, 2026 01:09
Copy link
Copy Markdown
Collaborator

@Whysoserioushah Whysoserioushah left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment thread Mathlib/Algebra/Colimit/DirectLimit.lean Outdated
Comment thread Mathlib/Algebra/Colimit/DirectLimit.lean Outdated
Comment thread Mathlib/Algebra/Colimit/DirectLimit.lean Outdated
Co-authored-by: Whysoserioushah <109107491+Whysoserioushah@users.noreply.github.com>
Comment thread Mathlib/Algebra/Colimit/DirectLimit.lean Outdated
Comment thread Mathlib/Algebra/Colimit/DirectLimit.lean
Comment thread Mathlib/Algebra/Colimit/DirectLimit.lean
Comment thread Mathlib/Algebra/Colimit/DirectLimit.lean Outdated
@eric-wieser eric-wieser added the awaiting-author A reviewer has asked the author a question or requested changes. label May 5, 2026
Comment thread Mathlib/Algebra/Colimit/DirectLimit.lean Outdated
@eric-wieser
Copy link
Copy Markdown
Member

I realize I led you astray with map₀RingHom earlier, I pushed a simplification

Comment thread Mathlib/Algebra/Colimit/DirectLimit.lean Outdated
Comment thread Mathlib/Algebra/Colimit/DirectLimit.lean Outdated
let ⟨i⟩ := ‹Nonempty ι›
rw [one_def, lift_def, map_one (g i)]

@[to_additive]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
@[to_additive]
@[to_additive (attr := simp)]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will do.
Btw, in map₀ f (1 : ∀ i, G i) = 1, it does still work as just map₀ f 1 = 1, but I thought it was easier to understand what the lemma is saying with the type ascription. Is that alright, or would it be better to omit the type ascription?

Comment thread Mathlib/Algebra/Colimit/DirectLimit.lean Outdated
Comment thread Mathlib/Algebra/Colimit/DirectLimit.lean Outdated
Comment thread Mathlib/Algebra/Colimit/DirectLimit.lean Outdated
drocta and others added 5 commits May 6, 2026 17:05
@[simp]
theorem lift_comp_of {i} : (lift G f P g Hg).comp (of G f i) = g i := rfl

@[simp] theorem lift_of (i x) : lift G f P g Hg (of G f i x) = g i x := rfl
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a little surprised the linter doesn't reject this attribute; it's not on any of the other lift_ofs, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, indeed, it isn't on any of the existing ones. Not sure how I got it into my head to add it here (and in the unital algebra case). I'll take them off.

Copy link
Copy Markdown
Member

@eric-wieser eric-wieser 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+

Thanks!

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors Bot commented May 7, 2026

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

@mathlib-triage mathlib-triage Bot added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-author A reviewer has asked the author a question or requested changes. labels May 7, 2026
@drocta
Copy link
Copy Markdown
Contributor Author

drocta commented May 7, 2026

bors r+

mathlib-bors Bot pushed a commit that referenced this pull request May 7, 2026
…mit (#38672)

add `Algebra` instance to `DirectLimit`. also add a few lemmas for it for the algebra map, and also define the `of`, `lift`, and the `of_f`, `lift_of` and `hom_ext` lemmas for it.

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors Bot commented May 7, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat(Algebra/Colimit/DirectLimit): add Algebra structure for DirectLimit [Merged by Bors] - feat(Algebra/Colimit/DirectLimit): add Algebra structure for DirectLimit May 7, 2026
@mathlib-bors mathlib-bors Bot closed this May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). large-import Automatically added label for PRs with a significant increase in transitive imports new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants