Skip to content

Commit a3fde50

Browse files
committed
chore(CategoryTheory): use notation for TypeCat.ofHom (#38655)
Replace uses of `TypeCat.ofHom` in the library by the notation `↾`. Also makes the notation scoped in `CategoryTheory` instead of `TypeCat`.
1 parent 2af034a commit a3fde50

139 files changed

Lines changed: 404 additions & 397 deletions

File tree

Some content is hidden

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

Mathlib/Algebra/Category/AlgCat/Basic.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ set_option backward.isDefEq.respectTransparency false in
192192
def adj : free.{u} R ⊣ forget (AlgCat.{u} R) :=
193193
Adjunction.mkOfHomEquiv
194194
{ homEquiv := fun _ _ =>
195-
{ toFun := fun f ↦ TypeCat.ofHom ((FreeAlgebra.lift _).symm f.hom)
195+
{ toFun := fun f ↦ ((FreeAlgebra.lift _).symm f.hom)
196196
invFun := fun f ↦ ofHom <| (FreeAlgebra.lift _) f
197197
left_inv := fun f ↦ by aesop
198198
right_inv := fun f ↦ by aesop } }
@@ -229,8 +229,8 @@ end CategoryTheory.Iso
229229
@[simps]
230230
def algEquivIsoAlgebraIso {X Y : Type u} [Ring X] [Ring Y] [Algebra R X] [Algebra R Y] :
231231
(X ≃ₐ[R] Y) ≅ (AlgCat.of R X ≅ AlgCat.of R Y) where
232-
hom := TypeCat.ofHom (fun e ↦ e.toAlgebraIso)
233-
inv := TypeCat.ofHom (fun i ↦ i.toAlgEquiv)
232+
hom := fun e ↦ e.toAlgebraIso
233+
inv := fun i ↦ i.toAlgEquiv
234234

235235
instance AlgCat.forget_reflects_isos : (forget (AlgCat.{u} R)).ReflectsIsomorphisms where
236236
reflects {X Y} f _ := by

Mathlib/Algebra/Category/Grp/Adjunctions.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ instance : (free.{u}).PreservesMonomorphisms where
104104
((Types.initial_iff_empty X).2 hX).some).isZero.eq_of_tgt
105105
· have hf : Function.Injective f := by rwa [← mono_iff_injective]
106106
obtain ⟨g, hg⟩ := hf.hasLeftInverse
107-
have : IsSplitMono f := IsSplitMono.mk' { retraction := TypeCat.ofHom g }
107+
have : IsSplitMono f := IsSplitMono.mk' { retraction := g }
108108
infer_instance
109109

110110
end AddCommGrpCat

Mathlib/Algebra/Category/Grp/Basic.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,8 @@ end CategoryTheory.Iso
544544
in `GrpCat` -/
545545
@[to_additive]
546546
def mulEquivIsoGroupIso {X Y : GrpCat.{u}} : (X ≃* Y) ≅ (X ≅ Y) where
547-
hom := TypeCat.ofHom (fun e ↦ e.toGrpIso)
548-
inv := TypeCat.ofHom (fun i ↦ i.groupIsoToMulEquiv)
547+
hom := fun e ↦ e.toGrpIso
548+
inv := fun i ↦ i.groupIsoToMulEquiv
549549

550550
/-- Additive equivalences between `AddGroup`s are the same
551551
as (isomorphic to) isomorphisms in `AddGrpCat`. -/
@@ -555,8 +555,8 @@ add_decl_doc addEquivIsoAddGroupIso
555555
in `CommGrpCat`. -/
556556
@[to_additive]
557557
def mulEquivIsoCommGroupIso {X Y : CommGrpCat.{u}} : (X ≃* Y) ≅ (X ≅ Y) where
558-
hom := TypeCat.ofHom (fun e ↦ e.toCommGrpIso)
559-
inv := TypeCat.ofHom (fun i ↦ i.commGroupIsoToMulEquiv)
558+
hom := fun e ↦ e.toCommGrpIso
559+
inv := fun i ↦ i.commGroupIsoToMulEquiv
560560

561561
/-- Additive equivalences between `AddCommGroup`s are
562562
the same as (isomorphic to) isomorphisms in `AddCommGrpCat`. -/

Mathlib/Algebra/Category/Grp/Yoneda.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ coyoneda embedding. -/]
3535
def CommGrpCat.coyonedaForget :
3636
coyoneda ⋙ (Functor.whiskeringRight _ _ _).obj (forget _) ≅ CategoryTheory.coyoneda :=
3737
dsimp% NatIso.ofComponents fun X ↦ NatIso.ofComponents fun Y ↦ {
38-
hom := TypeCat.ofHom (fun f ↦ ofHom f),
39-
inv := TypeCat.ofHom (fun f ↦ f.hom) }
38+
hom := fun f ↦ ofHom f,
39+
inv := fun f ↦ f.hom }
4040

