# mathlibdocumentation

category_theory.discrete_category

# Discrete categories #

We define discrete α as a structure containing a term a : α for any type α, and use this type alias to provide a small_category 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 small_category (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.nat_trans and discrete.nat_iso 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 category_theory.discrete.ext_iff {α : Type u₁} (x y : category_theory.discrete α) :
x = y x.as = y.as
@[ext]
structure category_theory.discrete (α : Type u₁) :
Type u₁
• as : α

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

Instances for category_theory.discrete
theorem category_theory.discrete.ext {α : Type u₁} (x y : category_theory.discrete α) (h : x.as = y.as) :
x = y
@[simp]
theorem category_theory.discrete.mk_as {α : Type u₁} (X : category_theory.discrete α) :
{as := X.as} = X
def category_theory.discrete_equiv {α : Type u₁} :

discrete α is equivalent to the original type α.

Equations
@[simp]
theorem category_theory.discrete_equiv_symm_apply_as {α : Type u₁} (as : α) :
= as
@[simp]
theorem category_theory.discrete_equiv_apply {α : Type u₁} (self : category_theory.discrete α) :
= self.as
@[protected, instance]
Equations
@[protected, instance]
def category_theory.discrete_category (α : Type u₁) :

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

Equations
@[protected, instance]
def category_theory.discrete.inhabited {α : Type u₁} [inhabited α] :
Equations
@[protected, instance]
meta def tactic.discrete_cases  :

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

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

@[protected, instance]
def category_theory.discrete.unique {α : Type u₁} [unique α] :
Equations
theorem category_theory.discrete.eq_of_hom {α : Type u₁} {X Y : category_theory.discrete α} (i : X Y) :
X.as = Y.as

Extract the equation from a morphism in a discrete category.

@[reducible]
def category_theory.discrete.eq_to_hom {α : Type u₁} {X Y : category_theory.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.

@[reducible]
def category_theory.discrete.eq_to_iso {α : Type u₁} {X Y : category_theory.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.

@[reducible]
def category_theory.discrete.eq_to_hom' {α : Type u₁} {a b : α} (h : a = b) :
{as := a} {as := b}

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

@[reducible]
def category_theory.discrete.eq_to_iso' {α : Type u₁} {a b : α} (h : a = b) :
{as := a} {as := b}

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

@[simp]
theorem category_theory.discrete.id_def {α : Type u₁} (X : category_theory.discrete α) :
{down := {down := _}} = 𝟙 X
@[protected, instance]
def category_theory.discrete.functor {C : Type u₂} {I : Type u₁} (F : I → C) :

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

Equations
Instances for category_theory.discrete.functor
@[simp]
theorem category_theory.discrete.functor_obj {C : Type u₂} {I : Type u₁} (F : I → C) (i : I) :
{as := i} = F i
theorem category_theory.discrete.functor_map {C : Type u₂} {I : Type u₁} (F : I → C) {i : category_theory.discrete I} (f : i i) :
= 𝟙 (F i.as)
@[simp]
theorem category_theory.discrete.functor_comp_hom_app {C : Type u₂} {I : Type u₁} {J : Type u₁'} (f : J → C) (g : I → J) (X : category_theory.discrete I) :
@[simp]
theorem category_theory.discrete.functor_comp_inv_app {C : Type u₂} {I : Type u₁} {J : Type u₁'} (f : J → C) (g : I → J) (X : category_theory.discrete I) :
def category_theory.discrete.functor_comp {C : Type u₂} {I : Type u₁} {J : Type u₁'} (f : J → C) (g : I → J) :

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

Equations
def category_theory.discrete.nat_trans {C : Type u₂} {I : Type u₁} {F G : C} (f : Π (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
@[simp]
theorem category_theory.discrete.nat_trans_app {C : Type u₂} {I : Type u₁} {F G : C} (f : Π (i : , F.obj i G.obj i) (i : category_theory.discrete I) :
= f i
def category_theory.discrete.nat_iso {C : Type u₂} {I : Type u₁} {F G : C} (f : Π (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
@[simp]
theorem category_theory.discrete.nat_iso_hom_app {C : Type u₂} {I : Type u₁} {F G : C} (f : Π (i : , F.obj i G.obj i) (X : category_theory.discrete I) :
= (f X).hom
@[simp]
theorem category_theory.discrete.nat_iso_inv_app {C : Type u₂} {I : Type u₁} {F G : C} (f : Π (i : , F.obj i G.obj i) (X : category_theory.discrete I) :
= (f X).inv
@[simp]
theorem category_theory.discrete.nat_iso_app {C : Type u₂} {I : Type u₁} {F G : C} (f : Π (i : , F.obj i G.obj i) (i : category_theory.discrete I) :
= f i
@[simp]
def category_theory.discrete.nat_iso_functor {C : Type u₂} {I : Type u₁} {F : C} :

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

Equations
@[simp]
def category_theory.discrete.comp_nat_iso_discrete {C : Type u₂} {I : Type u₁} {D : Type u₃} (F : I → C) (G : C D) :

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

Equations
@[simp]
theorem category_theory.discrete.equivalence_functor {I : Type u₁} {J : Type u₂} (e : I J) :
@[simp]
theorem category_theory.discrete.equivalence_unit_iso {I : Type u₁} {J : Type u₂} (e : I J) :
def category_theory.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
@[simp]
theorem category_theory.discrete.equivalence_inverse {I : Type u₁} {J : Type u₂} (e : I J) :
@[simp]
theorem category_theory.discrete.equivalence_counit_iso {I : Type u₁} {J : Type u₂} (e : I J) :
@[simp]
theorem category_theory.discrete.equiv_of_equivalence_apply {α : Type u₁} {β : Type u₂} (ᾰ : α) :
@[simp]
theorem category_theory.discrete.equiv_of_equivalence_symm_apply {α : Type u₁} {β : Type u₂} (ᾰ : β) :
def category_theory.discrete.equiv_of_equivalence {α : Type u₁} {β : Type u₂}  :
α β

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

Equations
@[protected]
def category_theory.discrete.opposite (α : Type u₁) :

A discrete category is equivalent to its opposite category.

Equations
@[simp]
theorem category_theory.discrete.opposite_functor_obj_as (α : Type u₁) (X : ᵒᵖ) :
= .as
@[simp]
@[simp]
theorem category_theory.discrete.functor_map_id {J : Type v₁} {C : Type u₂} (F : C) {j : category_theory.discrete J} (f : j j) :
F.map f = 𝟙 (F.obj j)