# Documentation

Mathlib.CategoryTheory.IsConnected

# Connected category #

Define a connected category as a nonempty category for which every functor to a discrete category is isomorphic to the constant functor.

NB. Some authors include the empty category as connected, we do not. We instead are interested in categories with exactly one 'connected component'.

We give some equivalent definitions:

• A nonempty category for which every functor to a discrete category is constant on objects. See any_functor_const_on_obj and Connected.of_any_functor_const_on_obj.
• A nonempty category for which every function F for which the presence of a morphism f : j₁ ⟶ j₂ implies F j₁ = F j₂ must be constant everywhere. See constant_of_preserves_morphisms and Connected.of_constant_of_preserves_morphisms.
• A nonempty category for which any subset of its elements containing the default and closed under morphisms is everything. See induct_on_objects and Connected.of_induct.
• A nonempty category for which every object is related under the reflexive transitive closure of the relation "there is a morphism in some direction from j₁ to j₂". See connected_zigzag and zigzag_connected.
• A nonempty category for which for any two objects there is a sequence of morphisms (some reversed) from one to the other. See exists_zigzag' and connected_of_zigzag.

We also prove the result that the functor given by (X × -) preserves any connected limit. That is, any limit of shape J where J is a connected category is preserved by the functor (X × -). This appears in CategoryTheory.Limits.Connected.

• iso_constant : ∀ {α : Type u₁} (F : ) (j : J), Nonempty (F ().obj (F.obj j))

A possibly empty category for which every functor to a discrete category is constant.

A possibly empty category for which every functor to a discrete category is constant.

Instances
class CategoryTheory.IsConnected (J : Type u₁) [] extends :
• iso_constant : ∀ {α : Type u₁} (F : ) (j : J), Nonempty (F ().obj (F.obj j))
• is_nonempty :

We define a connected category as a nonempty category for which every functor to a discrete category is constant.

NB. Some authors include the empty category as connected, we do not. We instead are interested in categories with exactly one 'connected component'.

This allows us to show that the functor X ⨯ - preserves connected limits.

Instances
def CategoryTheory.isoConstant {J : Type u₁} [] {α : Type u₂} (F : ) (j : J) :
F ().obj (F.obj j)

If J is connected, any functor F : J ⥤ Discrete α is isomorphic to the constant functor with value F.obj j (for any choice of j).

