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.lean, 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

    The underlying Mor₂ term of a WhiskerRight term.

    Equations
      Instances For

        Expressions of the form η₁ ⊗ ... ⊗ ηₙ.

        Instances For

          The underlying Mor₂ term of a HorizontalComp term.

          Equations
            Instances For

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

              Instances For

                The underlying Mor₂ term of a WhiskerLeft term.

                Equations
                  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

                            Normalized expressions for 2-morphisms.

                            Instances For

                              The underlying Mor₂ term of a NormalExpr term.

                              Equations
                                Instances For

                                  A monad equipped with the ability to construct WhiskerRight terms.

                                  Instances

                                    A monad equipped with the ability to construct HorizontalComp terms.

                                    Instances

                                      A monad equipped with the ability to construct WhiskerLeft terms.

                                      Instances

                                        A monad equipped with the ability to construct NormalExpr terms.

                                        Instances

                                          The domain of a 2-morphism.

                                          Equations
                                            Instances For

                                              The codomain of a 2-morphism.

                                              Equations
                                                Instances For

                                                  The domain of a 2-morphism.

                                                  Equations
                                                    Instances For

                                                      The codomain of a 2-morphism.

                                                      Equations
                                                        Instances For

                                                          The domain of a 2-morphism.

                                                          Equations
                                                            Instances For

                                                              The codomain of a 2-morphism.

                                                              Equations
                                                                Instances For

                                                                  The domain of a 2-morphism.

                                                                  Equations
                                                                    Instances For

                                                                      The codomain of a 2-morphism.

                                                                      Equations
                                                                        Instances For

                                                                          The identity 2-morphism as a term of normalExpr.

                                                                          Equations
                                                                            Instances For

                                                                              The associator as a term of normalExpr.

                                                                              Equations
                                                                                Instances For

                                                                                  The inverse of the associator as a term of normalExpr.

                                                                                  Equations
                                                                                    Instances For

                                                                                      The left unitor as a term of normalExpr.

                                                                                      Equations
                                                                                        Instances For

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

                                                                                          Equations
                                                                                            Instances For

                                                                                              The right unitor as a term of normalExpr.

                                                                                              Equations
                                                                                                Instances For

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

                                                                                                  Equations
                                                                                                    Instances For

                                                                                                      Construct a NormalExpr expression from a WhiskerLeft expression.

                                                                                                      Equations
                                                                                                        Instances For

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

                                                                                                          Equations
                                                                                                            Instances For

                                                                                                              Convert a NormalExpr expression into a list of WhiskerLeft expressions.

                                                                                                              Equations
                                                                                                                Instances For

                                                                                                                  The result of evaluating an expression into normal form.

                                                                                                                  • expr : NormalExpr

                                                                                                                    The normalized expression of the 2-morphism.

                                                                                                                  • proof : Lean.Expr

                                                                                                                    The proof that the normalized expression is equal to the original expression.

                                                                                                                  Instances For

                                                                                                                    Evaluate the expression α ≫ β.

                                                                                                                    Instances

                                                                                                                      Evaluatte the expression f ◁ η.

                                                                                                                      Instances

                                                                                                                        Evaluate the expression η ▷ f.

                                                                                                                        Instances

                                                                                                                          Evaluate the expression η ◫ θ.

                                                                                                                          Instances

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

                                                                                                                            Instances

                                                                                                                              Evaluate the expression α ≫ η into a normalized form.

                                                                                                                              Equations
                                                                                                                                Instances For

                                                                                                                                  Evaluate the expression η ≫ θ into a normalized form.

                                                                                                                                  Equations
                                                                                                                                    Instances For
                                                                                                                                      @[irreducible]

                                                                                                                                      Evaluate the expression f ◁ η into a normalized form.

                                                                                                                                      Equations
                                                                                                                                        Instances For

                                                                                                                                          Evaluate the expression η ▷ f into a normalized form.

                                                                                                                                          Evaluate the expression η ▷ f into a normalized form.

                                                                                                                                          Evaluate the expression η ⊗ θ into a normalized form.

                                                                                                                                          Evaluate the expression η ⊗ θ into a normalized form.

                                                                                                                                          Trace the proof of the normalization.

                                                                                                                                          Equations
                                                                                                                                            Instances For

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

                                                                                                                                              Equations
                                                                                                                                                Instances For