# Connected subsets of topological spaces #

In this file we define connected subsets of a topological spaces and various other properties and classes related to connectivity.

## Main definitions #

We define the following properties for sets in a topological space:

• IsConnected: a nonempty set that has no non-trivial open partition. See also the section below in the module doc.
• connectedComponent is the connected component of an element in the space.

We also have a class stating that the whole space satisfies that property: ConnectedSpace

## On the definition of connected sets/spaces #

In informal mathematics, connected spaces are assumed to be nonempty. We formalise the predicate without that assumption as IsPreconnected. In other words, the only difference is whether the empty space counts as connected. There are good reasons to consider the empty space to be “too simple to be simple” See also https://ncatlab.org/nlab/show/too+simple+to+be+simple, and in particular https://ncatlab.org/nlab/show/too+simple+to+be+simple#relationship_to_biased_definitions.

def IsPreconnected {α : Type u} [] (s : Set α) :

A preconnected set is one where there is no non-trivial open partition.

Equations
• = ∀ (u v : Set α), s u v(s u).Nonempty(s v).Nonempty(s (u v)).Nonempty
Instances For
def IsConnected {α : Type u} [] (s : Set α) :

A connected set is one that is nonempty and where there is no non-trivial open partition.

Equations
• = (s.Nonempty )
Instances For
theorem IsConnected.nonempty {α : Type u} [] {s : Set α} (h : ) :
s.Nonempty
theorem IsConnected.isPreconnected {α : Type u} [] {s : Set α} (h : ) :
theorem IsPreirreducible.isPreconnected {α : Type u} [] {s : Set α} (H : ) :
theorem IsIrreducible.isConnected {α : Type u} [] {s : Set α} (H : ) :
theorem isPreconnected_empty {α : Type u} [] :
theorem isConnected_singleton {α : Type u} [] {x : α} :
theorem isPreconnected_singleton {α : Type u} [] {x : α} :
theorem Set.Subsingleton.isPreconnected {α : Type u} [] {s : Set α} (hs : s.Subsingleton) :
theorem isPreconnected_of_forall {α : Type u} [] {s : Set α} (x : α) (H : ys, ts, x t y t ) :

If any point of a set is joined to a fixed point by a preconnected subset, then the original set is preconnected as well.

theorem isPreconnected_of_forall_pair {α : Type u} [] {s : Set α} (H : xs, ys, ts, x t y t ) :

If any two points of a set are contained in a preconnected subset, then the original set is preconnected as well.

theorem isPreconnected_sUnion {α : Type u} [] (x : α) (c : Set (Set α)) (H1 : sc, x s) (H2 : sc, ) :

A union of a family of preconnected sets with a common point is preconnected as well.

theorem isPreconnected_iUnion {α : Type u} [] {ι : Sort u_3} {s : ιSet α} (h₁ : (⋂ (i : ι), s i).Nonempty) (h₂ : ∀ (i : ι), IsPreconnected (s i)) :
IsPreconnected (⋃ (i : ι), s i)
theorem IsPreconnected.union {α : Type u} [] (x : α) {s : Set α} {t : Set α} (H1 : x s) (H2 : x t) (H3 : ) (H4 : ) :
theorem IsPreconnected.union' {α : Type u} [] {s : Set α} {t : Set α} (H : (s t).Nonempty) (hs : ) (ht : ) :
theorem IsConnected.union {α : Type u} [] {s : Set α} {t : Set α} (H : (s t).Nonempty) (Hs : ) (Ht : ) :
theorem IsPreconnected.sUnion_directed {α : Type u} [] {S : Set (Set α)} (K : DirectedOn (fun (x x_1 : Set α) => x x_1) S) (H : sS, ) :

The directed sUnion of a set S of preconnected subsets is preconnected.

theorem IsPreconnected.biUnion_of_reflTransGen {α : Type u} [] {ι : Type u_3} {t : Set ι} {s : ιSet α} (H : it, IsPreconnected (s i)) (K : it, jt, Relation.ReflTransGen (fun (i j : ι) => (s i s j).Nonempty i t) i j) :
IsPreconnected (nt, s n)

The biUnion of a family of preconnected sets is preconnected if the graph determined by whether two sets intersect is preconnected.

theorem IsConnected.biUnion_of_reflTransGen {α : Type u} [] {ι : Type u_3} {t : Set ι} {s : ιSet α} (ht : t.Nonempty) (H : it, IsConnected (s i)) (K : it, jt, Relation.ReflTransGen (fun (i j : ι) => (s i s j).Nonempty i t) i j) :
IsConnected (nt, s n)

The biUnion of a family of preconnected sets is preconnected if the graph determined by whether two sets intersect is preconnected.

