Documentation

Mathlib.CategoryTheory.Discrete.Basic

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.

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
    theorem CategoryTheory.Discrete.ext {α : Type u₁} {x y : Discrete α} (as : x.as = y.as) :
    x = y
    theorem CategoryTheory.Discrete.ext_iff {α : Type u₁} {x y : Discrete α} :
    x = y x.as = y.as
    @[simp]
    theorem CategoryTheory.Discrete.mk_as {α : Type u₁} (X : Discrete α) :
    { as := X.as } = X

    Discrete α is equivalent to the original type α.

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

        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)).

        Stacks Tag 001A

        Equations

          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 cat_disch the ability to call cases on Discrete and (_ : Discrete _) ⟶ (_ : Discrete _) hypotheses.

              Equations
                Instances For
                  Equations
                    theorem CategoryTheory.Discrete.eq_of_hom {α : Type u₁} {X Y : Discrete α} (i : X Y) :
                    X.as = Y.as

                    Extract the equation from a morphism in a discrete category.

                    @[reducible, inline]
                    abbrev CategoryTheory.Discrete.eqToHom {α : Type u₁} {X Y : 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
                        @[reducible, inline]
                        abbrev CategoryTheory.Discrete.eqToIso {α : Type u₁} {X Y : 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
                            @[reducible, inline]
                            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
                                @[reducible, inline]
                                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 : Discrete α) :
                                    { down := { down := } } = CategoryStruct.id X
                                    instance CategoryTheory.Discrete.instIsIso {I : Type u₁} {i j : Discrete I} (f : i j) :
                                    def CategoryTheory.Discrete.functor {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} (F : IC) :

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

                                    Equations
                                      Instances For
                                        @[simp]
                                        theorem CategoryTheory.Discrete.functor_obj {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} (F : IC) (i : I) :
                                        (functor F).obj { as := i } = F i
                                        theorem CategoryTheory.Discrete.functor_map {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} (F : IC) {i : Discrete I} (f : i i) :
                                        @[simp]
                                        theorem CategoryTheory.Discrete.functor_obj_eq_as {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} (F : IC) (X : Discrete I) :
                                        (functor F).obj X = F X.as
                                        def CategoryTheory.Discrete.functorComp {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} {J : Type u₁'} (f : JC) (g : IJ) :

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

                                        Equations
                                          Instances For
                                            @[simp]
                                            theorem CategoryTheory.Discrete.functorComp_hom_app {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} {J : Type u₁'} (f : JC) (g : IJ) (X : Discrete I) :
                                            @[simp]
                                            theorem CategoryTheory.Discrete.functorComp_inv_app {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} {J : Type u₁'} (f : JC) (g : IJ) (X : Discrete I) :
                                            def CategoryTheory.Discrete.natTrans {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} {F G : Functor (Discrete I) C} (f : (i : Discrete I) → F.obj i G.obj i) :
                                            F G

                                            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
                                                @[simp]
                                                theorem CategoryTheory.Discrete.natTrans_app {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} {F G : Functor (Discrete I) C} (f : (i : Discrete I) → F.obj i G.obj i) (i : Discrete I) :
                                                (natTrans f).app i = f i
                                                def CategoryTheory.Discrete.natIso {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} {F G : Functor (Discrete I) C} (f : (i : Discrete I) → F.obj i G.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
                                                    @[simp]
                                                    theorem CategoryTheory.Discrete.natIso_inv_app {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} {F G : Functor (Discrete I) C} (f : (i : Discrete I) → F.obj i G.obj i) (X : Discrete I) :
                                                    (natIso f).inv.app X = (f X).inv
                                                    @[simp]
                                                    theorem CategoryTheory.Discrete.natIso_hom_app {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} {F G : Functor (Discrete I) C} (f : (i : Discrete I) → F.obj i G.obj i) (X : Discrete I) :
                                                    (natIso f).hom.app X = (f X).hom
                                                    instance CategoryTheory.Discrete.instIsIsoFunctorNatTrans {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u_1} {F G : Functor (Discrete I) C} (f : (i : Discrete I) → F.obj i G.obj i) [∀ (i : Discrete I), IsIso (f i)] :
                                                    @[simp]
                                                    theorem CategoryTheory.Discrete.natIso_app {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} {F G : Functor (Discrete I) C} (f : (i : Discrete I) → F.obj i G.obj i) (i : Discrete I) :
                                                    (natIso f).app i = f i

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

                                                    Equations
                                                      Instances For
                                                        def CategoryTheory.Discrete.compNatIsoDiscrete {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} {D : Type u₃} [Category.{v₃, u₃} D] (F : IC) (G : Functor C D) :

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

                                                        Equations
                                                          Instances For
                                                            @[simp]
                                                            theorem CategoryTheory.Discrete.compNatIsoDiscrete_hom_app {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} {D : Type u₃} [Category.{v₃, u₃} D] (F : IC) (G : Functor C D) (X : Discrete I) :
                                                            @[simp]
                                                            theorem CategoryTheory.Discrete.compNatIsoDiscrete_inv_app {C : Type u₂} [Category.{v₂, u₂} C] {I : Type u₁} {D : Type u₃} [Category.{v₃, u₃} D] (F : IC) (G : Functor C D) (X : Discrete I) :
                                                            def CategoryTheory.Discrete.equivalence {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
                                                              Instances For
                                                                @[simp]
                                                                theorem CategoryTheory.Discrete.equivalence_inverse {I : Type u₁} {J : Type u₂} (e : I J) :
                                                                @[simp]
                                                                theorem CategoryTheory.Discrete.equivalence_unitIso {I : Type u₁} {J : Type u₂} (e : I J) :
                                                                (equivalence e).unitIso = natIso fun (i : Discrete I) => eqToIso
                                                                @[simp]
                                                                theorem CategoryTheory.Discrete.equivalence_counitIso {I : Type u₁} {J : Type u₂} (e : I J) :
                                                                (equivalence e).counitIso = natIso fun (j : Discrete J) => eqToIso
                                                                @[simp]
                                                                theorem CategoryTheory.Discrete.equivalence_functor {I : Type u₁} {J : Type u₂} (e : I J) :
                                                                def CategoryTheory.Discrete.equivOfEquivalence {α : Type u₁} {β : Type u₂} (h : Discrete α Discrete β) :
                                                                α β

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

                                                                Equations
                                                                  Instances For
                                                                    @[simp]
                                                                    theorem CategoryTheory.Discrete.equivOfEquivalence_apply {α : Type u₁} {β : Type u₂} (h : Discrete α Discrete β) (a✝ : α) :
                                                                    @[simp]
                                                                    theorem CategoryTheory.Discrete.equivOfEquivalence_symm_apply {α : Type u₁} {β : Type u₂} (h : Discrete α Discrete β) (a✝ : β) :

                                                                    A discrete category is equivalent to its opposite category.

                                                                    Equations
                                                                      Instances For
                                                                        @[simp]
                                                                        theorem CategoryTheory.Discrete.functor_map_id {J : Type v₁} {C : Type u₂} [Category.{v₂, u₂} C] (F : Functor (Discrete J) C) {j : Discrete J} (f : j j) :

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

                                                                        Equations
                                                                          Instances For
                                                                            @[simp]
                                                                            theorem CategoryTheory.piEquivalenceFunctorDiscrete_counitIso (J : Type u₂) (C : Type u₁) [Category.{v₁, u₁} C] :
                                                                            (piEquivalenceFunctorDiscrete J C).counitIso = NatIso.ofComponents (fun (F : Functor (Discrete J) C) => NatIso.ofComponents (fun (x : Discrete J) => Iso.refl ((({ obj := fun (F : Functor (Discrete J) C) (j : J) => F.obj { as := j }, map := fun {X Y : Functor (Discrete J) C} (f : X Y) (j : J) => f.app { as := j }, map_id := , map_comp := }.comp { obj := fun (F : JC) => Discrete.functor F, map := fun {X Y : JC} (f : X Y) => Discrete.natTrans fun (j : Discrete J) => f j.as, map_id := , map_comp := }).obj F).obj x)) )
                                                                            @[simp]
                                                                            theorem CategoryTheory.piEquivalenceFunctorDiscrete_inverse_map (J : Type u₂) (C : Type u₁) [Category.{v₁, u₁} C] {X✝ Y✝ : Functor (Discrete J) C} (f : X✝ Y✝) (j : J) :
                                                                            @[simp]
                                                                            theorem CategoryTheory.piEquivalenceFunctorDiscrete_functor_map (J : Type u₂) (C : Type u₁) [Category.{v₁, u₁} C] {X✝ Y✝ : JC} (f : X✝ Y✝) :

                                                                            A category is discrete when there is at most one morphism between two objects, in which case they are equal.

                                                                            Instances
                                                                              theorem CategoryTheory.obj_ext_of_isDiscrete {C : Type u_1} [Category.{u_2, u_1} C] [IsDiscrete C] {X Y : C} (f : X Y) :
                                                                              X = Y
                                                                              instance CategoryTheory.isIso_of_isDiscrete {C : Type u_1} [Category.{u_2, u_1} C] [IsDiscrete C] {X Y : C} (f : X Y) :