File: Mathlib/CategoryTheory/Preadditive/Mat.lean

full_name: CategoryTheory.Mat_.X
code: /-- An object in `Mat_ C` is a finite tuple of objects in `C`.
-/
structure Mat_ where
  ι : Type
  [fintype : Fintype ι]
  X : ι → C
goal: self.ι → C

full_name: CategoryTheory.Mat_
code: /-- An object in `Mat_ C` is a finite tuple of objects in `C`.
-/
structure Mat_ where
  ι : Type
  [fintype : Fintype ι]
  X : ι → C
goal: Type (max 1 u₁)

full_name: CategoryTheory.Mat_.fintype
code: /-- An object in `Mat_ C` is a finite tuple of objects in `C`.
-/
structure Mat_ where
  ι : Type
  [fintype : Fintype ι]
  X : ι → C
goal: Fintype self.ι

full_name: CategoryTheory.Mat_.ι
code: /-- An object in `Mat_ C` is a finite tuple of objects in `C`.
-/
structure Mat_ where
  ι : Type
  [fintype : Fintype ι]
  X : ι → C
goal: Type

full_name: CategoryTheory.Mat_.Hom
code: /-- A morphism in `Mat_ C` is a dependently typed matrix of morphisms. -/
def Hom (M N : Mat_ C) : Type v₁ 
goal: Type v₁

full_name: CategoryTheory.Mat_.Hom.id
code: /-- The identity matrix consists of identity morphisms on the diagonal, and zeros elsewhere. -/
def id (M : Mat_ C) : Hom M M 
goal: M.Hom M

full_name: CategoryTheory.Mat_.Hom.comp
code: /-- Composition of matrices using matrix multiplication. -/
def comp {M N K : Mat_ C} (f : Hom M N) (g : Hom N K) : Hom M K 
goal: M.Hom K

full_name: CategoryTheory.Mat_.instCategory
code: instance : Category.{v₁} (Mat_ C) 
goal: CategoryTheory.Category.{v₁, max 1 u₁} (CategoryTheory.Mat_ C)

full_name: CategoryTheory.Mat_.hom_ext
code: @[ext]
theorem hom_ext {M N : Mat_ C} (f g : M ⟶ N) (H : ∀ i j, f i j = g i j) : f = g 
goal: f = g

full_name: CategoryTheory.Mat_.id_def
code: theorem id_def (M : Mat_ C) :
    (𝟙 M : Hom M M) = fun i j => if h : i = j then eqToHom (congr_arg M.X h) else 0 
goal: 𝟙 M = fun i j => if h : i = j then CategoryTheory.eqToHom ⋯ else 0

full_name: CategoryTheory.Mat_.id_apply
code: theorem id_apply (M : Mat_ C) (i j : M.ι) :
    (𝟙 M : Hom M M) i j = if h : i = j then eqToHom (congr_arg M.X h) else 0 
goal: 𝟙 M i j = if h : i = j then CategoryTheory.eqToHom ⋯ else 0

full_name: CategoryTheory.Mat_.id_apply_self
code: @[simp]
theorem id_apply_self (M : Mat_ C) (i : M.ι) : (𝟙 M : Hom M M) i i = 𝟙 _ 
goal: 𝟙 M i i = 𝟙 (M.X i)

full_name: CategoryTheory.Mat_.id_apply_of_ne
code: @[simp]
theorem id_apply_of_ne (M : Mat_ C) (i j : M.ι) (h : i ≠ j) : (𝟙 M : Hom M M) i j = 0 
goal: 𝟙 M i j = 0

full_name: CategoryTheory.Mat_.comp_def
code: theorem comp_def {M N K : Mat_ C} (f : M ⟶ N) (g : N ⟶ K) :
    f ≫ g = fun i k => ∑ j : N.ι, f i j ≫ g j k 
goal: f ≫ g = fun i k => ∑ j : N.ι, f i j ≫ g j k

full_name: CategoryTheory.Mat_.comp_apply
code: @[simp]
theorem comp_apply {M N K : Mat_ C} (f : M ⟶ N) (g : N ⟶ K) (i k) :
    (f ≫ g) i k = ∑ j : N.ι, f i j ≫ g j k 