theorem IsPreconnected.iUnion_of_reflTransGen {α : Type u} [] {ι : Type u_3} {s : ιSet α} (H : ∀ (i : ι), IsPreconnected (s i)) (K : ∀ (i j : ι), Relation.ReflTransGen (fun (i j : ι) => (s i s j).Nonempty) i j) :
IsPreconnected (⋃ (n : ι), s n)

Preconnectedness of the iUnion of a family of preconnected sets indexed by the vertices of a preconnected graph, where two vertices are joined when the corresponding sets intersect.

theorem IsConnected.iUnion_of_reflTransGen {α : Type u} [] {ι : Type u_3} [] {s : ιSet α} (H : ∀ (i : ι), IsConnected (s i)) (K : ∀ (i j : ι), Relation.ReflTransGen (fun (i j : ι) => (s i s j).Nonempty) i j) :
IsConnected (⋃ (n : ι), s n)
theorem IsPreconnected.iUnion_of_chain {α : Type u} {β : Type v} [] [] [] {s : βSet α} (H : ∀ (n : β), IsPreconnected (s n)) (K : ∀ (n : β), (s n s ()).Nonempty) :
IsPreconnected (⋃ (n : β), s n)

The iUnion of connected sets indexed by a type with an archimedean successor (like ℕ or ℤ) such that any two neighboring sets meet is preconnected.

theorem IsConnected.iUnion_of_chain {α : Type u} {β : Type v} [] [] [] [] {s : βSet α} (H : ∀ (n : β), IsConnected (s n)) (K : ∀ (n : β), (s n s ()).Nonempty) :
IsConnected (⋃ (n : β), s n)

The iUnion of connected sets indexed by a type with an archimedean successor (like ℕ or ℤ) such that any two neighboring sets meet is connected.

theorem IsPreconnected.biUnion_of_chain {α : Type u} {β : Type v} [] [] [] {s : βSet α} {t : Set β} (ht : t.OrdConnected) (H : nt, IsPreconnected (s n)) (K : nt, t(s n s ()).Nonempty) :
IsPreconnected (nt, s n)

The iUnion of preconnected sets indexed by a subset of a type with an archimedean successor (like ℕ or ℤ) such that any two neighboring sets meet is preconnected.

theorem IsConnected.biUnion_of_chain {α : Type u} {β : Type v} [] [] [] {s : βSet α} {t : Set β} (hnt : t.Nonempty) (ht : t.OrdConnected) (H : nt, IsConnected (s n)) (K : nt, t(s n s ()).Nonempty) :
IsConnected (nt, s n)

The iUnion of connected sets indexed by a subset of a type with an archimedean successor (like ℕ or ℤ) such that any two neighboring sets meet is preconnected.

theorem IsPreconnected.subset_closure {α : Type u} [] {s : Set α} {t : Set α} (H : ) (Kst : s t) (Ktcs : t ) :

Theorem of bark and tree: if a set is within a preconnected set and its closure, then it is preconnected as well. See also IsConnected.subset_closure.

theorem IsConnected.subset_closure {α : Type u} [] {s : Set α} {t : Set α} (H : ) (Kst : s t) (Ktcs : t ) :

Theorem of bark and tree: if a set is within a connected set and its closure, then it is connected as well. See also IsPreconnected.subset_closure.

theorem IsPreconnected.closure {α : Type u} [] {s : Set α} (H : ) :

The closure of a preconnected set is preconnected as well.

theorem IsConnected.closure {α : Type u} [] {s : Set α} (H : ) :

The closure of a connected set is connected as well.

theorem IsPreconnected.image {α : Type u} {β : Type v} [] [] {s : Set α} (H : ) (f : αβ) (hf : ) :

The image of a preconnected set is preconnected as well.

theorem IsConnected.image {α : Type u} {β : Type v} [] [] {s : Set α} (H : ) (f : αβ) (hf : ) :

The image of a connected set is connected as well.

