PhysLean Documentation

Mathlib.Tactic.CategoryTheory.Coherence.Datatypes

Datatypes for bicategory like structures #

This file defines the basic datatypes for bicategory like structures. We will use these datatypes to write tactics that can be applied to both monoidal categories and bicategories:

A term of these datatypes wraps the corresponding Expr term, which can be extracted by e.g. η.e for η : Mor₂.

The operations of these datatypes are defined in a monad m with the corresponding typeclasses:

For example, a monad m with [MonadMor₂ m] provides the operation MonadMor₂.comp₂M : Mor₂IsoMor₂Iso → m Mor₂Iso, which constructs the expression for the composition η ≫ θ of 2-morphisms η and θ in the monad m.

Expressions for objects.

  • Extracts a lean expression from an Obj term. Return none in the monoidal category context.

Instances For

    Extract a lean expression from an Obj term.

    Equations
    Instances For

      Expressions for atomic 1-morphisms.

      • Extract a lean expression from an Atom₁ term.

      • src : Obj

        The domain of the 1-morphism.

      • tgt : Obj

        The codomain of the 1-morphism.

      Instances For

        A monad equipped with the ability to construct Atom₁ terms.

        Instances

          Expressions for 1-morphisms.

          Instances For

            A monad equipped with the ability to construct Mor₁ terms.

            Instances

              A monad equipped with the ability to manipulate 1-morphisms.

              • id₁M (a : Obj) : m Mor₁

                The expression for 𝟙 a.

              • comp₁M (f g : Mor₁) : m Mor₁

                The expression for f ≫ g.

              Instances

                Expressions for coherence isomorphisms (i.e., structural 2-morphisms giveb by BicategorycalCoherence.iso).

                • The underlying lean expression of a coherence isomorphism.

                • src : Mor₁

                  The domain of a coherence isomorphism.

                • tgt : Mor₁

                  The codomain of a coherence isomorphism.

                • inst : Lean.Expr

                  The BicategoricalCoherence instance.

                • unfold : Lean.Expr

                  Extract the structural 2-isomorphism.

                Instances For

                  Expressions for atomic non-structural 2-isomorphisms.

                  • The underlying lean expression of an AtomIso term.

                  • src : Mor₁

                    The domain of a 2-isomorphism.

                  • tgt : Mor₁

                    The codomain of a 2-isomorphism.

                  Instances For

                    Expressions for atomic structural 2-morphisms.

                    Instances For

                      Expressions for 2-isomorphisms.

                      Instances For

                        A monad equipped with the ability to unfold BicategoricalCoherence.iso.

                        Instances

                          The domain of a 2-isomorphism.

                          Equations
                          Instances For

                            A monad equipped with the ability to construct Mor₂Iso terms.

                            Instances

                              The expression for the associator α_ f g h.

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

                                The expression for the left unitor λ_ f.

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

                                  The expression for the right unitor ρ_ f.

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

                                    The expression for the coherence isomorphism ⊗𝟙 : f ⟶ g.

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

                                      Expressions for atomic non-structural 2-morphisms.

                                      • Extract a lean expression from an Atom expression.

                                      • src : Mor₁

                                        The domain of a 2-morphism.

                                      • tgt : Mor₁

                                        The codomain of a 2-morphism.

                                      Instances For

                                        Mor₂ expressions defined below will have the isoLift? : Option IsoLift field. For η : Mor₂ such that η.isoLift? = .some isoLift, we have the following data:

                                        • isoLift.e: an expression for a 2-isomorphism η', given as a Mor₂Iso term,
                                        • isoLift.eq: a lean expression for the proof that η'.hom = η.
                                        • The expression for the 2-isomorphism.

                                        • The expression for the proof that the forward direction of the 2-isomorphism is equal to the original 2-morphism.

                                        Instances For

                                          Expressions for 2-morphisms.

                                          Instances For

                                            A monad equipped with the ability to construct Mor₂ terms.

                                            Instances

                                              η.isoLift? is a pair of a 2-isomorphism η' and a proof that η'.hom = η. If no such η' is found, returns none. This function does not seek IsIso instance.

                                              Equations
                                              Instances For

                                                A monad equipped with the ability to manipulate 2-morphisms.

                                                • homM (η : Mor₂Iso) : m Mor₂

                                                  The expression for Iso.hom η.

                                                • atomHomM (η : AtomIso) : m Atom

                                                  The expression for Iso.hom η.

                                                • invM (η : Mor₂Iso) : m Mor₂

                                                  The expression for Iso.inv η.

                                                • atomInvM (η : AtomIso) : m Atom

                                                  The expression for Iso.inv η.

                                                • id₂M (f : Mor₁) : m Mor₂

                                                  The expression for the identity 𝟙 f.

                                                • comp₂M (η θ : Mor₂) : m Mor₂

                                                  The expression for the composition η ≫ θ.

                                                • whiskerLeftM (f : Mor₁) (η : Mor₂) : m Mor₂

                                                  The expression for the left whiskering f ◁ η.

                                                • whiskerRightM (η : Mor₂) (h : Mor₁) : m Mor₂

                                                  The expression for the right whiskering η ▷ h.

                                                • horizontalCompM (η θ : Mor₂) : m Mor₂

                                                  The expression for the horizontal composition η ◫ θ.

                                                • coherenceCompM (α : CoherenceHom) (η θ : Mor₂) : m Mor₂

                                                  The expression for the coherence composition η ⊗≫ θ := η ≫ α ≫ θ.

                                                Instances

                                                  Type of normalized 1-morphisms ((... ≫ h) ≫ g) ≫ f.

                                                  Instances For

                                                    Context ρ provides the context for manipulating 2-morphisms in a monoidal category or bicategory. In particular, we will store MonoidalCategory or Bicategory instance in a context, and use this through a reader monad when we construct the lean expressions for 2-morphisms.

                                                    Instances

                                                      Construct a context from a lean expression for a 2-morphism.

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

                                                        The state for the CoherenceM ρ monad.

                                                        Instances For
                                                          @[reducible, inline]

                                                          The monad for manipulating 2-morphisms in a monoidal category or bicategory.

                                                          Equations
                                                          Instances For

                                                            Run the CoherenceM ρ monad.

                                                            Equations
                                                            Instances For