Documentation

Mathlib.Tactic.CategoryTheory.Coherence.Normalize

Normalization of 2-morphisms in bicategories #

This file provides a function that normalizes 2-morphisms in bicategories. The function also used to normalize morphisms in monoidal categories. This is used in the string diagram widget given in Mathlib.Tactic.StringDiagram, as well as monoidal and bicategory tactics.

We say that the 2-morphism η in a bicategory is in normal form if

  1. η is of the form α₀ ≫ η₀ ≫ α₁ ≫ η₁ ≫ ... αₘ ≫ ηₘ ≫ αₘ₊₁ where each αᵢ is a structural 2-morphism (consisting of associators and unitors),
  2. each ηᵢ is a non-structural 2-morphism of the form f₁ ◁ ... ◁ fₙ ◁ θ, and
  3. θ is of the form ι₁ ◫ ... ◫ ιₗ, and
  4. each ιᵢ is of the form κ ▷ g₁ ▷ ... ▷ gₖ.

Note that the horizontal composition is not currently defined for bicategories. In the monoidal category setting, the horizontal composition is defined as the tensorHom, denoted by .

Note that the structural morphisms αᵢ are not necessarily normalized, as the main purpose is to get a list of the non-structural morphisms out.

Currently, the primary application of the normalization tactic in mind is drawing string diagrams, which are graphical representations of morphisms in monoidal categories, in the infoview. When drawing string diagrams, we often ignore associators and unitors (i.e., drawing morphisms in strict monoidal categories). On the other hand, in Lean, it is considered difficult to formalize the concept of strict monoidal categories due to the feature of dependent type theory. The normalization tactic can remove associators and unitors from the expression, extracting the necessary data for drawing string diagrams.

The string diagrams widget is to use Penrose (https://github.com/penrose) via ProofWidget. However, it should be noted that the normalization procedure in this file does not rely on specific settings, allowing for broader application. Future plans include the following. At least I (Yuma) would like to work on these in the future, but it might not be immediate. If anyone is interested, I would be happy to discuss.

Main definitions #

Expressions of the form η ▷ f₁ ▷ ... ▷ fₙ.

Instances For

    Expressions of the form f₁ ◁ ... ◁ fₙ ◁ η.

    Instances For

      Whether a given 2-isomorphism is structural or not.

      Equations
      Instances For
        @[reducible, inline]

        Expressions for structural isomorphisms. We do not impose the condition isStructural since it is not needed to write the tactic.

        Equations
        Instances For

          A monad equipped with the ability to construct WhiskerRight terms.

          Instances

            The identity 2-morphism as a term of normalExpr.

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

              The left unitor as a term of normalExpr.

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

                The inverse of the left unitor as a term of normalExpr.

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

                  The right unitor as a term of normalExpr.

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

                    The inverse of the right unitor as a term of normalExpr.

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

                      Construct a NormalExpr expression from a Lean expression for an atomic 2-morphism.

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

                        The result of evaluating an expression into normal form.

                        Instances For

                          Evaluate the expression η ▷ f.

                          Instances

                            Evaluate the expression η ◫ θ.

                            Instances

                              Evaluate the expression of a 2-morphism into a normalized form.

                              Instances

                                Trace the proof of the normalization.

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