theorem isPreconnected_closed_iff {α : Type u} [] {s : Set α} :
∀ (t t' : Set α), IsClosed t's t t'(s t).Nonempty(s t').Nonempty(s (t t')).Nonempty
theorem Inducing.isPreconnected_image {α : Type u} {β : Type v} [] [] {s : Set α} {f : αβ} (hf : ) :
theorem IsPreconnected.preimage_of_isOpenMap {α : Type u} {β : Type v} [] [] {f : αβ} {s : Set β} (hs : ) (hinj : ) (hf : ) (hsf : s ) :
theorem IsPreconnected.preimage_of_isClosedMap {α : Type u} {β : Type v} [] [] {s : Set β} (hs : ) {f : αβ} (hinj : ) (hf : ) (hsf : s ) :
theorem IsConnected.preimage_of_isOpenMap {α : Type u} {β : Type v} [] [] {s : Set β} (hs : ) {f : αβ} (hinj : ) (hf : ) (hsf : s ) :
theorem IsConnected.preimage_of_isClosedMap {α : Type u} {β : Type v} [] [] {s : Set β} (hs : ) {f : αβ} (hinj : ) (hf : ) (hsf : s ) :
theorem IsPreconnected.subset_or_subset {α : Type u} [] {s : Set α} {u : Set α} {v : Set α} (hu : ) (hv : ) (huv : Disjoint u v) (hsuv : s u v) (hs : ) :
s u s v
theorem IsPreconnected.subset_left_of_subset_union {α : Type u} [] {s : Set α} {u : Set α} {v : Set α} (hu : ) (hv : ) (huv : Disjoint u v) (hsuv : s u v) (hsu : (s u).Nonempty) (hs : ) :
s u
theorem IsPreconnected.subset_right_of_subset_union {α : Type u} [] {s : Set α} {u : Set α} {v : Set α} (hu : ) (hv : ) (huv : Disjoint u v) (hsuv : s u v) (hsv : (s v).Nonempty) (hs : ) :
s v
theorem IsPreconnected.subset_of_closure_inter_subset {α : Type u} [] {s : Set α} {u : Set α} (hs : ) (hu : ) (h'u : (s u).Nonempty) (h : s u) :
s u

If a preconnected set s intersects an open set u, and limit points of u inside s are contained in u, then the whole set s is contained in u.

theorem IsPreconnected.prod {α : Type u} {β : Type v} [] [] {s : Set α} {t : Set β} (hs : ) (ht : ) :
theorem IsConnected.prod {α : Type u} {β : Type v} [] [] {s : Set α} {t : Set β} (hs : ) (ht : ) :
theorem isPreconnected_univ_pi {ι : Type u_1} {π : ιType u_2} [(i : ι) → TopologicalSpace (π i)] {s : (i : ι) → Set (π i)} (hs : ∀ (i : ι), IsPreconnected (s i)) :
IsPreconnected (Set.univ.pi s)
@[simp]
theorem isConnected_univ_pi {ι : Type u_1} {π : ιType u_2} [(i : ι) → TopologicalSpace (π i)] {s : (i : ι) → Set (π i)} :
IsConnected (Set.univ.pi s) ∀ (i : ι), IsConnected (s i)
def connectedComponent {α : Type u} [] (x : α) :
Set α

The connected component of a point is the maximal connected set that contains this point.

Equations
Instances For
def connectedComponentIn {α : Type u} [] (F : Set α) (x : α) :
Set α

Given a set F in a topological space α and a point x : α, the connected component of x in F is the connected component of x in the subtype F seen as a set in α. This definition does not make sense if x is not in F so we return the empty set in this case.

Equations
Instances For
theorem connectedComponentIn_eq_image {α : Type u} [] {F : Set α} {x : α} (h : x F) :
= Subtype.val '' connectedComponent x, h
theorem connectedComponentIn_eq_empty {α : Type u} [] {F : Set α} {x : α} (h : xF) :
theorem mem_connectedComponent {α : Type u} [] {x : α} :
theorem mem_connectedComponentIn {α : Type u} [] {x : α} {F : Set α} (hx : x F) :
theorem connectedComponent_nonempty {α : Type u} [] {x : α} :
.Nonempty
theorem connectedComponentIn_nonempty_iff {α : Type u} [] {x : α} {F : Set α} :
().Nonempty x F
theorem connectedComponentIn_subset {α : Type u} [] (F : Set α) (x : α) :
theorem isPreconnected_connectedComponent {α : Type u} [] {x : α} :
theorem isPreconnected_connectedComponentIn {α : Type u} [] {x : α} {F : Set α} :
theorem isConnected_connectedComponent {α : Type u} [] {x : α} :
theorem isConnected_connectedComponentIn_iff {α : Type u} [] {x : α} {F : Set α} :
x F
theorem IsPreconnected.subset_connectedComponent {α : Type u} [] {x : α} {s : Set α} (H1 : ) (H2 : x s) :
theorem IsPreconnected.subset_connectedComponentIn {α : Type u} [] {s : Set α} {x : α} {F : Set α} (hs : ) (hxs : x s) (hsF : s F) :
theorem IsConnected.subset_connectedComponent {α : Type u} [] {x : α} {s : Set α} (H1 : ) (H2 : x s) :
theorem IsPreconnected.connectedComponentIn {α : Type u} [] {x : α} {F : Set α} (h : ) (hx : x F) :
theorem connectedComponent_eq {α : Type u} [] {x : α} {y : α} (h : ) :
theorem connectedComponent_eq_iff_mem {α : Type u} [] {x : α} {y : α} :
theorem connectedComponentIn_eq {α : Type u} [] {x : α} {y : α} {F : Set α} (h : ) :
theorem connectedComponentIn_univ {α : Type u} [] (x : α) :
theorem connectedComponent_disjoint {α : Type u} [] {x : α} {y : α} (h : ) :
theorem isClosed_connectedComponent {α : Type u} [] {x : α} :
theorem Continuous.image_connectedComponent_subset {α : Type u} {β : Type v} [] [] {f : αβ} (h : ) (a : α) :
theorem Continuous.image_connectedComponentIn_subset {α : Type u} {β : Type v} [] [] {f : αβ} {s : Set α} {a : α} (hf : ) (hx : a s) :
theorem Continuous.mapsTo_connectedComponent {α : Type u} {β : Type v} [] [] {f : αβ} (h : ) (a : α) :
theorem Continuous.mapsTo_connectedComponentIn {α : Type u} {β : Type v} [] [] {f : αβ} {s : Set α} (h : ) {a : α} (hx : a s) :
theorem connectedComponentIn_mono {α : Type u} [] (x : α) {F : Set α} {G : Set α} (h : F G) :
class PreconnectedSpace (α : Type u) [] :

A preconnected space is one where there is no non-trivial open partition.

• isPreconnected_univ : IsPreconnected Set.univ

The universal set Set.univ in a preconnected space is a preconnected set.

Instances
theorem PreconnectedSpace.isPreconnected_univ {α : Type u} [] [self : ] :

The universal set Set.univ in a preconnected space is a preconnected set.

class ConnectedSpace (α : Type u) [] extends :

A connected space is a nonempty one where there is no non-trivial open partition.

• isPreconnected_univ : IsPreconnected Set.univ
• toNonempty :

A connected space is nonempty.

Instances
theorem ConnectedSpace.toNonempty {α : Type u} [] [self : ] :

A connected space is nonempty.

theorem isConnected_univ {α : Type u} [] [] :
IsConnected Set.univ
theorem connectedSpace_iff_univ {α : Type u} [] :
IsConnected Set.univ
theorem isPreconnected_range {α : Type u} {β : Type v} [] [] {f : αβ} (h : ) :
theorem isConnected_range {α : Type u} {β : Type v} [] [] [] {f : αβ} (h : ) :
theorem Function.Surjective.connectedSpace {α : Type u} {β : Type v} [] [] [] {f : αβ} (hf : ) (hf' : ) :
instance Quotient.instConnectedSpace {α : Type u} [] {s : } [] :
Equations
• =
theorem DenseRange.preconnectedSpace {α : Type u} {β : Type v} [] [] {f : αβ} (hf : ) (hc : ) :
theorem connectedSpace_iff_connectedComponent {α : Type u} [] :
∃ (x : α), = Set.univ
theorem preconnectedSpace_iff_connectedComponent {α : Type u} [] :
∀ (x : α), = Set.univ
@[simp]
theorem PreconnectedSpace.connectedComponent_eq_univ {X : Type u_3} [] [h : ] (x : X) :
= Set.univ
instance instPreconnectedSpaceProd {α : Type u} {β : Type v} [] [] :
Equations
• =
instance instConnectedSpaceProd {α : Type u} {β : Type v} [] [] [] [] :
Equations
• =
instance instPreconnectedSpaceForall {ι : Type u_1} {π : ιType u_2} [(i : ι) → TopologicalSpace (π i)] [∀ (i : ι), PreconnectedSpace (π i)] :
PreconnectedSpace ((i : ι) → π i)
Equations
• =
instance instConnectedSpaceForall {ι : Type u_1} {π : ιType u_2} [(i : ι) → TopologicalSpace (π i)] [∀ (i : ι), ConnectedSpace (π i)] :
ConnectedSpace ((i : ι) → π i)
Equations
• =
@[instance 100]
Equations
• =
@[instance 100]
instance IrreducibleSpace.connectedSpace (α : Type u) [] [] :
Equations
• =
theorem Subtype.preconnectedSpace {α : Type u} [] {s : Set α} (h : ) :
theorem Subtype.connectedSpace {α : Type u} [] {s : Set α} (h : ) :
theorem isPreconnected_iff_preconnectedSpace {α : Type u} [] {s : Set α} :
theorem isConnected_iff_connectedSpace {α : Type u} [] {s : Set α} :