File: Mathlib/CategoryTheory/Monoidal/Free/Coherence.lean

full_name: CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject.unit
code: /-- We say an object in the free monoidal category is in normal form if it is of the form
    `(((𝟙_ C) ⊗ X₁) ⊗ X₂) ⊗ ⋯`. -/
-- porting note (#5171): removed @[nolint has_nonempty_instance]
inductive NormalMonoidalObject : Type u
  | unit : NormalMonoidalObject
  | tensor : NormalMonoidalObject → C → NormalMonoidalObject
goal: CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject C

full_name: CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject.tensor
code: /-- We say an object in the free monoidal category is in normal form if it is of the form
    `(((𝟙_ C) ⊗ X₁) ⊗ X₂) ⊗ ⋯`. -/
-- porting note (#5171): removed @[nolint has_nonempty_instance]
inductive NormalMonoidalObject : Type u
  | unit : NormalMonoidalObject
  | tensor : NormalMonoidalObject → C → NormalMonoidalObject
goal: CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject C →
  C → CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject C

full_name: CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject
code: /-- We say an object in the free monoidal category is in normal form if it is of the form
    `(((𝟙_ C) ⊗ X₁) ⊗ X₂) ⊗ ⋯`. -/
-- porting note (#5171): removed @[nolint has_nonempty_instance]
inductive NormalMonoidalObject : Type u
  | unit : NormalMonoidalObject
  | tensor : NormalMonoidalObject → C → NormalMonoidalObject
goal: Type u

full_name: CategoryTheory.FreeMonoidalCategory._aux_Mathlib_CategoryTheory_Monoidal_Free_Coherence___macroRules_CategoryTheory_FreeMonoidalCategory_termF_1
code: local notation "F" => FreeMonoidalCategory
goal: Lean.Macro

full_name: CategoryTheory.FreeMonoidalCategory._aux_Mathlib_CategoryTheory_Monoidal_Free_Coherence___unexpand_CategoryTheory_FreeMonoidalCategory_1
code: local notation "F" => FreeMonoidalCategory
goal: Lean.PrettyPrinter.Unexpander

full_name: CategoryTheory.FreeMonoidalCategory._aux_Mathlib_CategoryTheory_Monoidal_Free_Coherence___macroRules_CategoryTheory_FreeMonoidalCategory_termN_1
code: local notation "N" => Discrete ∘ NormalMonoidalObject
goal: Lean.Macro

full_name: CategoryTheory.FreeMonoidalCategory.«_aux_Mathlib_CategoryTheory_Monoidal_Free_Coherence___macroRules_CategoryTheory_FreeMonoidalCategory_term_⟶ᵐ__1»
code: local infixr:10 " ⟶ᵐ " => Hom
goal: Lean.Macro

full_name: CategoryTheory.FreeMonoidalCategory._aux_Mathlib_CategoryTheory_Monoidal_Free_Coherence___unexpand_CategoryTheory_FreeMonoidalCategory_Hom_1
code: local infixr:10 " ⟶ᵐ " => Hom
goal: Lean.PrettyPrinter.Unexpander

full_name: CategoryTheory.FreeMonoidalCategory.instSubsingletonHomCompDiscreteNormalMonoidalObject
code: instance (x y : N C) : Subsingleton (x ⟶ y) 
goal: Subsingleton (x ⟶ y)

full_name: CategoryTheory.FreeMonoidalCategory.inclusionObj
code: /-- Auxiliary definition for `inclusion`. -/
@[simp]
def inclusionObj : NormalMonoidalObject C → F C
  
goal: CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject C → CategoryTheory.FreeMonoidalCategory C

full_name: CategoryTheory.FreeMonoidalCategory.inclusion
code: /-- The discrete subcategory of objects in normal form includes into the free monoidal category. -/
def inclusion : N C ⥤ F C 
goal: CategoryTheory.Functor ((CategoryTheory.Discrete ∘ CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject) C)
  (CategoryTheory.FreeMonoidalCategory C)

full_name: CategoryTheory.FreeMonoidalCategory.inclusion_obj
code: @[simp]
theorem inclusion_obj (X : N C) :
    inclusion.obj X = inclusionObj X.as 
goal: CategoryTheory.FreeMonoidalCategory.inclusion.obj X = CategoryTheory.FreeMonoidalCategory.inclusionObj X.as

full_name: CategoryTheory.FreeMonoidalCategory.inclusion_map
code: @[simp]
theorem inclusion_map {X Y : N C} (f : X ⟶ Y) :
    inclusion.map f = eqToHom (congr_arg _ (Discrete.ext _ _ (Discrete.eq_of_hom f))) 
goal: CategoryTheory.FreeMonoidalCategory.inclusion.map f = CategoryTheory.eqToHom ⋯

full_name: CategoryTheory.FreeMonoidalCategory.normalizeObj
code: /-- Auxiliary definition for `normalize`. -/
def normalizeObj : F C → NormalMonoidalObject C → NormalMonoidalObject C
  
goal: CategoryTheory.FreeMonoidalCategory C →
  CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject C →
    CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject C

full_name: CategoryTheory.FreeMonoidalCategory.normalizeObj_unitor
code: @[simp]
theorem normalizeObj_unitor (n : NormalMonoidalObject C) : normalizeObj (𝟙_ (F C)) n = n 
goal: (𝟙_ (CategoryTheory.FreeMonoidalCategory C)).normalizeObj n = n

full_name: CategoryTheory.FreeMonoidalCategory.normalizeObj_tensor
code: @[simp]
theorem normalizeObj_tensor (X Y : F C) (n : NormalMonoidalObject C) :
    normalizeObj (X ⊗ Y) n = normalizeObj Y (normalizeObj X n) 
goal: (CategoryTheory.MonoidalCategory.tensorObj X Y).normalizeObj n = Y.normalizeObj (X.normalizeObj n)

full_name: CategoryTheory.FreeMonoidalCategory.normalizeObj'
code: /-- Auxiliary definition for `normalize`. -/
def normalizeObj' (X : F C) : N C ⥤ N C 
goal: CategoryTheory.Functor ((CategoryTheory.Discrete ∘ CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject) C)
  ((CategoryTheory.Discrete ∘ CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject) C)

full_name: CategoryTheory.FreeMonoidalCategory.normalizeMapAux
code: /-- Auxiliary definition for `normalize`. Here we prove that objects that are related by
    associators and unitors map to the same normal form. -/
@[simp]
def normalizeMapAux : ∀ {X Y : F C}, (X ⟶ᵐ Y) → (normalizeObj' X ⟶ normalizeObj' Y)
  
goal: X.Hom Y → (X.normalizeObj' ⟶ Y.normalizeObj')

full_name: CategoryTheory.FreeMonoidalCategory.normalize
code: /-- Our normalization procedure works by first defining a functor `F C ⥤ (N C ⥤ N C)` (which turns
    out to be very easy), and then obtain a functor `F C ⥤ N C` by plugging in the normal object
    `𝟙_ C`. -/
@[simp]
def normalize : F C ⥤ N C ⥤ N C 
goal: CategoryTheory.Functor (CategoryTheory.FreeMonoidalCategory C)
  (CategoryTheory.Functor ((CategoryTheory.Discrete ∘ CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject) C)
    ((CategoryTheory.Discrete ∘ CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject) C))

full_name: CategoryTheory.FreeMonoidalCategory.normalize'
code: /-- A variant of the normalization functor where we consider the result as an object in the free
    monoidal category (rather than an object of the discrete subcategory of objects in normal
    form). -/
@[simp]
def normalize' : F C ⥤ N C ⥤ F C 
goal: CategoryTheory.Functor (CategoryTheory.FreeMonoidalCategory C)
  (CategoryTheory.Functor ((CategoryTheory.Discrete ∘ CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject) C)
    (CategoryTheory.FreeMonoidalCategory C))

full_name: CategoryTheory.FreeMonoidalCategory.fullNormalize
code: /-- The normalization functor for the free monoidal category over `C`. -/
def fullNormalize : F C ⥤ N C 
goal: CategoryTheory.Functor (CategoryTheory.FreeMonoidalCategory C)
  ((CategoryTheory.Discrete ∘ CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject) C)

full_name: CategoryTheory.FreeMonoidalCategory.tensorFunc
code: /-- Given an object `X` of the free monoidal category and an object `n` in normal form, taking
    the tensor product `n ⊗ X` in the free monoidal category is functorial in both `X` and `n`. -/
@[simp]
def tensorFunc : F C ⥤ N C ⥤ F C 
goal: CategoryTheory.Functor (CategoryTheory.FreeMonoidalCategory C)
  (CategoryTheory.Functor ((CategoryTheory.Discrete ∘ CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject) C)
    (CategoryTheory.FreeMonoidalCategory C))

full_name: CategoryTheory.FreeMonoidalCategory.tensorFunc_map_app
code: theorem tensorFunc_map_app {X Y : F C} (f : X ⟶ Y) (n) : ((tensorFunc C).map f).app n = _ ◁ f 
goal: ((CategoryTheory.FreeMonoidalCategory.tensorFunc C).map f).app n =
  CategoryTheory.MonoidalCategory.whiskerLeft (CategoryTheory.FreeMonoidalCategory.inclusion.obj { as := n.as }) f

full_name: CategoryTheory.FreeMonoidalCategory.tensorFunc_obj_map
code: theorem tensorFunc_obj_map (Z : F C) {n n' : N C} (f : n ⟶ n') :
    ((tensorFunc C).obj Z).map f = inclusion.map f ▷ Z 
goal: ((CategoryTheory.FreeMonoidalCategory.tensorFunc C).obj Z).map f =
  CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.FreeMonoidalCategory.inclusion.map f) Z

full_name: CategoryTheory.FreeMonoidalCategory.normalizeIsoApp
code: /-- Auxiliary definition for `normalizeIso`. Here we construct the isomorphism between
    `n ⊗ X` and `normalize X n`. -/
@[simp]
def normalizeIsoApp :
    ∀ (X : F C) (n : N C), ((tensorFunc C).obj X).obj n ≅ ((normalize' C).obj X).obj n
  
goal: ((CategoryTheory.FreeMonoidalCategory.tensorFunc C).obj X).obj n ≅
  ((CategoryTheory.FreeMonoidalCategory.normalize' C).obj X).obj n

full_name: CategoryTheory.FreeMonoidalCategory.normalizeIsoApp'
code: /-- Almost non-definitionally equall to `normalizeIsoApp`, but has a better definitional property
in the proof of `normalize_naturality`. -/
@[simp]
def normalizeIsoApp' :
    ∀ (X : F C) (n : NormalMonoidalObject C), inclusionObj n ⊗ X ≅ inclusionObj (normalizeObj X n)
  
goal: CategoryTheory.MonoidalCategory.tensorObj (CategoryTheory.FreeMonoidalCategory.inclusionObj n) X ≅
  CategoryTheory.FreeMonoidalCategory.inclusionObj (X.normalizeObj n)

full_name: CategoryTheory.FreeMonoidalCategory.normalizeIsoApp_eq
code: theorem normalizeIsoApp_eq :
    ∀ (X : F C) (n : N C), normalizeIsoApp C X n = normalizeIsoApp' C X n.as
  
goal: CategoryTheory.FreeMonoidalCategory.normalizeIsoApp C X n =
  CategoryTheory.FreeMonoidalCategory.normalizeIsoApp' C X n.as

full_name: CategoryTheory.FreeMonoidalCategory.normalizeIsoApp_tensor
code: @[simp]
theorem normalizeIsoApp_tensor (X Y : F C) (n : N C) :
    normalizeIsoApp C (X ⊗ Y) n =
      (α_ _ _ _).symm ≪≫ whiskerRightIso (normalizeIsoApp C X n) Y ≪≫ normalizeIsoApp _ _ _ 
goal: CategoryTheory.FreeMonoidalCategory.normalizeIsoApp C (CategoryTheory.MonoidalCategory.tensorObj X Y) n =
  (CategoryTheory.MonoidalCategory.associator (CategoryTheory.FreeMonoidalCategory.inclusion.obj { as := n.as }) X
        Y).symm ≪≫
    CategoryTheory.MonoidalCategory.whiskerRightIso (CategoryTheory.FreeMonoidalCategory.normalizeIsoApp C X n) Y ≪≫
      CategoryTheory.FreeMonoidalCategory.normalizeIsoApp C Y { as := X.normalizeObj n.as }

full_name: CategoryTheory.FreeMonoidalCategory.normalizeIsoApp_unitor
code: @[simp]
theorem normalizeIsoApp_unitor (n : N C) : normalizeIsoApp C (𝟙_ (F C)) n = ρ_ _ 
goal: CategoryTheory.FreeMonoidalCategory.normalizeIsoApp C (𝟙_ (CategoryTheory.FreeMonoidalCategory C)) n =
  CategoryTheory.MonoidalCategory.rightUnitor (CategoryTheory.FreeMonoidalCategory.inclusion.obj { as := n.as })

full_name: CategoryTheory.FreeMonoidalCategory.normalizeIsoAux
code: /-- Auxiliary definition for `normalizeIso`. -/
@[simp]
def normalizeIsoAux (X : F C) : (tensorFunc C).obj X ≅ (normalize' C).obj X 
goal: (CategoryTheory.FreeMonoidalCategory.tensorFunc C).obj X ≅ (CategoryTheory.FreeMonoidalCategory.normalize' C).obj X

full_name: CategoryTheory.FreeMonoidalCategory.normalizeObj_congr
code: theorem normalizeObj_congr (n : NormalMonoidalObject C) {X Y : F C} (f : X ⟶ Y) :
    normalizeObj X n = normalizeObj Y n 
goal: X.normalizeObj n = Y.normalizeObj n

full_name: CategoryTheory.FreeMonoidalCategory.normalize_naturality
code: theorem normalize_naturality (n : NormalMonoidalObject C) {X Y : F C} (f : X ⟶ Y) :
    inclusionObj n ◁ f ≫ (normalizeIsoApp' C Y n).hom =
      (normalizeIsoApp' C X n).hom ≫
        inclusion.map (eqToHom (Discrete.ext _ _ (normalizeObj_congr n f))) 
goal: CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.whiskerLeft (CategoryTheory.FreeMonoidalCategory.inclusionObj n) f)
    (CategoryTheory.FreeMonoidalCategory.normalizeIsoApp' C Y n).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.FreeMonoidalCategory.normalizeIsoApp' C X n).hom
    (CategoryTheory.FreeMonoidalCategory.inclusion.map (CategoryTheory.eqToHom ⋯))

full_name: CategoryTheory.FreeMonoidalCategory.normalizeIso
code: /-- The isomorphism between `n ⊗ X` and `normalize X n` is natural (in both `X` and `n`, but
    naturality in `n` is trivial and was "proved" in `normalizeIsoAux`). This is the real heart
    of our proof of the coherence theorem. -/
def normalizeIso : tensorFunc C ≅ normalize' C 
goal: CategoryTheory.FreeMonoidalCategory.tensorFunc C ≅ CategoryTheory.FreeMonoidalCategory.normalize' C

full_name: CategoryTheory.FreeMonoidalCategory.fullNormalizeIso
code: /-- The isomorphism between an object and its normal form is natural. -/
def fullNormalizeIso : 𝟭 (F C) ≅ fullNormalize C ⋙ inclusion 
goal: CategoryTheory.Functor.id (CategoryTheory.FreeMonoidalCategory C) ≅
  (CategoryTheory.FreeMonoidalCategory.fullNormalize C).comp CategoryTheory.FreeMonoidalCategory.inclusion

full_name: CategoryTheory.FreeMonoidalCategory.subsingleton_hom
code: /-- The monoidal coherence theorem. -/
instance subsingleton_hom : Quiver.IsThin (F C) 
goal: Quiver.IsThin (CategoryTheory.FreeMonoidalCategory C)

full_name: CategoryTheory.FreeMonoidalCategory.inverseAux
code: /-- Auxiliary construction for showing that the free monoidal category is a groupoid. Do not use
    this, use `IsIso.inv` instead. -/
def inverseAux : ∀ {X Y : F C}, (X ⟶ᵐ Y) → (Y ⟶ᵐ X)
  
goal: X.Hom Y → Y.Hom X

full_name: CategoryTheory.FreeMonoidalCategory.instGroupoid
code: instance : Groupoid.{u} (F C) 
goal: CategoryTheory.Groupoid (CategoryTheory.FreeMonoidalCategory C)