goal: (f ≫ g) i k = ∑ j : N.ι, f i j ≫ g j k

full_name: CategoryTheory.Mat_.instInhabitedHom
code: instance (M N : Mat_ C) : Inhabited (M ⟶ N) 
goal: Inhabited (M ⟶ N)

full_name: CategoryTheory.Mat_.instAddCommGroupHom
code: instance (M N : Mat_ C) : AddCommGroup (M ⟶ N) 
goal: AddCommGroup (M ⟶ N)

full_name: CategoryTheory.Mat_.add_apply
code: @[simp]
theorem add_apply {M N : Mat_ C} (f g : M ⟶ N) (i j) : (f + g) i j = f i j + g i j 
goal: (f + g) i j = f i j + g i j

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

full_name: CategoryTheory.Mat_.hasFiniteBiproducts
code: /-- We now prove that `Mat_ C` has finite biproducts.

Be warned, however, that `Mat_ C` is not necessarily Krull-Schmidt,
and so the internal indexing of a biproduct may have nothing to do with the external indexing,
even though the construction we give uses a sigma type.
See however `isoBiproductEmbedding`.
-/
instance hasFiniteBiproducts : HasFiniteBiproducts (Mat_ C) 
goal: CategoryTheory.Limits.HasFiniteBiproducts (CategoryTheory.Mat_ C)

full_name: CategoryTheory.Functor.mapMat__obj_ι
code: /-- A functor induces a functor of matrix categories.
-/
@[simps]
def mapMat_ (F : C ⥤ D) [Functor.Additive F] : Mat_ C ⥤ Mat_ D 
goal: (F.mapMat_.obj M).ι = M.ι

full_name: CategoryTheory.Functor.mapMat_
code: /-- A functor induces a functor of matrix categories.
-/
@[simps]
def mapMat_ (F : C ⥤ D) [Functor.Additive F] : Mat_ C ⥤ Mat_ D 
goal: CategoryTheory.Mat_ C ⥤ CategoryTheory.Mat_ D

full_name: CategoryTheory.Functor.mapMat__map
code: /-- A functor induces a functor of matrix categories.
-/
@[simps]
def mapMat_ (F : C ⥤ D) [Functor.Additive F] : Mat_ C ⥤ Mat_ D 
goal: ∀ {X Y : CategoryTheory.Mat_ C} (f : X ⟶ Y) (i : ((fun M => CategoryTheory.Mat_.mk M.ι fun i => F.obj (M.X i)) X).ι)
  (j : ((fun M => CategoryTheory.Mat_.mk M.ι fun i => F.obj (M.X i)) Y).ι), F.mapMat_.map f i j = F.map (f i j)

full_name: CategoryTheory.Functor.mapMat__obj_fintype
code: /-- A functor induces a functor of matrix categories.
-/
@[simps]
def mapMat_ (F : C ⥤ D) [Functor.Additive F] : Mat_ C ⥤ Mat_ D 
goal: (F.mapMat_.obj M).fintype = M.fintype

full_name: CategoryTheory.Functor.mapMat__obj_X
code: /-- A functor induces a functor of matrix categories.
-/
@[simps]
def mapMat_ (F : C ⥤ D) [Functor.Additive F] : Mat_ C ⥤ Mat_ D 
goal: (F.mapMat_.obj M).X i = F.obj (M.X i)

full_name: CategoryTheory.Functor.mapMatId
code: /-- The identity functor induces the identity functor on matrix categories.
-/
@[simps!]
def mapMatId : (𝟭 C).mapMat_ ≅ 𝟭 (Mat_ C) 
goal: (𝟭 C).mapMat_ ≅ 𝟭 (CategoryTheory.Mat_ C)

full_name: CategoryTheory.Functor.mapMatId_inv_app
code: /-- The identity functor induces the identity functor on matrix categories.
-/
@[simps!]
def mapMatId : (𝟭 C).mapMat_ ≅ 𝟭 (Mat_ C) 
goal: CategoryTheory.Functor.mapMatId.inv.app X = 𝟙 ((𝟭 C).mapMat_.obj X)

