Skip to content

Commit 65b7aff

Browse files
committed
chore(CategoryTheory): move Full, Faithful, EssSurj, IsEquivalence and ReflectsIsomorphisms to the Functor namespace (#11985)
These notions on functors are now `Functor.Full`, `Functor.Faithful`, `Functor.EssSurj`, `Functor.IsEquivalence`, `Functor.ReflectsIsomorphisms`. Deprecated aliases are introduced for the previous names.
1 parent eb0a213 commit 65b7aff

File tree

177 files changed

+840
-782
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+840
-782
lines changed

Mathlib/Algebra/Category/AlgebraCat/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def algEquivIsoAlgebraIso {X Y : Type u} [Ring X] [Ring Y] [Algebra R X] [Algebr
247247
instance (X : Type u) [Ring X] [Algebra R X] : CoeOut (Subalgebra R X) (AlgebraCat R) :=
248248
fun N => AlgebraCat.of R N⟩
249249

250-
instance AlgebraCat.forget_reflects_isos : ReflectsIsomorphisms (forget (AlgebraCat.{u} R)) where
250+
instance AlgebraCat.forget_reflects_isos : (forget (AlgebraCat.{u} R)).ReflectsIsomorphisms where
251251
reflects {X Y} f _ := by
252252
let i := asIso ((forget (AlgebraCat.{u} R)).map f)
253253
let e : X ≃ₐ[R] Y := { f, i.toEquiv with }

Mathlib/Algebra/Category/AlgebraCat/Monoidal.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def toModuleCatMonoidalFunctor : MonoidalFunctor (AlgebraCat.{u} R) (ModuleCat.{
9999
unfold instMonoidalCategory
100100
exact Monoidal.fromInduced (forget₂ (AlgebraCat R) (ModuleCat R)) _
101101

102-
instance : Faithful (toModuleCatMonoidalFunctor R).toFunctor :=
102+
instance : (toModuleCatMonoidalFunctor R).Faithful :=
103103
forget₂_faithful _ _
104104

105105
end

Mathlib/Algebra/Category/AlgebraCat/Symmetric.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ variable (R) in
3535
def toModuleCatBraidedFunctor : BraidedFunctor (AlgebraCat.{u} R) (ModuleCat.{u} R) where
3636
toMonoidalFunctor := toModuleCatMonoidalFunctor R
3737

38-
instance : Faithful (toModuleCatBraidedFunctor R).toFunctor :=
38+
instance : (toModuleCatBraidedFunctor R).Faithful :=
3939
forget₂_faithful _ _
4040

4141
instance instSymmetricCategory : SymmetricCategory (AlgebraCat.{u} R) :=

Mathlib/Algebra/Category/FGModuleCat/Basic.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ instance : HasForget₂ (FGModuleCat.{u} R) (ModuleCat.{u} R) := by
118118
dsimp [FGModuleCat]
119119
infer_instance
120120

121-
instance : Full (forget₂ (FGModuleCat R) (ModuleCat.{u} R)) where
121+
instance : (forget₂ (FGModuleCat R) (ModuleCat.{u} R)).Full where
122122
preimage f := f
123123

124124
variable {R}
@@ -183,19 +183,19 @@ def forget₂Monoidal : MonoidalFunctor (FGModuleCat R) (ModuleCat.{u} R) :=
183183
MonoidalCategory.fullMonoidalSubcategoryInclusion _
184184
#align fgModule.forget₂_monoidal FGModuleCat.forget₂Monoidal
185185

186-
instance forget₂Monoidal_faithful : Faithful (forget₂Monoidal R).toFunctor := by
186+
instance forget₂Monoidal_faithful : (forget₂Monoidal R).Faithful := by
187187
dsimp [forget₂Monoidal]
188188
-- Porting note (#11187): was `infer_instance`
189189
exact FullSubcategory.faithful _
190190
#align fgModule.forget₂_monoidal_faithful FGModuleCat.forget₂Monoidal_faithful
191191

192-
instance forget₂Monoidal_additive : (forget₂Monoidal R).toFunctor.Additive := by
192+
instance forget₂Monoidal_additive : (forget₂Monoidal R).Additive := by
193193
dsimp [forget₂Monoidal]
194194
-- Porting note (#11187): was `infer_instance`
195195
exact Functor.fullSubcategoryInclusion_additive _
196196
#align fgModule.forget₂_monoidal_additive FGModuleCat.forget₂Monoidal_additive
197197

198-
instance forget₂Monoidal_linear : (forget₂Monoidal R).toFunctor.Linear R := by
198+
instance forget₂Monoidal_linear : (forget₂Monoidal R).Linear R := by
199199
dsimp [forget₂Monoidal]
200200
-- Porting note (#11187): was `infer_instance`
201201
exact Functor.fullSubcategoryInclusionLinear _ _

Mathlib/Algebra/Category/GroupCat/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ set_option linter.uppercaseLean3 false in
485485
end CategoryTheory.Aut
486486

487487
@[to_additive]
488-
instance GroupCat.forget_reflects_isos : ReflectsIsomorphisms (forget GroupCat.{u}) where
488+
instance GroupCat.forget_reflects_isos : (forget GroupCat.{u}).ReflectsIsomorphisms where
489489
reflects {X Y} f _ := by
490490
let i := asIso ((forget GroupCat).map f)
491491
let e : X ≃* Y := { i.toEquiv with map_mul' := map_mul _ }
@@ -496,7 +496,7 @@ set_option linter.uppercaseLean3 false in
496496
#align AddGroup.forget_reflects_isos AddGroupCat.forget_reflects_isos
497497

498498
@[to_additive]
499-
instance CommGroupCat.forget_reflects_isos : ReflectsIsomorphisms (forget CommGroupCat.{u}) where
499+
instance CommGroupCat.forget_reflects_isos : (forget CommGroupCat.{u}).ReflectsIsomorphisms where
500500
reflects {X Y} f _ := by
501501
let i := asIso ((forget CommGroupCat).map f)
502502
let e : X ≃* Y := { i.toEquiv with map_mul' := map_mul _}

Mathlib/Algebra/Category/GroupCat/Limits.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ reuse the existing limit."]
8686
noncomputable instance Forget₂.createsLimit :
8787
CreatesLimit F (forget₂ GroupCat.{u} MonCat.{u}) :=
8888
-- Porting note: need to add `forget₂ GrpCat MonCat` reflects isomorphism
89-
letI : ReflectsIsomorphisms (forget₂ GroupCat.{u} MonCat.{u}) :=
89+
letI : (forget₂ GroupCat.{u} MonCat.{u}).ReflectsIsomorphisms :=
9090
CategoryTheory.reflectsIsomorphisms_forget₂ _ _
9191
createsLimitOfReflectsIso (K := F) (F := (forget₂ GroupCat.{u} MonCat.{u}))
9292
fun c' t =>
@@ -258,7 +258,7 @@ and then reuse the existing limit.
258258
and then reuse the existing limit."]
259259
noncomputable instance Forget₂.createsLimit :
260260
CreatesLimit F (forget₂ CommGroupCat GroupCat.{u}) :=
261-
letI : ReflectsIsomorphisms (forget₂ CommGroupCat.{u} GroupCat.{u}) :=
261+
letI : (forget₂ CommGroupCat.{u} GroupCat.{u}).ReflectsIsomorphisms :=
262262
CategoryTheory.reflectsIsomorphisms_forget₂ _ _
263263
letI : Small.{u}
264264
(Functor.sections ((F ⋙ forget₂ CommGroupCat GroupCat) ⋙ forget GroupCat)) :=

Mathlib/Algebra/Category/GroupCat/ZModuleEquivalence.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ universe u
2626
namespace ModuleCat
2727

2828
/-- The forgetful functor from `ℤ` modules to `AddCommGroup` is full. -/
29-
instance forget₂AddCommGroupFull : Full (forget₂ (ModuleCat ℤ) AddCommGroupCat.{u}) where
29+
instance forget₂AddCommGroupFull : (forget₂ (ModuleCat ℤ) AddCommGroupCat.{u}).Full where
3030
preimage {A B}
3131
-- `AddMonoidHom.toIntLinearMap` doesn't work here because `A` and `B` are not
3232
-- definitionally equal to the canonical `AddCommGroup.intModule` module
@@ -41,7 +41,7 @@ set_option linter.uppercaseLean3 false in
4141
#align Module.forget₂_AddCommGroup_full ModuleCat.forget₂AddCommGroupFull
4242

4343
/-- The forgetful functor from `ℤ` modules to `AddCommGroup` is essentially surjective. -/
44-
instance forget₂_addCommGroupCat_essSurj : EssSurj (forget₂ (ModuleCat ℤ) AddCommGroupCat.{u}) where
44+
instance forget₂_addCommGroupCat_essSurj : (forget₂ (ModuleCat ℤ) AddCommGroupCat.{u}).EssSurj where
4545
mem_essImage A :=
4646
⟨ModuleCat.of ℤ A,
4747
⟨{ hom := 𝟙 A
@@ -50,8 +50,8 @@ set_option linter.uppercaseLean3 false in
5050
#align Module.forget₂_AddCommGroup_ess_surj ModuleCat.forget₂_addCommGroupCat_essSurj
5151

5252
noncomputable instance forget₂AddCommGroupIsEquivalence :
53-
IsEquivalence (forget₂ (ModuleCat ℤ) AddCommGroupCat.{u}) :=
54-
Equivalence.ofFullyFaithfullyEssSurj (forget₂ (ModuleCat ℤ) AddCommGroupCat)
53+
(forget₂ (ModuleCat ℤ) AddCommGroupCat.{u}).IsEquivalence :=
54+
Functor.IsEquivalence.ofFullyFaithfullyEssSurj (forget₂ (ModuleCat ℤ) AddCommGroupCat)
5555
set_option linter.uppercaseLean3 false in
5656
#align Module.forget₂_AddCommGroup_is_equivalence ModuleCat.forget₂AddCommGroupIsEquivalence
5757

Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def restrictScalars {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →
8484
#align category_theory.Module.restrict_scalars ModuleCat.restrictScalars
8585

8686
instance {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S) :
87-
CategoryTheory.Faithful (restrictScalars.{v} f) where
87+
(restrictScalars.{v} f).Faithful where
8888
map_injective h :=
8989
LinearMap.ext fun x => by simpa only using DFunLike.congr_fun h x
9090

@@ -216,7 +216,7 @@ abbrev restrictScalarsComp := restrictScalarsComp'.{v} f g _ rfl
216216
end
217217

218218
instance restrictScalarsIsEquivalenceOfRingEquiv {R S} [Ring R] [Ring S] (e : R ≃+* S) :
219-
IsEquivalence (ModuleCat.restrictScalars e.toRingHom) where
219+
(ModuleCat.restrictScalars e.toRingHom).IsEquivalence where
220220
inverse := ModuleCat.restrictScalars e.symm
221221
unitIso := NatIso.ofComponents (fun M ↦ LinearEquiv.toModuleIso'
222222
{ __ := AddEquiv.refl M

Mathlib/Algebra/Category/ModuleCat/Presheaf.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ lemma toPresheaf_map_app {P Q : PresheafOfModules R}
208208

209209
instance : (toPresheaf R).Additive where
210210

211-
instance : Faithful (toPresheaf R) where
211+
instance : (toPresheaf R).Faithful where
212212
map_injective {P Q} f g h := by
213213
ext X x
214214
have eq := congr_app h X

Mathlib/Algebra/Category/MonCat/Basic.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ the same as (isomorphic to) isomorphisms in `AddCommMonCat` -/
402402
add_decl_doc addEquivIsoAddCommMonCatIso
403403

404404
@[to_additive]
405-
instance MonCat.forget_reflects_isos : ReflectsIsomorphisms (forget MonCat.{u}) where
405+
instance MonCat.forget_reflects_isos : (forget MonCat.{u}).ReflectsIsomorphisms where
406406
reflects {X Y} f _ := by
407407
let i := asIso ((forget MonCat).map f)
408408
-- Again a problem that exists already creeps into other things leanprover/lean4#2644
@@ -415,7 +415,7 @@ set_option linter.uppercaseLean3 false in
415415
#align AddMon.forget_reflects_isos AddMonCat.forget_reflects_isos
416416

417417
@[to_additive]
418-
instance CommMonCat.forget_reflects_isos : ReflectsIsomorphisms (forget CommMonCat.{u}) where
418+
instance CommMonCat.forget_reflects_isos : (forget CommMonCat.{u}).ReflectsIsomorphisms where
419419
reflects {X Y} f _ := by
420420
let i := asIso ((forget CommMonCat).map f)
421421
let e : X ≃* Y := MulEquiv.mk i.toEquiv
@@ -431,6 +431,6 @@ set_option linter.uppercaseLean3 false in
431431
-- automatically reflects isomorphisms
432432
-- we could have used `CategoryTheory.ConcreteCategory.ReflectsIso` alternatively
433433
@[to_additive]
434-
instance CommMonCat.forget₂Full : Full (forget₂ CommMonCat MonCat) where preimage f := f
434+
instance CommMonCat.forget₂Full : (forget₂ CommMonCat MonCat).Full where preimage f := f
435435

436-
example : ReflectsIsomorphisms (forget₂ CommMonCat MonCat) := inferInstance
436+
example : (forget₂ CommMonCat MonCat).ReflectsIsomorphisms := inferInstance

0 commit comments

Comments
 (0)