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]