File: Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean

full_name: ModuleCat.free_map
code: /-- The free functor `Type u ⥤ ModuleCat R` sending a type `X` to the
free `R`-module with generators `x : X`, implemented as the type `X →₀ R`.
-/
@[simps]
def free : Type u ⥤ ModuleCat R 
goal: (ModuleCat.free R).map f = Finsupp.lmapDomain R R f

full_name: ModuleCat.free_obj
code: /-- The free functor `Type u ⥤ ModuleCat R` sending a type `X` to the
free `R`-module with generators `x : X`, implemented as the type `X →₀ R`.
-/
@[simps]
def free : Type u ⥤ ModuleCat R 
goal: (ModuleCat.free R).obj X = ModuleCat.of R (X →₀ R)

full_name: ModuleCat.free
code: /-- The free functor `Type u ⥤ ModuleCat R` sending a type `X` to the
free `R`-module with generators `x : X`, implemented as the type `X →₀ R`.
-/
@[simps]
def free : Type u ⥤ ModuleCat R 
goal: Type u ⥤ ModuleCat R

full_name: ModuleCat.adj
code: /-- The free-forgetful adjunction for R-modules.
-/
def adj : free R ⊣ forget (ModuleCat.{u} R) 
goal: ModuleCat.free R ⊣ CategoryTheory.forget (ModuleCat R)

full_name: ModuleCat.instIsRightAdjointForget
code: instance : (forget (ModuleCat.{u} R)).IsRightAdjoint  
goal: (CategoryTheory.forget (ModuleCat R)).IsRightAdjoint

full_name: ModuleCat.Free.ε
code: /-- (Implementation detail) The unitor for `Free R`. -/
def ε : 𝟙_ (ModuleCat.{u} R) ⟶ (free R).obj (𝟙_ (Type u)) 
goal: 𝟙_ (ModuleCat R) ⟶ (ModuleCat.free R).obj (𝟙_ (Type u))

full_name: ModuleCat.Free.ε_apply
code: @[simp, nolint simpNF]
theorem ε_apply (r : R) : ε R r = Finsupp.single PUnit.unit r 
goal: (ModuleCat.Free.ε R) r = Finsupp.single PUnit.unit r

full_name: ModuleCat.Free.μ
code: /-- (Implementation detail) The tensorator for `Free R`. -/
def μ (α β : Type u) : (free R).obj α ⊗ (free R).obj β ≅ (free R).obj (α ⊗ β) 
goal: CategoryTheory.MonoidalCategory.tensorObj ((ModuleCat.free R).obj α) ((ModuleCat.free R).obj β) ≅
  (ModuleCat.free R).obj (CategoryTheory.MonoidalCategory.tensorObj α β)

full_name: ModuleCat.Free.μ_natural
code: theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
    ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) 