full_name: CategoryTheory.Functor.mapMatId_hom_app
code: /-- The identity functor induces the identity functor on matrix categories.
-/
@[simps!]
def mapMatId : (𝟭 C).mapMat_ ≅ 𝟭 (Mat_ C) 
goal: CategoryTheory.Functor.mapMatId.hom.app X = 𝟙 ((𝟭 C).mapMat_.obj X)

full_name: CategoryTheory.Functor.mapMatComp_inv_app
code: /-- Composite functors induce composite functors on matrix categories.
-/
@[simps!]
def mapMatComp {E : Type*} [Category.{v₁} E] [Preadditive E] (F : C ⥤ D) [Functor.Additive F]
    (G : D ⥤ E) [Functor.Additive G] : (F ⋙ G).mapMat_ ≅ F.mapMat_ ⋙ G.mapMat_ 
goal: (F.mapMatComp G).inv.app X = 𝟙 ((F ⋙ G).mapMat_.obj X)

full_name: CategoryTheory.Functor.mapMatComp
code: /-- Composite functors induce composite functors on matrix categories.
-/
@[simps!]
def mapMatComp {E : Type*} [Category.{v₁} E] [Preadditive E] (F : C ⥤ D) [Functor.Additive F]
    (G : D ⥤ E) [Functor.Additive G] : (F ⋙ G).mapMat_ ≅ F.mapMat_ ⋙ G.mapMat_ 
goal: (F ⋙ G).mapMat_ ≅ F.mapMat_ ⋙ G.mapMat_

full_name: CategoryTheory.Functor.mapMatComp_hom_app
code: /-- Composite functors induce composite functors on matrix categories.
-/
@[simps!]
def mapMatComp {E : Type*} [Category.{v₁} E] [Preadditive E] (F : C ⥤ D) [Functor.Additive F]
    (G : D ⥤ E) [Functor.Additive G] : (F ⋙ G).mapMat_ ≅ F.mapMat_ ⋙ G.mapMat_ 
goal: (F.mapMatComp G).hom.app X = 𝟙 ((F ⋙ G).mapMat_.obj X)

full_name: CategoryTheory.Mat_.embedding
code: /-- The embedding of `C` into `Mat_ C` as one-by-one matrices.
(We index the summands by `PUnit`.) -/
@[simps]
def embedding : C ⥤ Mat_ C 
goal: C ⥤ CategoryTheory.Mat_ C

full_name: CategoryTheory.Mat_.embedding_obj_fintype
code: /-- The embedding of `C` into `Mat_ C` as one-by-one matrices.
(We index the summands by `PUnit`.) -/
@[simps]
def embedding : C ⥤ Mat_ C 
goal: ((CategoryTheory.Mat_.embedding C).obj X).fintype = PUnit.fintype

full_name: CategoryTheory.Mat_.embedding_map
code: /-- The embedding of `C` into `Mat_ C` as one-by-one matrices.
(We index the summands by `PUnit`.) -/
@[simps]
def embedding : C ⥤ Mat_ C 
goal: ∀ {X Y : C} (f : X ⟶ Y) (x : ((fun X => CategoryTheory.Mat_.mk PUnit.{1} fun x => X) X).ι)
  (x_1 : ((fun X => CategoryTheory.Mat_.mk PUnit.{1} fun x => X) Y).ι),
  (CategoryTheory.Mat_.embedding C).map f x x_1 = f

full_name: CategoryTheory.Mat_.embedding_obj_X
code: /-- The embedding of `C` into `Mat_ C` as one-by-one matrices.
(We index the summands by `PUnit`.) -/
@[simps]
def embedding : C ⥤ Mat_ C 
goal: ∀ (x : PUnit.{1}), ((CategoryTheory.Mat_.embedding C).obj X).X x = X