Instances For
theorem CategoryTheory.any_functor_const_on_obj {J : Type u₁} [] {α : Type u₂} (F : ) (j : J) (j' : J) :
F.obj j = F.obj j'

If J is connected, any functor to a discrete category is constant on objects. The converse is given in IsConnected.of_any_functor_const_on_obj.

theorem CategoryTheory.IsConnected.of_any_functor_const_on_obj {J : Type u₁} [] [] (h : ∀ {α : Type u₁} (F : ) (j j' : J), F.obj j = F.obj j') :

If any functor to a discrete category is constant on objects, J is connected. The converse of any_functor_const_on_obj.

theorem CategoryTheory.constant_of_preserves_morphisms {J : Type u₁} [] {α : Type u₂} (F : Jα) (h : ∀ (j₁ j₂ : J), (j₁ j₂) → F j₁ = F j₂) (j : J) (j' : J) :
F j = F j'

If J is connected, then given any function F such that the presence of a morphism j₁ ⟶ j₂ implies F j₁ = F j₂, we have that F is constant. This can be thought of as a local-to-global property.

The converse is shown in IsConnected.of_constant_of_preserves_morphisms

theorem CategoryTheory.IsConnected.of_constant_of_preserves_morphisms {J : Type u₁} [] [] (h : ∀ {α : Type u₁} (F : Jα), (∀ {j₁ j₂ : J}, (j₁ j₂) → F j₁ = F j₂) → ∀ (j j' : J), F j = F j') :

J is connected if: given any function F : J → α which is constant for any j₁, j₂ for which there is a morphism j₁ ⟶ j₂, then F is constant. This can be thought of as a local-to-global property.

The converse of constant_of_preserves_morphisms.

theorem CategoryTheory.induct_on_objects {J : Type u₁} [] (p : Set J) {j₀ : J} (h0 : j₀ p) (h1 : ∀ {j₁ j₂ : J}, (j₁ j₂) → (j₁ p j₂ p)) (j : J) :
j p

An inductive-like property for the objects of a connected category. If the set p is nonempty, and p is closed under morphisms of J, then p contains all of J.

The converse is given in IsConnected.of_induct.

theorem CategoryTheory.IsConnected.of_induct {J : Type u₁} [] [] {j₀ : J} (h : ∀ (p : Set J), j₀ p(∀ {j₁ j₂ : J}, (j₁ j₂) → (j₁ p j₂ p)) → ∀ (j : J), j p) :

If any maximal connected component containing some element j₀ of J is all of J, then J is connected.

The converse of induct_on_objects.

Lifting the universe level of morphisms and objects preserves connectedness.

theorem CategoryTheory.isPreconnected_induction {J : Type u₁} [] (Z : JSort u_1) (h₁ : {j₁ j₂ : J} → (j₁ j₂) → Z j₁Z j₂) (h₂ : {j₁ j₂ : J} → (j₁ j₂) → Z j₂Z j₁) {j₀ : J} (x : Z j₀) (j : J) :
Nonempty (Z j)

Another induction principle for IsPreconnected J: given a type family Z : J → Sort* and a rule for transporting in both directions along a morphism in J, we can transport an x : Z j₀ to a point in Z j for any j.

theorem CategoryTheory.isPreconnected_of_equivalent {J : Type u₁} [] {K : Type u₂} [] (e : J K) :

If J and K are equivalent, then if J is preconnected then K is as well.

theorem CategoryTheory.isConnected_of_equivalent {J : Type u₁} [] {K : Type u₂} [] (e : J K) :

If J and K are equivalent, then if J is connected then K is as well.

instance CategoryTheory.isPreconnected_op {J : Type u₁} [] :

If J is preconnected, then Jᵒᵖ is preconnected as well.

instance CategoryTheory.isConnected_op {J : Type u₁} [] :

If J is connected, then Jᵒᵖ is connected as well.

@[reducible]
def CategoryTheory.Zag {J : Type u₁} [] (j₁ : J) (j₂ : J) :

j₁ and j₂ are related by Zag if there is a morphism between them.

Instances For
theorem CategoryTheory.zag_symmetric {J : Type u₁} [] :
Symmetric CategoryTheory.Zag
@[reducible]
def CategoryTheory.Zigzag {J : Type u₁} [] :
JJProp

j₁ and j₂ are related by Zigzag if there is a chain of morphisms from j₁ to j₂, with backward morphisms allowed.

Instances For
theorem CategoryTheory.zigzag_symmetric {J : Type u₁} [] :
Symmetric CategoryTheory.Zigzag
theorem CategoryTheory.zigzag_equivalence {J : Type u₁} [] :
Equivalence CategoryTheory.Zigzag

The setoid given by the equivalence relation Zigzag. A quotient for this setoid is a connected component of the category.

Instances For
theorem CategoryTheory.zigzag_obj_of_zigzag {J : Type u₁} [] {K : Type u₂} [] (F : ) {j₁ : J} {j₂ : J} (h : ) :
CategoryTheory.Zigzag (F.obj j₁) (F.obj j₂)

If there is a zigzag from j₁ to j₂, then there is a zigzag from F j₁ to F j₂ as long as F is a functor.

theorem CategoryTheory.zag_of_zag_obj {J : Type u₁} [] {K : Type u₂} [] (F : ) {j₁ : J} {j₂ : J} (h : CategoryTheory.Zag (F.obj j₁) (F.obj j₂)) :
theorem CategoryTheory.equiv_relation {J : Type u₁} [] (r : JJProp) (hr : ) (h : {j₁ j₂ : J} → (j₁ j₂) → r j₁ j₂) (j₁ : J) (j₂ : J) :
r j₁ j₂

Any equivalence relation containing (⟶) holds for all pairs of a connected category.

theorem CategoryTheory.isConnected_zigzag {J : Type u₁} [] (j₁ : J) (j₂ : J) :

In a connected category, any two objects are related by Zigzag.

theorem CategoryTheory.zigzag_isConnected {J : Type u₁} [] [] (h : ∀ (j₁ j₂ : J), ) :

If any two objects in a nonempty category are related by Zigzag, the category is connected.

theorem CategoryTheory.exists_zigzag' {J : Type u₁} [] (j₁ : J) (j₂ : J) :
l, List.Chain CategoryTheory.Zag j₁ l List.getLast (j₁ :: l) (_ : j₁ :: l []) = j₂
theorem CategoryTheory.isConnected_of_zigzag {J : Type u₁} [] [] (h : ∀ (j₁ j₂ : J), l, List.Chain CategoryTheory.Zag j₁ l List.getLast (j₁ :: l) (_ : j₁ :: l []) = j₂) :

If any two objects in a nonempty category are linked by a sequence of (potentially reversed) morphisms, then J is connected.

The converse of exists_zigzag'.

If Discrete α is connected, then α is (type-)equivalent to PUnit.

Instances For
theorem CategoryTheory.nat_trans_from_is_connected {J : Type u₁} [] {C : Type u₂} [] {X : C} {Y : C} (α : ().obj X ().obj Y) (j : J) (j' : J) :
α.app j = α.app j'

For objects X Y : C, any natural transformation α : const X ⟶ const Y from a connected category must be constant. This is the key property of connected categories which we use to establish properties about limits.

instance CategoryTheory.instFullFunctorCategoryConst {J : Type u₁} [] {C : Type u₂} [] :