Skip to content

Commit e5e233f

Browse files
committed
feat(CategoryTheory/SingleObj): add functor and NatTrans constructors for SingleObj (#9586)
Adds constructors for functors of type `SingleObj α ⥤ C` and natural transformations of functors `SingleObj α ⥤ C`.
1 parent 497ed07 commit e5e233f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Mathlib/CategoryTheory/SingleObj.lean

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,25 @@ def differenceFunctor {C G} [Category C] [Group G] (f : C → G) : C ⥤ SingleO
156156
rw [SingleObj.comp_as_mul, ← mul_assoc, mul_left_inj, mul_assoc, inv_mul_self, mul_one]
157157
#align category_theory.single_obj.difference_functor CategoryTheory.SingleObj.differenceFunctor
158158

159+
/-- A monoid homomorphism `f: α → End X` into the endomorphisms of an object `X` of a category `C`
160+
induces a functor `SingleObj α ⥤ C`. -/
161+
@[simps]
162+
def functor {α : Type u} [Monoid α] {C : Type w} [Category.{v} C] {X : C} (f : α →* End X) :
163+
SingleObj α ⥤ C where
164+
obj _ := X
165+
map a := f a
166+
map_id _ := MonoidHom.map_one f
167+
map_comp a b := MonoidHom.map_mul f b a
168+
169+
/-- Construct a natural transformation between functors `SingleObj α ⥤ C` by
170+
giving a compatible morphism `SingleObj.star α`. -/
171+
@[simps]
172+
def natTrans {α : Type w} {C : Type w} [Category.{v} C] [Monoid α] {F G : SingleObj α ⥤ C}
173+
(u : F.obj (SingleObj.star α) ⟶ G.obj (SingleObj.star α))
174+
(h : ∀ a : α, F.map a ≫ u = u ≫ G.map a) : F ⟶ G where
175+
app _ := u
176+
naturality _ _ a := h a
177+
159178
end SingleObj
160179

161180
end CategoryTheory

0 commit comments

Comments
 (0)