full_name: CategoryTheory.Mat_.embedding_obj_ι
code: /-- The embedding of `C` into `Mat_ C` as one-by-one matrices.
(We index the summands by `PUnit`.) -/
@[simps]
def embedding : C ⥤ Mat_ C 
goal: ((CategoryTheory.Mat_.embedding C).obj X).ι = PUnit.{1}

full_name: CategoryTheory.Mat_.Embedding.instFaithfulEmbedding
code: instance : (embedding C).Faithful 
goal: (CategoryTheory.Mat_.embedding C).Faithful

full_name: CategoryTheory.Mat_.Embedding.instFullEmbedding
code: instance : (embedding C).Full 
goal: (CategoryTheory.Mat_.embedding C).Full

full_name: CategoryTheory.Mat_.Embedding.instAdditiveEmbedding
code: instance : Functor.Additive (embedding C) 
goal: (CategoryTheory.Mat_.embedding C).Additive

full_name: CategoryTheory.Mat_.instInhabited
code: instance [Inhabited C] : Inhabited (Mat_ C) 
goal: Inhabited (CategoryTheory.Mat_ C)

full_name: CategoryTheory.Mat_.isoBiproductEmbedding_hom
code: /-- Every object in `Mat_ C` is isomorphic to the biproduct of its summands.
-/
@[simps]
def isoBiproductEmbedding (M : Mat_ C) : M ≅ ⨁ fun i => (embedding C).obj (M.X i) 
goal: M.isoBiproductEmbedding.hom =
  CategoryTheory.Limits.biproduct.lift fun i j k => if h : j = i then CategoryTheory.eqToHom ⋯ else 0

full_name: CategoryTheory.Mat_.isoBiproductEmbedding
code: /-- Every object in `Mat_ C` is isomorphic to the biproduct of its summands.
-/
@[simps]
def isoBiproductEmbedding (M : Mat_ C) : M ≅ ⨁ fun i => (embedding C).obj (M.X i) 
goal: M ≅ ⨁ fun i => (CategoryTheory.Mat_.embedding C).obj (M.X i)

full_name: CategoryTheory.Mat_.isoBiproductEmbedding_inv
code: /-- Every object in `Mat_ C` is isomorphic to the biproduct of its summands.
-/
@[simps]
def isoBiproductEmbedding (M : Mat_ C) : M ≅ ⨁ fun i => (embedding C).obj (M.X i) 
goal: M.isoBiproductEmbedding.inv =
  CategoryTheory.Limits.biproduct.desc fun i j k => if h : i = k then CategoryTheory.eqToHom ⋯ else 0

full_name: CategoryTheory.Mat_.instHasBiproductιObjEmbeddingXOfAdditive
code: instance (F : Mat_ C ⥤ D) [Functor.Additive F] (M : Mat_ C) :
    HasBiproduct (fun i => F.obj ((embedding C).obj (M.X i))) 
goal: CategoryTheory.Limits.HasBiproduct fun i => F.obj ((CategoryTheory.Mat_.embedding C).obj (M.X i))

full_name: CategoryTheory.Mat_.additiveObjIsoBiproduct
code: /-- Every `M` is a direct sum of objects from `C`, and `F` preserves biproducts. -/
def additiveObjIsoBiproduct (F : Mat_ C ⥤ D) [Functor.Additive F] (M : Mat_ C) :
    F.obj M ≅ ⨁ fun i => F.obj ((embedding C).obj (M.X i)) 
goal: F.obj M ≅ ⨁ fun i => F.obj ((CategoryTheory.Mat_.embedding C).obj (M.X i))

full_name: CategoryTheory.Mat_.additiveObjIsoBiproduct_hom_π
code: @[reassoc (attr := simp)]
lemma additiveObjIsoBiproduct_hom_π (F : Mat_ C ⥤ D) [Functor.Additive F] (M : Mat_ C) (i : M.ι) :
    (additiveObjIsoBiproduct F M).hom ≫ biproduct.π _ i =
      F.map (M.isoBiproductEmbedding.hom ≫ biproduct.π _ i) 
