mathlib4 icon indicating copy to clipboard operation
mathlib4 copied to clipboard

feat(Algebra/Category/ModuleCat): the pseudofunctors which send a ring to its category of modules

Open joelriou opened this issue 1 year ago • 2 comments

In this PR, we construct the pseudofunctor ModuleCat.restrictScalarsPseudofunctor : Pseudofunctor (LocallyDiscrete RingCatᵒᵖ) Cat which sends a ring R to its category of modules: the contravariant functoriality is given by the restriction of scalars functors. We also define ModuleCat.extendScalarsPseudofunctor : Pseudofunctor (LocallyDiscrete CommRingCat) Cat: the covariant functoriality is given by the extension of scalars functors.


  • [x] depends on: #18201

Open in Gitpod

joelriou avatar Oct 24 '24 18:10 joelriou

PR summary 7e993308df

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
13 files Mathlib.Algebra.Category.ModuleCat.Differentials.Basic Mathlib.Algebra.Category.ModuleCat.ChangeOfRings Mathlib.Algebra.Category.ModuleCat.Presheaf.Limits Mathlib.Algebra.Category.ModuleCat.Differentials.Presheaf Mathlib.Algebra.Category.ModuleCat.EnoughInjectives Mathlib.Algebra.Category.ModuleCat.Presheaf.Colimits Mathlib.Algebra.Category.ModuleCat.Presheaf Mathlib.Algebra.Category.ModuleCat.Presheaf.EpiMono Mathlib.Algebra.Category.ModuleCat.Presheaf.Monoidal Mathlib.Algebra.Category.ModuleCat.Presheaf.Abelian Mathlib.Algebra.Category.ModuleCat.Presheaf.Pushforward Mathlib.Algebra.Category.ModuleCat.Presheaf.ChangeOfRings Mathlib.Algebra.Category.ModuleCat.Presheaf.Free
1
Mathlib.Algebra.Category.ModuleCat.Pseudofunctor (new file) 1258

Declarations diff

+ CommRingCat.moduleCatExtendScalarsPseudofunctor + CommRingCat.moduleCatRestrictScalarsPseudofunctor + RingCat.moduleCatRestrictScalarsPseudofunctor + extendRestrictScalarsAdj_homEquiv_apply + extendRestrictScalarsAdj_unit_app_apply + extendScalarsComp + extendScalarsComp_hom_app_one_tmul + extendScalarsId + extendScalarsId_hom_app_one_tmul + extendScalarsId_inv_app_apply + extendScalars_assoc + extendScalars_assoc' + extendScalars_comp_id + extendScalars_id_comp + homEquiv_extendScalarsComp + homEquiv_extendScalarsId + hom_ext

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.


Increase in tech debt: (relative, absolute) = (5.00, 0.00)
Current number Change Type
1508 5 erw

Current commit 7e993308df Reference commit 42764fbc0a

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).

github-actions[bot] avatar Oct 24 '24 18:10 github-actions[bot]

This PR/issue depends on:

  • ~~leanprover-community/mathlib4#18201~~ By Dependent Issues (🤖). Happy coding!

This all looks good to me, the only problem is that there are a lot of erws. I looked into this (see zulip), and I think all but one of your erws (the comp_apply one) would not be necessary if there was a dsimp% elaborator. Then, instead of erw [lemma] you would type rw [dsimp% lemma]. Making such an elaborator should be very easy (if it does not already exist), and I might have time to do this on Sunday if you can wait for that. But I am happy to have this merged also. I also left some small comments that are more like questions and do not need fixing.

Is this related to the feature I suggested at https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/attribute.20simp_NF_my_lemma.3F/near/443101462

joelriou avatar Nov 12 '24 14:11 joelriou

This PR was included in a batch that was canceled, it will be automatically retried

mathlib-bors[bot] avatar Dec 20 '24 14:12 mathlib-bors[bot]

Build failed (retrying...):

mathlib-bors[bot] avatar Dec 20 '24 14:12 mathlib-bors[bot]

probably causing the bors failure After the batch is merged, please merge master

bors r- bors d+

fpvandoorn avatar Dec 20 '24 15:12 fpvandoorn

:v: joelriou 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-bors[bot] avatar Dec 20 '24 15:12 mathlib-bors[bot]

Canceled.

mathlib-bors[bot] avatar Dec 20 '24 15:12 mathlib-bors[bot]

Retrying...

bors merge

joelriou avatar Dec 20 '24 15:12 joelriou

Pull request successfully merged into master.

Build succeeded:

mathlib-bors[bot] avatar Dec 20 '24 16:12 mathlib-bors[bot]