Documentation

Mathlib.CategoryTheory.DiscreteCategory

Discrete categories #

We define Discrete α as a structure containing a term a : α for any type α, and use this type alias to provide a SmallCategory instance whose only morphisms are the identities.

There is an annoying technical difficulty that it has turned out to be inconvenient to allow categories with morphisms living in Prop, so instead of defining X ⟶ Y in Discrete α as X = Y, one might define it as PLift (X = Y). In fact, to allow Discrete α to be a SmallCategory (i.e. with morphisms in the same universe as the objects), we actually define the hom type X ⟶ Y as ULift (PLift (X = Y)).

Discrete.functor promotes a function f : I → C (for any category C) to a functor Discrete.functor f : Discrete I ⥤ C.

Similarly, Discrete.natTrans and Discrete.natIso promote I-indexed families of morphisms, or I-indexed families of isomorphisms to natural transformations or natural isomorphism.

We show equivalences of types are the same as (categorical) equivalences of the corresponding discrete categories.

theorem CategoryTheory.Discrete.ext {α : Type u₁} (x : CategoryTheory.Discrete α) (y : CategoryTheory.Discrete α) (as : x.as = y.as) :
x = y
structure CategoryTheory.Discrete (α : Type u₁) :
Type u₁

A wrapper for promoting any type to a category, with the only morphisms being equalities.

  • as : α

    A wrapper for promoting any type to a category, with the only morphisms being equalities.