goal: (CategoryTheory.Mat_.additiveObjIsoBiproduct F M).hom ≫
    CategoryTheory.Limits.biproduct.π (fun i => F.obj ((CategoryTheory.Mat_.embedding C).obj (M.X i))) i =
  F.map
    (M.isoBiproductEmbedding.hom ≫
      CategoryTheory.Limits.biproduct.π (fun i => (CategoryTheory.Mat_.embedding C).obj (M.X i)) i)

full_name: CategoryTheory.Mat_.ι_additiveObjIsoBiproduct_inv
code: @[reassoc (attr := simp)]
lemma ι_additiveObjIsoBiproduct_inv (F : Mat_ C ⥤ D) [Functor.Additive F] (M : Mat_ C) (i : M.ι) :
    biproduct.ι _ i ≫ (additiveObjIsoBiproduct F M).inv =
      F.map (biproduct.ι _ i ≫ M.isoBiproductEmbedding.inv) 
goal: CategoryTheory.Limits.biproduct.ι (fun i => F.obj ((CategoryTheory.Mat_.embedding C).obj (M.X i))) i ≫
    (CategoryTheory.Mat_.additiveObjIsoBiproduct F M).inv =
  F.map
    (CategoryTheory.Limits.biproduct.ι (fun i => (CategoryTheory.Mat_.embedding C).obj (M.X i)) i ≫
      M.isoBiproductEmbedding.inv)

full_name: CategoryTheory.Mat_.additiveObjIsoBiproduct_naturality
code: @[reassoc]
theorem additiveObjIsoBiproduct_naturality (F : Mat_ C ⥤ D) [Functor.Additive F] {M N : Mat_ C}
    (f : M ⟶ N) :
    F.map f ≫ (additiveObjIsoBiproduct F N).hom =
      (additiveObjIsoBiproduct F M).hom ≫
        biproduct.matrix fun i j => F.map ((embedding C).map (f i j)) 
goal: F.map f ≫ (CategoryTheory.Mat_.additiveObjIsoBiproduct F N).hom =
  (CategoryTheory.Mat_.additiveObjIsoBiproduct F M).hom ≫
    CategoryTheory.Limits.biproduct.matrix fun i j => F.map ((CategoryTheory.Mat_.embedding C).map (f i j))

full_name: CategoryTheory.Mat_.additiveObjIsoBiproduct_naturality'
code: @[reassoc]
theorem additiveObjIsoBiproduct_naturality' (F : Mat_ C ⥤ D) [Functor.Additive F] {M N : Mat_ C}
    (f : M ⟶ N) :
    (additiveObjIsoBiproduct F M).inv ≫ F.map f =
      biproduct.matrix (fun i j => F.map ((embedding C).map (f i j)) : _) ≫
        (additiveObjIsoBiproduct F N).inv 
goal: (CategoryTheory.Mat_.additiveObjIsoBiproduct F M).inv ≫ F.map f =
  (CategoryTheory.Limits.biproduct.matrix fun i j => F.map ((CategoryTheory.Mat_.embedding C).map (f i j))) ≫
    (CategoryTheory.Mat_.additiveObjIsoBiproduct F N).inv

full_name: CategoryTheory.Mat_.lift_map
code: /-- Any additive functor `C ⥤ D` to a category `D` with finite biproducts extends to
a functor `Mat_ C ⥤ D`. -/
@[simps]
def lift (F : C ⥤ D) [Functor.Additive F] : Mat_ C ⥤ D 
goal: ∀ {X Y : CategoryTheory.Mat_ C} (f : X ⟶ Y),
  (CategoryTheory.Mat_.lift F).map f = CategoryTheory.Limits.biproduct.matrix fun i j => F.map (f i j)

full_name: CategoryTheory.Mat_.lift
code: /-- Any additive functor `C ⥤ D` to a category `D` with finite biproducts extends to
a functor `Mat_ C ⥤ D`. -/
@[simps]
def lift (F : C ⥤ D) [Functor.Additive F] : Mat_ C ⥤ D 
goal: CategoryTheory.Mat_ C ⥤ D