4141
/-- The Hom bifunctor sending a type `X` and a commutative group `G` to the commutative group
4242
`X → G` with pointwise operations.

Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ lemma free_map_apply {X Y : Type u} (f : X ⟶ Y) (x : X) :
7575
@[simps]
7676
def freeHomEquiv {X : Type u} {M : ModuleCat.{u} R} :
7777
((free R).obj X ⟶ M) ≃ (X ⟶ M) where
78-
toFun φ := TypeCat.ofHom (fun x ↦ φ (freeMk x))
79-
invFun ψ := freeDesc (TypeCat.ofHom ψ)
78+
toFun φ := fun x ↦ φ (freeMk x)
79+
invFun ψ := freeDesc (ψ)
8080
left_inv _ := by ext; simp
8181
right_inv _ := by ext; simp
8282

Mathlib/Algebra/Category/ModuleCat/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ in `ModuleCat` -/
299299
@[simps]
300300
def linearEquivIsoModuleIso {X Y : Type u} [AddCommGroup X] [AddCommGroup Y] [Module R X]
301301
[Module R Y] : (X ≃ₗ[R] Y) ≅ (ModuleCat.of R X ≅ ModuleCat.of R Y) where
302-
hom := TypeCat.ofHom (fun e ↦ e.toModuleIso)
303-
inv := TypeCat.ofHom (fun i ↦ i.toLinearEquiv)
302+
hom := fun e ↦ e.toModuleIso
303+
inv := fun i ↦ i.toLinearEquiv
304304

305305
end
306306

Mathlib/Algebra/Category/ModuleCat/LeftResolution.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ instance (X : Type u) : Projective ((free R).obj X) where
3434
factors {M N} f p hp := by
3535
rw [epi_iff_surjective] at hp
3636
obtain ⟨s, hs⟩ := hp.hasRightInverse
37-
exact ⟨freeDesc (TypeCat.ofHom (fun x ↦ s (f (freeMk x)))), by cat_disch⟩
37+
exact ⟨freeDesc (fun x ↦ s (f (freeMk x))), by cat_disch⟩
3838

3939
set_option backward.isDefEq.respectTransparency false in
4040
/-- An `R`-module `M` can be functorially written as a quotient of a

Mathlib/Algebra/Category/ModuleCat/Presheaf/ColimitFunctor.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ by `cR.pt` on `ModuleColimit hcR hcM`. -/
7979
noncomputable def coconeSMul :
8080
Cocone (R ⋙ forget _ ⊗ M.presheaf ⋙ forget _) where
8181
pt := ModuleColimit hcR hcM
82-
ι.app U := TypeCat.ofHom fun ⟨(r : R.obj U), (m : M.obj U)⟩ ↦ by exact cM.ι.app U (r • m)
82+
ι.app U := fun ⟨(r : R.obj U), (m : M.obj U)⟩ ↦ by exact cM.ι.app U (r • m)
8383
ι.naturality V U f := by
8484
ext ⟨r, m⟩
8585
exact (ConcreteCategory.congr_arg (cM.ι.app U)

Mathlib/Algebra/Category/ModuleCat/Presheaf/Free.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ of modules over `R` which sends `X : Cᵒᵖ` to the free `R.obj X`-module on `F
4141
@[simps]
4242
noncomputable def freeObj (F : Cᵒᵖ ⥤ Type u) : PresheafOfModules.{u} R where
4343
obj X := (ModuleCat.free (R.obj X)).obj (F.obj X)
44-
map {X Y} f := ModuleCat.freeDesc (TypeCat.ofHom (fun x ↦ ModuleCat.freeMk (F.map f x)))
44+
map {X Y} f := ModuleCat.freeDesc (fun x ↦ ModuleCat.freeMk (F.map f x))
4545
map_id := by aesop
4646

4747
/-- The free presheaf of modules functor `(Cᵒᵖ ⥤ Type u) ⥤ PresheafOfModules.{u} R`. -/
@@ -71,7 +71,7 @@ variable (F R) in
7171
/-- The unit of `PresheafOfModules.freeAdjunction`. -/
7272
@[simps]
7373
noncomputable def freeAdjunctionUnit : F ⟶ (freeObj (R := R) F).presheaf ⋙ forget _ where
74-
app X := TypeCat.ofHom (fun x ↦ ModuleCat.freeMk x)
74+
app X := fun x ↦ ModuleCat.freeMk x
7575
naturality X Y f := by ext; simp [presheaf]
7676

7777
set_option backward.isDefEq.respectTransparency false in

Mathlib/Algebra/Category/ModuleCat/Semi.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ in `SemimoduleCat` -/
273273
def linearEquivIsoModuleIsoₛ {X Y : Type u} [AddCommMonoid X] [AddCommMonoid Y] [Module R X]
274274
[Module R Y] : (X ≃ₗ[R] Y) ≅
275275
((SemimoduleCat.of R X) ≅ (SemimoduleCat.of R Y)) where
276-
hom := TypeCat.ofHom (fun e ↦ e.toModuleIsoₛ)
277-
inv := TypeCat.ofHom (fun i ↦ i.toLinearEquivₛ)
276+
hom := fun e ↦ e.toModuleIsoₛ
277+
inv := fun i ↦ i.toLinearEquivₛ
278278

279279
end
280280

0 commit comments

Comments
 (0)