Instances For
    @[simp]
    theorem CategoryTheory.Discrete.mk_as {α : Type u₁} (X : CategoryTheory.Discrete α) :
    { as := X.as } = X
    @[simp]
    theorem CategoryTheory.discreteEquiv_apply {α : Type u₁} (self : CategoryTheory.Discrete α) :
    CategoryTheory.discreteEquiv self = self.as
    @[simp]
    theorem CategoryTheory.discreteEquiv_symm_apply_as {α : Type u₁} (as : α) :
    (CategoryTheory.discreteEquiv.symm as).as = as

    Discrete α is equivalent to the original type α.

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

      The "Discrete" category on a type, whose morphisms are equalities.

      Because we do not allow morphisms in Prop (only in Type), somewhat annoyingly we have to define X ⟶ Y as ULift (PLift (X = Y)).

      See

      Equations
      Equations
      • CategoryTheory.Discrete.instInhabitedDiscrete = { default := { as := default } }

      A simple tactic to run cases on any Discrete α hypotheses.

      Equations
      Instances For

        Use:

        attribute [local aesop safe tactic (rule_sets [CategoryTheory])]
          CategoryTheory.Discrete.discreteCases
        

        to locally gives aesop_cat the ability to call cases on Discrete and (_ : Discrete _) ⟶ (_ : Discrete _) hypotheses.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Equations
          theorem CategoryTheory.Discrete.eq_of_hom {α : Type u₁} {X : CategoryTheory.Discrete α} {Y : CategoryTheory.Discrete α} (i : X Y) :
          X.as = Y.as

          Extract the equation from a morphism in a discrete category.

          @[inline, reducible]
          abbrev CategoryTheory.Discrete.eqToHom {α : Type u₁} {X : CategoryTheory.Discrete α} {Y : CategoryTheory.Discrete α} (h : X.as = Y.as) :
          X Y

          Promote an equation between the wrapped terms in X Y : Discrete α to a morphism X ⟶ Y in the discrete category.

          Equations
          Instances For
            @[inline, reducible]
            abbrev CategoryTheory.Discrete.eqToIso {α : Type u₁} {X : CategoryTheory.Discrete α} {Y : CategoryTheory.Discrete α} (h : X.as = Y.as) :
            X Y

            Promote an equation between the wrapped terms in X Y : Discrete α to an isomorphism X ≅ Y in the discrete category.

            Equations
            Instances For
              @[inline, reducible]
              abbrev CategoryTheory.Discrete.eqToHom' {α : Type u₁} {a : α} {b : α} (h : a = b) :
              { as := a } { as := b }

              A variant of eqToHom that lifts terms to the discrete category.

              Equations
              Instances For
                @[inline, reducible]
                abbrev CategoryTheory.Discrete.eqToIso' {α : Type u₁} {a : α} {b : α} (h : a = b) :
                { as := a } { as := b }

                A variant of eqToIso that lifts terms to the discrete category.

                Equations
                Instances For
                  @[simp]
                  theorem CategoryTheory.Discrete.id_def {α : Type u₁} (X : CategoryTheory.Discrete α) :
                  { down := { down := (_ : X.as = X.as) } } = CategoryTheory.CategoryStruct.id X

                  Any function I → C gives a functor Discrete I ⥤ C.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    @[simp]
                    theorem CategoryTheory.Discrete.functor_obj {C : Type u₂} [CategoryTheory.Category.{v₂, u₂} C] {I : Type u₁} (F : IC) (i : I) :
                    (CategoryTheory.Discrete.functor F).toPrefunctor.obj { as := i } = F i

                    The discrete functor induced by a composition of maps can be written as a composition of two discrete functors.

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

                      For functors out of a discrete category, a natural transformation is just a collection of maps, as the naturality squares are trivial.

                      Equations
                      Instances For
                        def CategoryTheory.Discrete.natIso {C : Type u₂} [CategoryTheory.Category.{v₂, u₂} C] {I : Type u₁} {F : CategoryTheory.Functor (CategoryTheory.Discrete I) C} {G : CategoryTheory.Functor (CategoryTheory.Discrete I) C} (f : (i : CategoryTheory.Discrete I) → F.toPrefunctor.obj i G.toPrefunctor.obj i) :
                        F G

                        For functors out of a discrete category, a natural isomorphism is just a collection of isomorphisms, as the naturality squares are trivial.

                        Equations
                        Instances For

                          Every functor F from a discrete category is naturally isomorphic (actually, equal) to Discrete.functor (F.obj).

                          Equations
                          Instances For

                            Composing Discrete.functor F with another functor G amounts to composing F with G.obj

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              @[simp]
                              theorem CategoryTheory.Discrete.equivalence_counitIso {I : Type u₁} {J : Type u₂} (e : I J) :
                              (CategoryTheory.Discrete.equivalence e).counitIso = CategoryTheory.Discrete.natIso fun (j : CategoryTheory.Discrete J) => CategoryTheory.eqToIso (_ : (CategoryTheory.Functor.comp (CategoryTheory.Discrete.functor (CategoryTheory.Discrete.mk e.symm)) (CategoryTheory.Discrete.functor (CategoryTheory.Discrete.mk e))).toPrefunctor.obj j = (CategoryTheory.Functor.id (CategoryTheory.Discrete J)).toPrefunctor.obj j)
                              @[simp]
                              theorem CategoryTheory.Discrete.equivalence_inverse {I : Type u₁} {J : Type u₂} (e : I J) :
                              (CategoryTheory.Discrete.equivalence e).inverse = CategoryTheory.Discrete.functor (CategoryTheory.Discrete.mk e.symm)
                              @[simp]
                              theorem CategoryTheory.Discrete.equivalence_functor {I : Type u₁} {J : Type u₂} (e : I J) :
                              (CategoryTheory.Discrete.equivalence e).functor = CategoryTheory.Discrete.functor (CategoryTheory.Discrete.mk e)
                              @[simp]
                              theorem CategoryTheory.Discrete.equivalence_unitIso {I : Type u₁} {J : Type u₂} (e : I J) :

                              We can promote a type-level Equiv to an equivalence between the corresponding discrete categories.

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

                                We can convert an equivalence of discrete categories to a type-level Equiv.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  @[simp]
                                  theorem CategoryTheory.Discrete.opposite_functor_obj_as (α : Type u₁) (X : (CategoryTheory.Discrete α)ᵒᵖ) :
                                  ((CategoryTheory.Discrete.opposite α).functor.toPrefunctor.obj X).as = X.unop.as
                                  @[simp]

                                  A discrete category is equivalent to its opposite category.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    @[simp]
                                    theorem CategoryTheory.piEquivalenceFunctorDiscrete_counitIso (J : Type u₂) (C : Type u₁) [CategoryTheory.Category.{v₁, u₁} C] :
                                    (CategoryTheory.piEquivalenceFunctorDiscrete J C).counitIso = CategoryTheory.NatIso.ofComponents fun (F : CategoryTheory.Functor (CategoryTheory.Discrete J) C) => CategoryTheory.NatIso.ofComponents fun (j : CategoryTheory.Discrete J) => CategoryTheory.Iso.refl (((CategoryTheory.Functor.comp (CategoryTheory.Functor.mk { obj := fun (F : CategoryTheory.Functor (CategoryTheory.Discrete J) C) (j : J) => F.toPrefunctor.obj { as := j }, map := fun {X Y : CategoryTheory.Functor (CategoryTheory.Discrete J) C} (f : X Y) (j : J) => f.app { as := j } }) (CategoryTheory.Functor.mk { obj := fun (F : JC) => CategoryTheory.Discrete.functor F, map := fun {X Y : JC} (f : X Y) => CategoryTheory.Discrete.natTrans fun (j : CategoryTheory.Discrete J) => f j.as })).toPrefunctor.obj F).toPrefunctor.obj j)
                                    @[simp]
                                    theorem CategoryTheory.piEquivalenceFunctorDiscrete_inverse_obj (J : Type u₂) (C : Type u₁) [CategoryTheory.Category.{v₁, u₁} C] (F : CategoryTheory.Functor (CategoryTheory.Discrete J) C) (j : J) :
                                    (CategoryTheory.piEquivalenceFunctorDiscrete J C).inverse.toPrefunctor.obj F j = F.toPrefunctor.obj { as := j }
                                    @[simp]
                                    theorem CategoryTheory.piEquivalenceFunctorDiscrete_inverse_map (J : Type u₂) (C : Type u₁) [CategoryTheory.Category.{v₁, u₁} C] :
                                    ∀ {X Y : CategoryTheory.Functor (CategoryTheory.Discrete J) C} (f : X Y) (j : J), (CategoryTheory.piEquivalenceFunctorDiscrete J C).inverse.toPrefunctor.map f j = f.app { as := j }

                                    The equivalence of categories (J → C) ≌ (Discrete J ⥤ C).

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