goal: CategoryTheory.MonoidalCategory.tensorHom ((ModuleCat.free R).map f) ((ModuleCat.free R).map g) ≫
    (ModuleCat.Free.μ R Y Y').hom =
  (ModuleCat.Free.μ R X X').hom ≫ (ModuleCat.free R).map (CategoryTheory.MonoidalCategory.tensorHom f g)

full_name: ModuleCat.Free.left_unitality
code: theorem left_unitality (X : Type u) :
    (λ_ ((free R).obj X)).hom =
      (ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).obj (λ_ X).hom 
goal: (CategoryTheory.MonoidalCategory.leftUnitor ((ModuleCat.free R).obj X)).hom =
  CategoryTheory.MonoidalCategory.tensorHom (ModuleCat.Free.ε R) (𝟙 ((ModuleCat.free R).obj X)) ≫
    (ModuleCat.Free.μ R (𝟙_ (Type u)) X).hom ≫
      CategoryTheory.map (ModuleCat.free R).obj (CategoryTheory.MonoidalCategory.leftUnitor X).hom

full_name: ModuleCat.Free.right_unitality
code: theorem right_unitality (X : Type u) :
    (ρ_ ((free R).obj X)).hom =
      (𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom 
goal: (CategoryTheory.MonoidalCategory.rightUnitor ((ModuleCat.free R).obj X)).hom =
  CategoryTheory.MonoidalCategory.tensorHom (𝟙 ((ModuleCat.free R).obj X)) (ModuleCat.Free.ε R) ≫
    (ModuleCat.Free.μ R X (𝟙_ (Type u))).hom ≫
      CategoryTheory.map (ModuleCat.free R).obj (CategoryTheory.MonoidalCategory.rightUnitor X).hom

full_name: ModuleCat.Free.associativity
code: theorem associativity (X Y Z : Type u) :
    ((μ R X Y).hom ⊗ 𝟙 ((free R).obj Z)) ≫ (μ R (X ⊗ Y) Z).hom ≫ map (free R).obj (α_ X Y Z).hom =
      (α_ ((free R).obj X) ((free R).obj Y) ((free R).obj Z)).hom ≫
        (𝟙 ((free R).obj X) ⊗ (μ R Y Z).hom) ≫ (μ R X (Y ⊗ Z)).hom 
goal: CategoryTheory.MonoidalCategory.tensorHom (ModuleCat.Free.μ R X Y).hom (𝟙 ((ModuleCat.free R).obj Z)) ≫
    (ModuleCat.Free.μ R (CategoryTheory.MonoidalCategory.tensorObj X Y) Z).hom ≫
      CategoryTheory.map (ModuleCat.free R).obj (CategoryTheory.MonoidalCategory.associator X Y Z).hom =
  (CategoryTheory.MonoidalCategory.associator ((ModuleCat.free R).obj X) ((ModuleCat.free R).obj Y)
        ((ModuleCat.free R).obj Z)).hom ≫
    CategoryTheory.MonoidalCategory.tensorHom (𝟙 ((ModuleCat.free R).obj X)) (ModuleCat.Free.μ R Y Z).hom ≫
      (ModuleCat.Free.μ R X (CategoryTheory.MonoidalCategory.tensorObj Y Z)).hom

full_name: ModuleCat.Free.instLaxMonoidalObjFree_ε
code: /-- The free R-module functor is lax monoidal. -/
@[simps]
instance : LaxMonoidal.{u} (free R).obj 
goal: CategoryTheory.LaxMonoidal.ε = ModuleCat.Free.ε R

full_name: ModuleCat.Free.instLaxMonoidalObjFree_μ
code: /-- The free R-module functor is lax monoidal. -/
@[simps]
instance : LaxMonoidal.{u} (free R).obj 
goal: CategoryTheory.LaxMonoidal.μ X Y = (ModuleCat.Free.μ R X Y).hom

full_name: ModuleCat.Free.instLaxMonoidalObjFree
code: /-- The free R-module functor is lax monoidal. -/
@[simps]
instance : LaxMonoidal.{u} (free R).obj 
goal: CategoryTheory.LaxMonoidal (ModuleCat.free R).obj

full_name: ModuleCat.Free.instIsIsoε
code: instance : IsIso (@LaxMonoidal.ε _ _ _ _ _ _ (free R).obj _ _) 
goal: CategoryTheory.IsIso CategoryTheory.LaxMonoidal.ε

full_name: ModuleCat.monoidalFree
code: /-- The free functor `Type u ⥤ ModuleCat R`, as a monoidal functor. -/
def monoidalFree : MonoidalFunctor (Type u) (ModuleCat.{u} R) 
goal: CategoryTheory.MonoidalFunctor (Type u) (ModuleCat R)

full_name: CategoryTheory.Free
code: /-- `Free R C` is a type synonym for `C`, which, given `[CommRing R]` and `[Category C]`,
we will equip with a category structure where the morphisms are formal `R`-linear combinations
of the morphisms in `C`.
-/
-- Porting note(#5171): Removed has_nonempty_instance nolint; linter not ported yet
@[nolint unusedArguments]
def Free (_ : Type*) (C : Type u) 
goal: Type u_1 → Type u → Type u

full_name: CategoryTheory.Free.of
code: /-- Consider an object of `C` as an object of the `R`-linear completion.

It may be preferable to use `(Free.embedding R C).obj X` instead;
this functor can also be used to lift morphisms.
-/
def Free.of (R : Type*) {C : Type u} (X : C) : Free R C 
goal: CategoryTheory.Free R C

full_name: CategoryTheory.categoryFree
code: instance categoryFree : Category (Free R C) 
goal: CategoryTheory.Category.{max u_1 v, u} (CategoryTheory.Free R C)

full_name: CategoryTheory.Free.instPreadditive
code: instance : Preadditive (Free R C) 
goal: CategoryTheory.Preadditive (CategoryTheory.Free R C)

full_name: CategoryTheory.Free.instLinear
code: instance : Linear R (Free R C) 
goal: CategoryTheory.Linear R (CategoryTheory.Free R C)

full_name: CategoryTheory.Free.single_comp_single
code: theorem single_comp_single {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) (r s : R) :
    (single f r ≫ single g s : Free.of R X ⟶ Free.of R Z) = single (f ≫ g) (r * s) 
goal: Finsupp.single f r ≫ Finsupp.single g s = Finsupp.single (f ≫ g) (r * s)

full_name: CategoryTheory.Free.embedding_map
code: /-- A category embeds into its `R`-linear completion.
-/
@[simps]
def embedding : C ⥤ Free R C 
goal: (CategoryTheory.Free.embedding R C).map f = Finsupp.single f 1

full_name: CategoryTheory.Free.embedding_obj
code: /-- A category embeds into its `R`-linear completion.
-/
@[simps]
def embedding : C ⥤ Free R C 
goal: (CategoryTheory.Free.embedding R C).obj X = X

full_name: CategoryTheory.Free.embedding
code: /-- A category embeds into its `R`-linear completion.
-/
@[simps]
def embedding : C ⥤ Free R C 
goal: C ⥤ CategoryTheory.Free R C

full_name: CategoryTheory.Free.lift_obj
code: /-- A functor to an `R`-linear category lifts to a functor from its `R`-linear completion.
-/
@[simps]
def lift (F : C ⥤ D) : Free R C ⥤ D 
goal: (CategoryTheory.Free.lift R F).obj X = F.obj X

full_name: CategoryTheory.Free.lift_map
code: /-- A functor to an `R`-linear category lifts to a functor from its `R`-linear completion.
-/
@[simps]
def lift (F : C ⥤ D) : Free R C ⥤ D 
goal: (CategoryTheory.Free.lift R F).map f = Finsupp.sum f fun f' r => r • F.map f'

full_name: CategoryTheory.Free.lift
code: /-- A functor to an `R`-linear category lifts to a functor from its `R`-linear completion.
-/
@[simps]
def lift (F : C ⥤ D) : Free R C ⥤ D 
goal: CategoryTheory.Free R C ⥤ D

full_name: CategoryTheory.Free.lift_map_single
code: theorem lift_map_single (F : C ⥤ D) {X Y : C} (f : X ⟶ Y) (r : R) :
    (lift R F).map (single f r) = r • F.map f 
goal: (CategoryTheory.Free.lift R F).map (Finsupp.single f r) = r • F.map f

full_name: CategoryTheory.Free.lift_additive
code: instance lift_additive (F : C ⥤ D) : (lift R F).Additive 
goal: (CategoryTheory.Free.lift R F).Additive

full_name: CategoryTheory.Free.lift_linear
code: instance lift_linear (F : C ⥤ D) : (lift R F).Linear R 
goal: CategoryTheory.Functor.Linear R (CategoryTheory.Free.lift R F)

full_name: CategoryTheory.Free.embeddingLiftIso
code: /-- The embedding into the `R`-linear completion, followed by the lift,
is isomorphic to the original functor.
-/
def embeddingLiftIso (F : C ⥤ D) : embedding R C ⋙ lift R F ≅ F 
goal: CategoryTheory.Free.embedding R C ⋙ CategoryTheory.Free.lift R F ≅ F

full_name: CategoryTheory.Free.ext
code: /-- Two `R`-linear functors out of the `R`-linear completion are isomorphic iff their
compositions with the embedding functor are isomorphic.
-/
-- Porting note: used to be @[ext]
def ext {F G : Free R C ⥤ D} [F.Additive] [F.Linear R] [G.Additive] [G.Linear R]
    (α : embedding R C ⋙ F ≅ embedding R C ⋙ G) : F ≅ G 
goal: F ≅ G

full_name: CategoryTheory.Free.liftUnique
code: /-- `Free.lift` is unique amongst `R`-linear functors `Free R C ⥤ D`
which compose with `embedding ℤ C` to give the original functor.
-/
def liftUnique (F : C ⥤ D) (L : Free R C ⥤ D) [L.Additive] [L.Linear R]
    (α : embedding R C ⋙ L ≅ F) : L ≅ lift R F 
goal: L ≅ CategoryTheory.Free.lift R F