Documentation

Mathlib.CategoryTheory.Monoidal.Category

Monoidal categories #

A monoidal category is a category equipped with a tensor product, unitors, and an associator. In the definition, we provide the tensor product as a pair of functions

The tensor product can be expressed as a functor via tensor : C Ɨ C ℤ C. The unitors and associator are gathered together as natural isomorphisms in leftUnitor_nat_iso, rightUnitor_nat_iso and associator_nat_iso.

Some consequences of the definition are proved in other files after proving the coherence theorem, e.g. (Ī»_ (šŸ™_ C)).hom = (ρ_ (šŸ™_ C)).hom in CategoryTheory.Monoidal.CoherenceLemmas.

Implementation notes #

In the definition of monoidal categories, we also provide the whiskering operators:

If you want to provide tensorHom and define whiskerLeft and whiskerRight in terms of it, you can use the alternative constructor CategoryTheory.MonoidalCategory.ofTensorHom.

The whiskerings are useful when considering simp-normal forms of morphisms in monoidal categories.

Simp-normal form for morphisms #

Rewriting involving associators and unitors could be very complicated. We try to ease this complexity by putting carefully chosen simp lemmas that rewrite any morphisms into the simp-normal form defined below. Rewriting into simp-normal form is especially useful in preprocessing performed by the coherence tactic.

The simp-normal form of morphisms is defined to be an expression that has the minimal number of parentheses. More precisely,

  1. it is a composition of morphisms like f₁ ≫ fā‚‚ ≫ fā‚ƒ ≫ fā‚„ ≫ fā‚… such that each fįµ¢ is either a structural morphisms (morphisms made up only of identities, associators, unitors) or non-structural morphisms, and
  2. each non-structural morphism in the composition is of the form X₁ ◁ Xā‚‚ ◁ Xā‚ƒ ◁ f ā–· Xā‚„ ā–· Xā‚…, where each Xįµ¢ is a object that is not the identity or a tensor and f is a non-structural morphisms that is not the identity or a composite.

Note that X₁ ◁ Xā‚‚ ◁ Xā‚ƒ ◁ f ā–· Xā‚„ ā–· Xā‚… is actually X₁ ◁ (Xā‚‚ ◁ (Xā‚ƒ ◁ ((f ā–· Xā‚„) ā–· Xā‚…))).

Currently, the simp lemmas don't rewrite šŸ™ X āŠ— f and f āŠ— šŸ™ Y into X ◁ f and f ā–· Y, respectively, since it requires a huge refactoring. We hope to add these simp lemmas soon.

References #

Auxiliary structure to carry only the data fields of (and provide notation for) MonoidalCategory.