full_name: CategoryTheory.Mat_.lift_obj
code: /-- Any additive functor `C ⥤ D` to a category `D` with finite biproducts extends to
a functor `Mat_ C ⥤ D`. -/
@[simps]
def lift (F : C ⥤ D) [Functor.Additive F] : Mat_ C ⥤ D 
goal: (CategoryTheory.Mat_.lift F).obj X = ⨁ fun i => F.obj (X.X i)

full_name: CategoryTheory.Mat_.lift_additive
code: instance lift_additive (F : C ⥤ D) [Functor.Additive F] : Functor.Additive (lift F) 
goal: (CategoryTheory.Mat_.lift F).Additive

full_name: CategoryTheory.Mat_.embeddingLiftIso_hom_app
code: /-- An additive functor `C ⥤ D` factors through its lift to `Mat_ C ⥤ D`. -/
@[simps!]
def embeddingLiftIso (F : C ⥤ D) [Functor.Additive F] : embedding C ⋙ lift F ≅ F 
goal: (CategoryTheory.Mat_.embeddingLiftIso F).hom.app X = CategoryTheory.Limits.biproduct.desc fun x => 𝟙 (F.obj X)

full_name: CategoryTheory.Mat_.embeddingLiftIso
code: /-- An additive functor `C ⥤ D` factors through its lift to `Mat_ C ⥤ D`. -/
@[simps!]
def embeddingLiftIso (F : C ⥤ D) [Functor.Additive F] : embedding C ⋙ lift F ≅ F 
goal: CategoryTheory.Mat_.embedding C ⋙ CategoryTheory.Mat_.lift F ≅ F

full_name: CategoryTheory.Mat_.embeddingLiftIso_inv_app
code: /-- An additive functor `C ⥤ D` factors through its lift to `Mat_ C ⥤ D`. -/
@[simps!]
def embeddingLiftIso (F : C ⥤ D) [Functor.Additive F] : embedding C ⋙ lift F ≅ F 
goal: (CategoryTheory.Mat_.embeddingLiftIso F).inv.app X = CategoryTheory.Limits.biproduct.lift fun x => 𝟙 (F.obj X)

full_name: CategoryTheory.Mat_.liftUnique
code: /-- `Mat_.lift F` is the unique additive functor `L : Mat_ C ⥤ D` such that `F ≅ embedding C ⋙ L`.
-/
def liftUnique (F : C ⥤ D) [Functor.Additive F] (L : Mat_ C ⥤ D) [Functor.Additive L]
    (α : embedding C ⋙ L ≅ F) : L ≅ lift F 
goal: L ≅ CategoryTheory.Mat_.lift F

full_name: CategoryTheory.Mat_.ext
code: /-- Two additive functors `Mat_ C ⥤ D` are naturally isomorphic if
their precompositions with `embedding C` are naturally isomorphic as functors `C ⥤ D`. -/
def ext {F G : Mat_ C ⥤ D} [Functor.Additive F] [Functor.Additive G]
    (α : embedding C ⋙ F ≅ embedding C ⋙ G) : F ≅ G 
goal: F ≅ G

full_name: CategoryTheory.Mat_.equivalenceSelfOfHasFiniteBiproductsAux
code: /-- Natural isomorphism needed in the construction of `equivalenceSelfOfHasFiniteBiproducts`.
-/
def equivalenceSelfOfHasFiniteBiproductsAux [HasFiniteBiproducts C] :
    embedding C ⋙ 𝟭 (Mat_ C) ≅ embedding C ⋙ lift (𝟭 C) ⋙ embedding C 
goal: CategoryTheory.Mat_.embedding C ⋙ 𝟭 (CategoryTheory.Mat_ C) ≅
  CategoryTheory.Mat_.embedding C ⋙ CategoryTheory.Mat_.lift (𝟭 C) ⋙ CategoryTheory.Mat_.embedding C

full_name: CategoryTheory.Mat_.equivalenceSelfOfHasFiniteBiproducts
code: /--
A preadditive category that already has finite biproducts is equivalent to its additive envelope.