Instances

    Used to ensure that šŸ™_ notation is used, as the ascription makes this not automatic.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      In a monoidal category, we can take the tensor product of objects, X āŠ— Y and of morphisms f āŠ— g. Tensor product does not need to be strictly associative on objects, but there is a specified associator, α_ X Y Z : (X āŠ— Y) āŠ— Z ≅ X āŠ— (Y āŠ— Z). There is a tensor unit šŸ™_ C, with specified left and right unitor isomorphisms Ī»_ X : šŸ™_ C āŠ— X ≅ X and ρ_ X : X āŠ— šŸ™_ C ≅ X. These associators and unitors satisfy the pentagon and triangle equations.

      See https://stacks.math.columbia.edu/tag/0FFK.

      Instances

        Tensor product of identity maps is the identity: (šŸ™ X₁ āŠ— šŸ™ Xā‚‚) = šŸ™ (X₁ āŠ— Xā‚‚)

        @[simp]
        theorem CategoryTheory.MonoidalCategory.tensor_comp {C : Type u} {š’ž : CategoryTheory.Category.{v, u} C} [self : CategoryTheory.MonoidalCategory C] {X₁ : C} {Y₁ : C} {Z₁ : C} {Xā‚‚ : C} {Yā‚‚ : C} {Zā‚‚ : C} (f₁ : X₁ ⟶ Y₁) (fā‚‚ : Xā‚‚ ⟶ Yā‚‚) (g₁ : Y₁ ⟶ Z₁) (gā‚‚ : Yā‚‚ ⟶ Zā‚‚) :

        Composition of tensor products is tensor product of compositions: (f₁ āŠ— g₁) ∘ (fā‚‚ āŠ— gā‚‚) = (f₁ ∘ fā‚‚) āŠ— (g₁ āŠ— gā‚‚)

        theorem CategoryTheory.MonoidalCategory.associator_naturality {C : Type u} {š’ž : CategoryTheory.Category.{v, u} C} [self : CategoryTheory.MonoidalCategory C] {X₁ : C} {Xā‚‚ : C} {Xā‚ƒ : C} {Y₁ : C} {Yā‚‚ : C} {Yā‚ƒ : C} (f₁ : X₁ ⟶ Y₁) (fā‚‚ : Xā‚‚ ⟶ Yā‚‚) (fā‚ƒ : Xā‚ƒ ⟶ Yā‚ƒ) :

        Naturality of the associator isomorphism: (f₁ āŠ— fā‚‚) āŠ— fā‚ƒ ā‰ƒ f₁ āŠ— (fā‚‚ āŠ— fā‚ƒ)

        Naturality of the left unitor, commutativity of šŸ™_ C āŠ— X ⟶ šŸ™_ C āŠ— Y ⟶ Y and šŸ™_ C āŠ— X ⟶ X ⟶ Y

        Naturality of the right unitor: commutativity of X āŠ— šŸ™_ C ⟶ Y āŠ— šŸ™_ C ⟶ Y and X āŠ— šŸ™_ C ⟶ X ⟶ Y

        @[simp]

        The identity relating the isomorphisms between X āŠ— (šŸ™_ C āŠ— Y), (X āŠ— šŸ™_ C) āŠ— Y and X āŠ— Y

        theorem CategoryTheory.MonoidalCategory.tensor_comp_assoc {C : Type u} {š’ž : CategoryTheory.Category.{v, u} C} [self : CategoryTheory.MonoidalCategory C] {X₁ : C} {Y₁ : C} {Z₁ : C} {Xā‚‚ : C} {Yā‚‚ : C} {Zā‚‚ : C} (f₁ : X₁ ⟶ Y₁) (fā‚‚ : Xā‚‚ ⟶ Yā‚‚) (g₁ : Y₁ ⟶ Z₁) (gā‚‚ : Yā‚‚ ⟶ Zā‚‚) {Z : C} (h : CategoryTheory.MonoidalCategory.tensorObj Z₁ Zā‚‚ ⟶ Z) :

        The left whiskering of an isomorphism is an isomorphism.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          The right whiskering of an isomorphism is an isomorphism.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            The tensor product of two isomorphisms is an isomorphism.

            Equations
            Instances For
              @[simp]
              theorem CategoryTheory.MonoidalCategory.tensorIso_inv {C : Type u} [š’ž : CategoryTheory.Category.{v, u} C] [CategoryTheory.MonoidalCategory C] {X : C} {Y : C} {X' : C} {Y' : C} (f : X ≅ Y) (g : X' ≅ Y') :
              @[simp]
              theorem CategoryTheory.MonoidalCategory.tensorIso_hom {C : Type u} [š’ž : CategoryTheory.Category.{v, u} C] [CategoryTheory.MonoidalCategory C] {X : C} {Y : C} {X' : C} {Y' : C} (f : X ≅ Y) (g : X' ≅ Y') :
              theorem CategoryTheory.MonoidalCategory.whiskerLeft_dite {C : Type u} [š’ž : CategoryTheory.Category.{v, u} C] [CategoryTheory.MonoidalCategory C] {P : Prop} [Decidable P] (X : C) {Y : C} {Z : C} (f : P → (Y ⟶ Z)) (f' : ¬P → (Y ⟶ Z)) :
              theorem CategoryTheory.MonoidalCategory.dite_whiskerRight {C : Type u} [š’ž : CategoryTheory.Category.{v, u} C] [CategoryTheory.MonoidalCategory C] {P : Prop} [Decidable P] {X : C} {Y : C} (f : P → (X ⟶ Y)) (f' : ¬P → (X ⟶ Y)) (Z : C) :
              theorem CategoryTheory.MonoidalCategory.tensor_dite {C : Type u} [š’ž : CategoryTheory.Category.{v, u} C] [CategoryTheory.MonoidalCategory C] {P : Prop} [Decidable P] {W : C} {X : C} {Y : C} {Z : C} (f : W ⟶ X) (g : P → (Y ⟶ Z)) (g' : ¬P → (Y ⟶ Z)) :
              theorem CategoryTheory.MonoidalCategory.dite_tensor {C : Type u} [š’ž : CategoryTheory.Category.{v, u} C] [CategoryTheory.MonoidalCategory C] {P : Prop} [Decidable P] {W : C} {X : C} {Y : C} {Z : C} (f : W ⟶ X) (g : P → (Y ⟶ Z)) (g' : ¬P → (Y ⟶ Z)) :

              The lemmas in the next section are true by coherence, but we prove them directly as they are used in proving the coherence theorem.

              @[reducible, inline]
              abbrev CategoryTheory.MonoidalCategory.ofTensorHom {C : Type u} [š’ž : CategoryTheory.Category.{v, u} C] [CategoryTheory.MonoidalCategoryStruct C] (tensor_id : autoParam (āˆ€ (X₁ Xā‚‚ : C), CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.CategoryStruct.id X₁) (CategoryTheory.CategoryStruct.id Xā‚‚) = CategoryTheory.CategoryStruct.id (CategoryTheory.MonoidalCategory.tensorObj X₁ Xā‚‚)) _autoāœ) (id_tensorHom : autoParam (āˆ€ (X : C) {Y₁ Yā‚‚ : C} (f : Y₁ ⟶ Yā‚‚), CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.CategoryStruct.id X) f = CategoryTheory.MonoidalCategory.whiskerLeft X f) _autoāœ) (tensorHom_id : autoParam (āˆ€ {X₁ Xā‚‚ : C} (f : X₁ ⟶ Xā‚‚) (Y : C), CategoryTheory.MonoidalCategory.tensorHom f (CategoryTheory.CategoryStruct.id Y) = CategoryTheory.MonoidalCategory.whiskerRight f Y) _autoāœ) (tensor_comp : autoParam (āˆ€ {X₁ Y₁ Z₁ Xā‚‚ Yā‚‚ Zā‚‚ : C} (f₁ : X₁ ⟶ Y₁) (fā‚‚ : Xā‚‚ ⟶ Yā‚‚) (g₁ : Y₁ ⟶ Z₁) (gā‚‚ : Yā‚‚ ⟶ Zā‚‚), CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.CategoryStruct.comp f₁ g₁) (CategoryTheory.CategoryStruct.comp fā‚‚ gā‚‚) = CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.tensorHom f₁ fā‚‚) (CategoryTheory.MonoidalCategory.tensorHom g₁ gā‚‚)) _autoāœ) (associator_naturality : autoParam (āˆ€ {X₁ Xā‚‚ Xā‚ƒ Y₁ Yā‚‚ Yā‚ƒ : C} (f₁ : X₁ ⟶ Y₁) (fā‚‚ : Xā‚‚ ⟶ Yā‚‚) (fā‚ƒ : Xā‚ƒ ⟶ Yā‚ƒ), CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.MonoidalCategory.tensorHom f₁ fā‚‚) fā‚ƒ) (CategoryTheory.MonoidalCategory.associator Y₁ Yā‚‚ Yā‚ƒ).hom = CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X₁ Xā‚‚ Xā‚ƒ).hom (CategoryTheory.MonoidalCategory.tensorHom f₁ (CategoryTheory.MonoidalCategory.tensorHom fā‚‚ fā‚ƒ))) _autoāœ) (leftUnitor_naturality : autoParam (āˆ€ {X Y : C} (f : X ⟶ Y), CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.CategoryStruct.id (šŸ™_ C)) f) (CategoryTheory.MonoidalCategory.leftUnitor Y).hom = CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.leftUnitor X).hom f) _autoāœ) (rightUnitor_naturality : autoParam (āˆ€ {X Y : C} (f : X ⟶ Y), CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.tensorHom f (CategoryTheory.CategoryStruct.id (šŸ™_ C))) (CategoryTheory.MonoidalCategory.rightUnitor Y).hom = CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.rightUnitor X).hom f) _autoāœ) (pentagon : autoParam (āˆ€ (W X Y Z : C), CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.MonoidalCategory.associator W X Y).hom (CategoryTheory.CategoryStruct.id Z)) (CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator W (CategoryTheory.MonoidalCategory.tensorObj X Y) Z).hom (CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.CategoryStruct.id W) (CategoryTheory.MonoidalCategory.associator X Y Z).hom)) = CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator (CategoryTheory.MonoidalCategory.tensorObj W X) Y Z).hom (CategoryTheory.MonoidalCategory.associator W X (CategoryTheory.MonoidalCategory.tensorObj Y Z)).hom) _autoāœ) (triangle : autoParam (āˆ€ (X Y : C), CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X (šŸ™_ C) Y).hom (CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.CategoryStruct.id X) (CategoryTheory.MonoidalCategory.leftUnitor Y).hom) = CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.MonoidalCategory.rightUnitor X).hom (CategoryTheory.CategoryStruct.id Y)) _autoāœ) :

              A constructor for monoidal categories that requires tensorHom instead of whiskerLeft and whiskerRight.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                The tensor product expressed as a functor.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  The left-associated triple tensor product as a functor.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    The right-associated triple tensor product as a functor.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      The tensor product bifunctor C ℤ C ℤ C of a monoidal category.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        @[reducible, inline]

                        Tensoring on the left, as a functor from C into endofunctors of C.

                        TODO: show this is an op-monoidal functor.

                        Equations
                        Instances For
                          @[reducible, inline]

                          Tensoring on the right, as a functor from C into endofunctors of C.

                          We later show this is a monoidal functor.

                          Equations
                          Instances For
                            Equations
                            @[simp]
                            theorem CategoryTheory.MonoidalCategory.prodMonoidal_tensorUnit (C₁ : Type u₁) [CategoryTheory.Category.{v₁, u₁} C₁] [CategoryTheory.MonoidalCategory C₁] (Cā‚‚ : Type uā‚‚) [CategoryTheory.Category.{vā‚‚, uā‚‚} Cā‚‚] [CategoryTheory.MonoidalCategory Cā‚‚] :
                            šŸ™_ (C₁ Ɨ Cā‚‚) = (šŸ™_ C₁, šŸ™_ Cā‚‚)
                            @[simp]