Note that we only prove this for a large category;
otherwise there are universe issues that I haven't attempted to sort out.
-/
def equivalenceSelfOfHasFiniteBiproducts (C : Type (u₁ + 1)) [LargeCategory C] [Preadditive C]
    [HasFiniteBiproducts C] : Mat_ C ≌ C 
goal: CategoryTheory.Mat_ C ≌ C

full_name: CategoryTheory.Mat_.equivalenceSelfOfHasFiniteBiproducts_functor
code: @[simp]
theorem equivalenceSelfOfHasFiniteBiproducts_functor {C : Type (u₁ + 1)} [LargeCategory C]
    [Preadditive C] [HasFiniteBiproducts C] :
    (equivalenceSelfOfHasFiniteBiproducts C).functor = lift (𝟭 C) 
goal: (CategoryTheory.Mat_.equivalenceSelfOfHasFiniteBiproducts C).functor = CategoryTheory.Mat_.lift (𝟭 C)

full_name: CategoryTheory.Mat_.equivalenceSelfOfHasFiniteBiproducts_inverse
code: @[simp]
theorem equivalenceSelfOfHasFiniteBiproducts_inverse {C : Type (u₁ + 1)} [LargeCategory C]
    [Preadditive C] [HasFiniteBiproducts C] :
    (equivalenceSelfOfHasFiniteBiproducts C).inverse = embedding C 
goal: (CategoryTheory.Mat_.equivalenceSelfOfHasFiniteBiproducts C).inverse = CategoryTheory.Mat_.embedding C

full_name: CategoryTheory.Mat
code: /-- A type synonym for `Fintype`, which we will equip with a category structure
where the morphisms are matrices with components in `R`. -/
@[nolint unusedArguments]
def Mat (_ : Type u) 
goal: Type u → Type (u + 1)

full_name: CategoryTheory.instInhabitedMat
code: instance (R : Type u) : Inhabited (Mat R) 
goal: Inhabited (CategoryTheory.Mat R)

full_name: CategoryTheory.instCoeSortMatType
code: instance (R : Type u) : CoeSort (Mat R) (Type u) 
goal: CoeSort (CategoryTheory.Mat R) (Type u)

full_name: CategoryTheory.instCategoryMatOfSemiring
code: instance (R : Type u) [Semiring R] : Category (Mat R) 
goal: CategoryTheory.Category.{u, u + 1} (CategoryTheory.Mat R)

full_name: CategoryTheory.Mat.hom_ext
code: @[ext]
theorem hom_ext {X Y : Mat R} (f g : X ⟶ Y) (h : ∀ i j, f i j = g i j) : f = g 
goal: f = g

full_name: CategoryTheory.Mat.id_def
code: theorem id_def (M : Mat R) : 𝟙 M = fun i j => if i = j then 1 else 0 
goal: 𝟙 M = fun i j => if i = j then 1 else 0

full_name: CategoryTheory.Mat.id_apply
code: theorem id_apply (M : Mat R) (i j : M) : (𝟙 M : Matrix M M R) i j = if i = j then 1 else 0 
goal: 𝟙 M i j = if i = j then 1 else 0

full_name: CategoryTheory.Mat.id_apply_self
code: @[simp]
theorem id_apply_self (M : Mat R) (i : M) : (𝟙 M : Matrix M M R) i i = 1 
goal: 𝟙 M i i = 1

full_name: CategoryTheory.Mat.id_apply_of_ne
code: @[simp]
theorem id_apply_of_ne (M : Mat R) (i j : M) (h : i ≠ j) : (𝟙 M : Matrix M M R) i j = 0 
goal: 𝟙 M i j = 0

full_name: CategoryTheory.Mat.comp_def
code: theorem comp_def {M N K : Mat R} (f : M ⟶ N) (g : N ⟶ K) :
    f ≫ g = fun i k => ∑ j : N, f i j * g j k 
goal: f ≫ g = fun i k => ∑ j : ↑N, f i j * g j k

full_name: CategoryTheory.Mat.comp_apply
code: @[simp]
theorem comp_apply {M N K : Mat R} (f : M ⟶ N) (g : N ⟶ K) (i k) :
    (f ≫ g) i k = ∑ j : N, f i j * g j k 
goal: (f ≫ g) i k = ∑ j : ↑N, f i j * g j k

full_name: CategoryTheory.Mat.instInhabitedHom
code: instance (M N : Mat R) : Inhabited (M ⟶ N) 
goal: Inhabited (M ⟶ N)

full_name: CategoryTheory.Mat.equivalenceSingleObjInverse_map
code: /-- Auxiliary definition for `CategoryTheory.Mat.equivalenceSingleObj`. -/
@[simps]
def equivalenceSingleObjInverse : Mat_ (SingleObj Rᵐᵒᵖ) ⥤ Mat R 
goal: ∀ {X Y : CategoryTheory.Mat_ (CategoryTheory.SingleObj Rᵐᵒᵖ)} (f : X ⟶ Y) (i : ↑((fun X => FintypeCat.of X.ι) X))
  (j : ↑((fun X => FintypeCat.of X.ι) Y)),
  (CategoryTheory.Mat.equivalenceSingleObjInverse R).map f i j = MulOpposite.unop (f i j)

full_name: CategoryTheory.Mat.equivalenceSingleObjInverse
code: /-- Auxiliary definition for `CategoryTheory.Mat.equivalenceSingleObj`. -/
@[simps]
def equivalenceSingleObjInverse : Mat_ (SingleObj Rᵐᵒᵖ) ⥤ Mat R 
goal: CategoryTheory.Mat_ (CategoryTheory.SingleObj Rᵐᵒᵖ) ⥤ CategoryTheory.Mat R

full_name: CategoryTheory.Mat.equivalenceSingleObjInverse_obj
code: /-- Auxiliary definition for `CategoryTheory.Mat.equivalenceSingleObj`. -/
@[simps]
def equivalenceSingleObjInverse : Mat_ (SingleObj Rᵐᵒᵖ) ⥤ Mat R 
goal: (CategoryTheory.Mat.equivalenceSingleObjInverse R).obj X = FintypeCat.of X.ι

full_name: CategoryTheory.Mat.instFaithfulMat_SingleObjMulOppositeEquivalenceSingleObjInverse
code: instance : (equivalenceSingleObjInverse R).Faithful 
goal: (CategoryTheory.Mat.equivalenceSingleObjInverse R).Faithful

full_name: CategoryTheory.Mat.instFullMat_SingleObjMulOppositeEquivalenceSingleObjInverse
code: instance : (equivalenceSingleObjInverse R).Full 
goal: (CategoryTheory.Mat.equivalenceSingleObjInverse R).Full

full_name: CategoryTheory.Mat.instEssSurjMat_SingleObjMulOppositeEquivalenceSingleObjInverse
code: instance : (equivalenceSingleObjInverse R).EssSurj 
goal: (CategoryTheory.Mat.equivalenceSingleObjInverse R).EssSurj

full_name: CategoryTheory.Mat.instIsEquivalenceMat_SingleObjMulOppositeEquivalenceSingleObjInverse
code: instance : (equivalenceSingleObjInverse R).IsEquivalence 
goal: (CategoryTheory.Mat.equivalenceSingleObjInverse R).IsEquivalence

full_name: CategoryTheory.Mat.equivalenceSingleObj
code: /-- The categorical equivalence between the category of matrices over a ring,
and the category of matrices over that ring considered as a single-object category. -/
def equivalenceSingleObj : Mat R ≌ Mat_ (SingleObj Rᵐᵒᵖ) 
goal: CategoryTheory.Mat R ≌ CategoryTheory.Mat_ (CategoryTheory.SingleObj Rᵐᵒᵖ)

full_name: CategoryTheory.Mat.instAddCommGroupHom
code: instance (X Y : Mat R) : AddCommGroup (X ⟶ Y) 
goal: AddCommGroup (X ⟶ Y)

full_name: CategoryTheory.Mat.add_apply
code: @[simp]
theorem add_apply {M N : Mat R} (f g : M ⟶ N) (i j) : (f + g) i j = f i j + g i j 
goal: (f + g) i j = f i j + g i j

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