3.1.Β Topological spaces
Definition 3.1 (Topological space)
Let X be a set and \mathcal{T} a collection of subsets of X such that
-
The sets
\emptysetandXbelong to\mathcal{T}. -
Any finite intersection of elements of
\mathcal{T}belongs to\mathcal{T}. -
Any arbitrary union of elements of
\mathcal{T}belongs to\mathcal{T}.
Then we will say that \mathcal{T} is a topology on X, that (X, \mathcal{T}) is a topological space and that the elements of \mathcal{T} are open in this space.
In Lean, this definition is written as a structure consisting of four elements:
class TopologicalSpace (X : Type u) where
IsOpen : Set X β Prop
isOpen_univ : IsOpen Set.univ
isOpen_inter : β s t, IsOpen s β IsOpen t β IsOpen (s β© t)
isOpen_sUnion : β s, (β t β s, IsOpen t) β IsOpen (ββ s)
The first element, IsOpen, is a function taking each set of X to a proposition, that is, it is a description of the elements of \mathcal{T} as the set {U β Set (X) | IsOpen U}. The other three elements are proofs of the properties in the definition.
Let us look at some examples and their proofs in Lean.
Example 3.1
Let X be any set. Consider the collection of all subsets of X, \mathcal{T} = \mathcal{P}(X). Then \mathcal{T} is a topology on X, which we call the discrete topology.
Proof. We can describe \mathcal T as {U β Set (X) | true}, because IsOpen is true for any U.
def DiscreteTopo (X : Type) : TopologicalSpace X where
IsOpen (_ : Set X) := trueNow, proving the remaining properties is easy:
isOpen_univ := X:Typeβ’ true = true
Applying the function fun x β¦ true to any set always returns true, so it suffices to use trivial.
@[reducible]
def DiscreteTopo (X : Type) : TopologicalSpace X where
IsOpen (_ : Set X) := true
isOpen_univ := X:Typeβ’ true = true
All goals completed! π
isOpen_inter := X:Typeβ’ β (s t : Set X), true = true β true = true β true = true
X:Typesβ:Set Xtβ:Set XaβΒΉ:true = trueaβ:true = trueβ’ true = true
All goals completed! π
isOpen_sUnion := X:Typeβ’ β (s : Set (Set X)), (β t β s, true = true) β true = true
X:Typesβ:Set (Set X)aβ:β t β sβ, true = trueβ’ true = true
All goals completed! πβ
Example 3.2
Let X be any set. Consider the collection \mathcal{T}=\{\emptyset, X\}. Then \mathcal{T} is a topology on X, which we call the trivial topology.
Proof. We can describe \mathcal{T} as {U β Set (X) | U = X β¨ U = β
}.
@[reducible]
def TrivialTopology (X : Type) : TopologicalSpace X where
IsOpen (s : Set X) := s = Set.univ β¨ s = β
The first condition holds trivially: we want to see X = X \lor X = \emptyset.
isOpen_univ := X:Typeβ’ Set.univ = Set.univ β¨ Set.univ = β
X:Typeβ’ Set.univ = Set.univ
All goals completed! π
Let us now consider two open sets (intro). We distinguish cases:
isOpen_inter := X:Typeβ’ β (s t : Set X), s = Set.univ β¨ s = β
β t = Set.univ β¨ t = β
β s β© t = Set.univ β¨ s β© t = β
intro s X:Types:Set Xt:Set Xβ’ s = Set.univ β¨ s = β
β t = Set.univ β¨ t = β
β s β© t = Set.univ β¨ s β© t = β
X:Types:Set Xt:Set Xhs:s = Set.univ β¨ s = β
β’ t = Set.univ β¨ t = β
β s β© t = Set.univ β¨ s β© t = β
X:Types:Set Xt:Set Xhs:s = Set.univ β¨ s = β
ht:t = Set.univ β¨ t = β
β’ s β© t = Set.univ β¨ s β© t = β
X:Types:Set Xt:Set Xht:t = Set.univ β¨ t = β
hs_univ:s = Set.univβ’ s β© t = Set.univ β¨ s β© t = β
X:Types:Set Xt:Set Xht:t = Set.univ β¨ t = β
hs_empty:s = β
β’ s β© t = Set.univ β¨ s β© t = β
X:Types:Set Xt:Set Xhs_univ:s = Set.univht_univ:t = Set.univβ’ s β© t = Set.univ β¨ s β© t = β
X:Types:Set Xt:Set Xhs_univ:s = Set.univht_empty:t = β
β’ s β© t = Set.univ β¨ s β© t = β
X:Types:Set Xt:Set Xht:t = Set.univ β¨ t = β
hs_empty:s = β
β’ s β© t = Set.univ β¨ s β© t = β
If both are X, the intersection will be X and therefore open. If one of the two is empty, then the intersection is empty, also open.
X:Types:Set Xt:Set Xhs_univ:s = Set.univht_univ:t = Set.univβ’ s β© t = Set.univ β¨ s β© t = β
X:Types:Set Xt:Set Xhs_univ:s = Set.univht_univ:t = Set.univβ’ s β© t = Set.univ -- 1. both are univ
X:Types:Set Xt:Set Xhs_univ:s = Set.univht_univ:t = Set.univβ’ Set.univ β© Set.univ = Set.univ
All goals completed! π
X:Types:Set Xt:Set Xhs_univ:s = Set.univht_empty:t = β
β’ s β© t = Set.univ β¨ s β© t = β
X:Types:Set Xt:Set Xhs_univ:s = Set.univht_empty:t = β
β’ s β© t = β
-- 2. t is empty
X:Types:Set Xt:Set Xhs_univ:s = Set.univht_empty:t = β
β’ s β© β
= β
All goals completed! π
X:Types:Set Xt:Set Xht:t = Set.univ β¨ t = β
hs_empty:s = β
β’ s β© t = Set.univ β¨ s β© t = β
X:Types:Set Xt:Set Xht:t = Set.univ β¨ t = β
hs_empty:s = β
β’ s β© t = β
-- 3. s is empty
X:Types:Set Xt:Set Xht:t = Set.univ β¨ t = β
hs_empty:s = β
β’ β
β© t = β
All goals completed! π
Finally, consider an arbitrary collection S of open sets. To see whether the union is open, we consider two different cases: either X is in S, in which case the union is X, or it is not, in which case all the sets in S are the empty set and so is the union.
isOpen_sUnion := X:Typeβ’ β (s : Set (Set X)), (β t β s, t = Set.univ β¨ t = β
) β ββ s = Set.univ β¨ ββ s = β
intro S X:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
β’ ββ S = Set.univ β¨ ββ S = β
X:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h1:Set.univ β Sβ’ ββ S = Set.univ β¨ ββ S = β
X:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h2:Set.univ β Sβ’ ββ S = Set.univ β¨ ββ S = β
-- h1 : Set.univ β S
-- h2 : Set.univ β S
X:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h1:Set.univ β Sβ’ ββ S = Set.univ β¨ ββ S = β
X:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h1:Set.univ β Sβ’ ββ S = Set.univ
X:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h1:Set.univ β Ss:Xβ’ s β ββ S β s β Set.univ
X:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h1:Set.univ β Ss:Xβ’ s β ββ S β s β Set.univX:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h1:Set.univ β Ss:Xβ’ s β Set.univ β s β ββ S X:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h1:Set.univ β Ss:Xβ’ s β ββ S β s β Set.univX:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h1:Set.univ β Ss:Xβ’ s β Set.univ β s β ββ S X:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h1:Set.univ β Ss:Xhs:s β Set.univβ’ s β ββ S
X:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h1:Set.univ β Ss:Xhs:s β ββ Sβ’ s β Set.univ All goals completed! π
X:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h1:Set.univ β Ss:Xhs:s β Set.univβ’ s β ββ S All goals completed! π -- uses h1 implicitly to close the goal
X:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h2:Set.univ β Sβ’ ββ S = Set.univ β¨ ββ S = β
X:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h2:Set.univ β Sβ’ ββ S = β
X:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h2:Set.univ β Sβ’ β s β S, s = β
intro s X:TypeS:Set (Set X)hS:β t β S, t = Set.univ β¨ t = β
h2:Set.univ β Ss:Set Xhs:s β Sβ’ s = β
X:TypeS:Set (Set X)h2:Set.univ β Ss:Set Xhs:s β ShS:s = Set.univ β¨ s = β
β’ s = β
X:TypeS:Set (Set X)h2:Set.univ β Ss:Set Xhs:s β ShS:s = Set.univβ’ s = β
X:TypeS:Set (Set X)h2:Set.univ β Ss:Set Xhs:s β ShS:s = β
β’ s = β
X:TypeS:Set (Set X)h2:Set.univ β Ss:Set Xhs:s β ShS:s = Set.univβ’ s = β
X:TypeS:Set (Set X)h2:Set.univ β Ss:Set Xhs:s β ShS:s = Set.univthis:Β¬s = β
β’ False
X:TypeS:Set (Set X)h2:Set.univ β Ss:Set Xhs:Set.univ β ShS:s = Set.univthis:Β¬s = β
β’ False
All goals completed! π
X:TypeS:Set (Set X)h2:Set.univ β Ss:Set Xhs:s β ShS:s = β
β’ s = β
All goals completed! πβ
Example 3.3
Consider the real line and the usual definition of an open set in \mathbb{R}, that is, A \subseteq \mathbb{R} is open if and only if for each point x \in A there exists an open ball centred at x entirely contained in A. Let \mathcal{T} be the collection of these open sets. Then \mathcal{T} is a topology on \mathbb{R}, which we call the usual topology.
Proof. In Lean, we can describe this topological space by giving its elements in the following way, where each object is defined beforehand.
def UsualTopology : TopologicalSpace β where
IsOpen := Real.IsOpen
isOpen_univ := Real.isOpen_univ
isOpen_inter := Real.isOpen_inter
isOpen_sUnion := Real.isOpen_sUnionThe definition of an open set can be written like this:
def Real.IsOpen (s : Set β) : Prop :=
β x β s, β Ξ΄ > 0, β y : β, x - Ξ΄ < y β§ y < x + Ξ΄ β y β sWe give the proof for the finite intersection. The others use similar mechanisms.
Let, therefore, s and t be two subsets of \mathcal{T}. Let x \in t \cap s; we want to see that there exists an open ball centred at x and contained in t \cap s.
lemma Real.isOpen_inter (s t : Set β) (hs : IsOpen s) (ht : IsOpen t) : IsOpen (s β© t) := s:Set βt:Set βhs:IsOpen sht:IsOpen tβ’ IsOpen (s β© t)
intro x s:Set βt:Set βhs:IsOpen sht:IsOpen tx:βhx:x β s β© tβ’ β Ξ΄ > 0, β (y : β), x - Ξ΄ < y β§ y < x + Ξ΄ β y β s β© t
Since x \in s, there exists a \delta_1>0 (hΞ΄1) such that B_{\delta_1}(x) \subseteq s (hs). Analogously, there exists a \delta_2>0 (hΞ΄2) such that B_{\delta_2}(x) \subseteq t (ht). It suffices to take \delta = \min \{\delta_1, \delta_2\}.
s:Set βt:Set βhsβ:IsOpen sht:IsOpen tx:βhx:x β s β© tΞ΄1:βhΞ΄1:Ξ΄1 > 0hs:β (y : β), x - Ξ΄1 < y β§ y < x + Ξ΄1 β y β sβ’ β Ξ΄ > 0, β (y : β), x - Ξ΄ < y β§ y < x + Ξ΄ β y β s β© t
s:Set βt:Set βhsβ:IsOpen shtβ:IsOpen tx:βhx:x β s β© tΞ΄1:βhΞ΄1:Ξ΄1 > 0hs:β (y : β), x - Ξ΄1 < y β§ y < x + Ξ΄1 β y β sΞ΄2:βhΞ΄2:Ξ΄2 > 0ht:β (y : β), x - Ξ΄2 < y β§ y < x + Ξ΄2 β y β tβ’ β Ξ΄ > 0, β (y : β), x - Ξ΄ < y β§ y < x + Ξ΄ β y β s β© t
s:Set βt:Set βhsβ:IsOpen shtβ:IsOpen tx:βhx:x β s β© tΞ΄1:βhΞ΄1:Ξ΄1 > 0hs:β (y : β), x - Ξ΄1 < y β§ y < x + Ξ΄1 β y β sΞ΄2:βhΞ΄2:Ξ΄2 > 0ht:β (y : β), x - Ξ΄2 < y β§ y < x + Ξ΄2 β y β tβ’ min Ξ΄1 Ξ΄2 > 0 β§ β (y : β), x - min Ξ΄1 Ξ΄2 < y β§ y < x + min Ξ΄1 Ξ΄2 β y β s β© t
Trivially \delta > 0.
s:Set βt:Set βhsβ:IsOpen shtβ:IsOpen tx:βhx:x β s β© tΞ΄1:βhΞ΄1:Ξ΄1 > 0hs:β (y : β), x - Ξ΄1 < y β§ y < x + Ξ΄1 β y β sΞ΄2:βhΞ΄2:Ξ΄2 > 0ht:β (y : β), x - Ξ΄2 < y β§ y < x + Ξ΄2 β y β tβ’ min Ξ΄1 Ξ΄2 > 0s:Set βt:Set βhsβ:IsOpen shtβ:IsOpen tx:βhx:x β s β© tΞ΄1:βhΞ΄1:Ξ΄1 > 0hs:β (y : β), x - Ξ΄1 < y β§ y < x + Ξ΄1 β y β sΞ΄2:βhΞ΄2:Ξ΄2 > 0ht:β (y : β), x - Ξ΄2 < y β§ y < x + Ξ΄2 β y β tβ’ β (y : β), x - min Ξ΄1 Ξ΄2 < y β§ y < x + min Ξ΄1 Ξ΄2 β y β s β© t
s:Set βt:Set βhsβ:IsOpen shtβ:IsOpen tx:βhx:x β s β© tΞ΄1:βhΞ΄1:Ξ΄1 > 0hs:β (y : β), x - Ξ΄1 < y β§ y < x + Ξ΄1 β y β sΞ΄2:βhΞ΄2:Ξ΄2 > 0ht:β (y : β), x - Ξ΄2 < y β§ y < x + Ξ΄2 β y β tβ’ min Ξ΄1 Ξ΄2 > 0 All goals completed! π
To see that B_\delta (x) \subseteq s \cap t, we consider y \in B_\delta(x) and want to see that y \in s and that y \in t. To see y \in s, since B_{\delta_1}(x) \subseteq s (hs), it suffices to see y \in B_{\delta_1}(x).
s:Set βt:Set βhsβ:IsOpen shtβ:IsOpen tx:βhx:x β s β© tΞ΄1:βhΞ΄1:Ξ΄1 > 0hs:β (y : β), x - Ξ΄1 < y β§ y < x + Ξ΄1 β y β sΞ΄2:βhΞ΄2:Ξ΄2 > 0ht:β (y : β), x - Ξ΄2 < y β§ y < x + Ξ΄2 β y β tβ’ β (y : β), x - min Ξ΄1 Ξ΄2 < y β§ y < x + min Ξ΄1 Ξ΄2 β y β s β© t intro y s:Set βt:Set βhsβ:IsOpen shtβ:IsOpen tx:βhx:x β s β© tΞ΄1:βhΞ΄1:Ξ΄1 > 0hs:β (y : β), x - Ξ΄1 < y β§ y < x + Ξ΄1 β y β sΞ΄2:βhΞ΄2:Ξ΄2 > 0ht:β (y : β), x - Ξ΄2 < y β§ y < x + Ξ΄2 β y β ty:βhy:x - min Ξ΄1 Ξ΄2 < y β§ y < x + min Ξ΄1 Ξ΄2β’ y β s β© t
s:Set βt:Set βhsβ:IsOpen shtβ:IsOpen tx:βhx:x β s β© tΞ΄1:βhΞ΄1:Ξ΄1 > 0hs:β (y : β), x - Ξ΄1 < y β§ y < x + Ξ΄1 β y β sΞ΄2:βhΞ΄2:Ξ΄2 > 0ht:β (y : β), x - Ξ΄2 < y β§ y < x + Ξ΄2 β y β ty:βhy:x - min Ξ΄1 Ξ΄2 < y β§ y < x + min Ξ΄1 Ξ΄2β’ y β ss:Set βt:Set βhsβ:IsOpen shtβ:IsOpen tx:βhx:x β s β© tΞ΄1:βhΞ΄1:Ξ΄1 > 0hs:β (y : β), x - Ξ΄1 < y β§ y < x + Ξ΄1 β y β sΞ΄2:βhΞ΄2:Ξ΄2 > 0ht:β (y : β), x - Ξ΄2 < y β§ y < x + Ξ΄2 β y β ty:βhy:x - min Ξ΄1 Ξ΄2 < y β§ y < x + min Ξ΄1 Ξ΄2β’ y β t
s:Set βt:Set βhsβ:IsOpen shtβ:IsOpen tx:βhx:x β s β© tΞ΄1:βhΞ΄1:Ξ΄1 > 0hs:β (y : β), x - Ξ΄1 < y β§ y < x + Ξ΄1 β y β sΞ΄2:βhΞ΄2:Ξ΄2 > 0ht:β (y : β), x - Ξ΄2 < y β§ y < x + Ξ΄2 β y β ty:βhy:x - min Ξ΄1 Ξ΄2 < y β§ y < x + min Ξ΄1 Ξ΄2β’ y β s s:Set βt:Set βhsβ:IsOpen shtβ:IsOpen tx:βhx:x β s β© tΞ΄1:βhΞ΄1:Ξ΄1 > 0hs:β (y : β), x - Ξ΄1 < y β§ y < x + Ξ΄1 β y β sΞ΄2:βhΞ΄2:Ξ΄2 > 0ht:β (y : β), x - Ξ΄2 < y β§ y < x + Ξ΄2 β y β ty:βhy:x - min Ξ΄1 Ξ΄2 < y β§ y < x + min Ξ΄1 Ξ΄2β’ x - Ξ΄1 < y β§ y < x + Ξ΄1
Actually, this condition reduces to two inequalities, which are easy to prove given that \delta \leq \delta_1 (hΞ΄).
s:Set βt:Set βhsβ:IsOpen shtβ:IsOpen tx:βhx:x β s β© tΞ΄1:βhΞ΄1:Ξ΄1 > 0hs:β (y : β), x - Ξ΄1 < y β§ y < x + Ξ΄1 β y β sΞ΄2:βhΞ΄2:Ξ΄2 > 0ht:β (y : β), x - Ξ΄2 < y β§ y < x + Ξ΄2 β y β ty:βhy:x - min Ξ΄1 Ξ΄2 < y β§ y < x + min Ξ΄1 Ξ΄2hΞ΄:min Ξ΄1 Ξ΄2 β€ Ξ΄1β’ x - Ξ΄1 < y β§ y < x + Ξ΄1
s:Set βt:Set βhsβ:IsOpen shtβ:IsOpen tx:βhx:x β s β© tΞ΄1:βhΞ΄1:Ξ΄1 > 0hs:β (y : β), x - Ξ΄1 < y β§ y < x + Ξ΄1 β y β sΞ΄2:βhΞ΄2:Ξ΄2 > 0ht:β (y : β), x - Ξ΄2 < y β§ y < x + Ξ΄2 β y β ty:βhy:x - min Ξ΄1 Ξ΄2 < y β§ y < x + min Ξ΄1 Ξ΄2hΞ΄:min Ξ΄1 Ξ΄2 β€ Ξ΄1β’ x - Ξ΄1 < ys:Set βt:Set βhsβ:IsOpen shtβ:IsOpen tx:βhx:x β s β© tΞ΄1:βhΞ΄1:Ξ΄1 > 0hs:β (y : β), x - Ξ΄1 < y β§ y < x + Ξ΄1 β y β sΞ΄2:βhΞ΄2:Ξ΄2 > 0ht:β (y : β), x - Ξ΄2 < y β§ y < x + Ξ΄2 β y β ty:βhy:x - min Ξ΄1 Ξ΄2 < y β§ y < x + min Ξ΄1 Ξ΄2hΞ΄:min Ξ΄1 Ξ΄2 β€ Ξ΄1β’ y < x + Ξ΄1
all_goals All goals completed! π
Proving that y \in t is analogous. β
3.1.1.Β Open sets
As we have said, the open sets in a topological space are the elements of the topology. In Lean, it is a function TopologicalSpace.IsOpen of type Set X β Prop. We can use this definition directly to prove that an open set is indeed open.
Example 3.4
By definition, the universe, X, is always open. Indeed:
example (X : Type) [T : TopologicalSpace X] : T.IsOpen Set.univ := X:TypeT:TopologicalSpace Xβ’ TopologicalSpace.IsOpen Set.univ
All goals completed! πExample 3.5
In Definition 3.1, we had the condition \emptyset \in \mathcal{T}, a condition that does not appear in the Mathlib definition.
It can be proved that the empty set is open from the remaining conditions: we can write \emptyset as \emptyset = \bigcup_{x \in \emptyset} \{x\}. Applying that the arbitrary union of open sets is open, it would suffice to see that \forall x \in \emptyset, \{x\} is an open set. Which is trivial.
example (X : Type) [TopologicalSpace X] : IsOpen (β
: Set X) := X:Typeinstβ:TopologicalSpace Xβ’ IsOpen β
X:Typeinstβ:TopologicalSpace Xβ’ β
= ββ β
X:Typeinstβ:TopologicalSpace Xh1:β
= ββ β
β’ IsOpen β
X:Typeinstβ:TopologicalSpace Xh1:β
= ββ β
β’ IsOpen β
X:Typeinstβ:TopologicalSpace Xh1:β
= ββ β
β’ IsOpen (ββ β
)
X:Typeinstβ:TopologicalSpace Xh1:β
= ββ β
β’ β t β β
, IsOpen t
intro t X:Typeinstβ:TopologicalSpace Xh1:β
= ββ β
t:Set Xht:t β β
β’ IsOpen t
X:Typeinstβ:TopologicalSpace Xh1:β
= ββ β
t:Set Xht:t β β
this:Β¬IsOpen tβ’ False
All goals completed! πExample 3.6
In the usual topology, (\mathbb{R}, \mathcal{T}_u), the open intervals I = (a, b) with a < b are open sets of the topology.
Proof. Consider an interval of the form (a, b); we want to see that it is open. To do so, let x \in (a, b), and let us see that there exists a \delta >0 such that \forall y \in \mathbb{R}, if y \in B_\delta(x) then y \in (a, b).
lemma ioo_open_in_R (a b : β) :
UsualTopology.IsOpen ((Set.Ioo a b) : Set β) := a:βb:ββ’ TopologicalSpace.IsOpen (Set.Ioo a b)
a:βb:ββ’ TopologicalSpace.IsOpen (Set.Ioo a b)
intro x a:βb:βx:βhx:x β Set.Ioo a bβ’ β Ξ΄ > 0, β (y : β), x - Ξ΄ < y β§ y < x + Ξ΄ β y β Set.Ioo a b
We take \delta = min \{x-a, b-x\}. Obviously \delta >0 since a < x < b.
a:βb:βx:βhx:x β Set.Ioo a bβ’ min (x - a) (b - x) > 0 β§ β (y : β), x - min (x - a) (b - x) < y β§ y < x + min (x - a) (b - x) β y β Set.Ioo a b -- nuestro Ξ΄
a:βb:βx:βhx:x β Set.Ioo a bβ’ min (x - a) (b - x) > 0a:βb:βx:βhx:x β Set.Ioo a bβ’ β (y : β), x - min (x - a) (b - x) < y β§ y < x + min (x - a) (b - x) β y β Set.Ioo a b
a:βb:βx:βhx:x β Set.Ioo a bβ’ min (x - a) (b - x) > 0 -- Ξ΄ > 0 ?
a:βb:βx:βhx:x β Set.Ioo a bβ’ 0 < x - a β§ 0 < b - x
All goals completed! π
Let now y \in B_\delta(x); we want to see that y \in (a, b). There are two possible cases, depending on the value \delta takes. If \delta = x-a, that is, x-a < b -x, then we have
y \in B_\delta(x) \implies x - (x - a) < y < x + (x - a) < x + (b - x) \implies a < y < b,
hence y \in (a, b). The case \delta = b -x is analogous.
a:βb:βx:βhx:x β Set.Ioo a bβ’ β (y : β), x - min (x - a) (b - x) < y β§ y < x + min (x - a) (b - x) β y β Set.Ioo a b -- (x - Ξ΄, x + Ξ΄) β (a, b) ?
-- hay que diferenciar cuando Ξ΄ = x-a y Ξ΄ = b-x
intro y a:βb:βx:βhx:x β Set.Ioo a by:βhy:x - min (x - a) (b - x) < y β§ y < x + min (x - a) (b - x)β’ y β Set.Ioo a b
a:βb:βx:βhx:x β Set.Ioo a by:βhy:x - min (x - a) (b - x) < y β§ y < x + min (x - a) (b - x)cases:x - a < b - x β¨ b - x β€ x - aβ’ y β Set.Ioo a b
a:βb:βx:βhx:x β Set.Ioo a by:βhy:x - min (x - a) (b - x) < y β§ y < x + min (x - a) (b - x)h:x - a < b - xβ’ y β Set.Ioo a ba:βb:βx:βhx:x β Set.Ioo a by:βhy:x - min (x - a) (b - x) < y β§ y < x + min (x - a) (b - x)h:b - x β€ x - aβ’ y β Set.Ioo a b
all_goals
try a:βb:βx:βhx:x β Set.Ioo a by:βhy:x - (x - a) < y β§ y < x + (x - a)h:x - a < b - xβ’ y β Set.Ioo a b
try a:βb:βx:βhx:x β Set.Ioo a by:βhy:x - (b - x) < y β§ y < x + (b - x)h:b - x β€ x - aβ’ y β Set.Ioo a b
a:βb:βx:βhx:x β Set.Ioo a by:βh:b - x β€ x - ahy:x - (b - x) < y β§ y < bβ’ y β Set.Ioo a b
a:βb:βx:βhx:x β Set.Ioo a by:βh:b - x β€ x - ahy:x - (b - x) < y β§ y < bβ’ a < ya:βb:βx:βhx:x β Set.Ioo a by:βh:b - x β€ x - ahy:x - (b - x) < y β§ y < bβ’ y < b
all_goals All goals completed! πβ
Definition 3.2 (Open neighbourhood)
Let (X, \mathcal{T}) be a topological space and x \in X. An open neighbourhood of x in X is an open set U \in \mathcal{T} such that x \in U.
def OpenNeighbourhood {X : Type} [TopologicalSpace X]
(U : Set X) (x : X) : Prop :=
x β U β§ IsOpen UExample 3.7
The universe, X, is an open neighbourhood of any point x \in X. Indeed:
lemma univ_is_OpenNeighb {X : Type} [TopologicalSpace X]
(x : X) : OpenNeighbourhood Set.univ x := X:Typeinstβ:TopologicalSpace Xx:Xβ’ OpenNeighbourhood Set.univ x
X:Typeinstβ:TopologicalSpace Xx:Xβ’ x β Set.univX:Typeinstβ:TopologicalSpace Xx:Xβ’ IsOpen Set.univ
X:Typeinstβ:TopologicalSpace Xx:Xβ’ x β Set.univ All goals completed! π
X:Typeinstβ:TopologicalSpace Xx:Xβ’ IsOpen Set.univ All goals completed! πDefinition 3.3 (Neighbourhood)
Let (X, \mathcal{T}) be a topological space and x \in X. A neighbourhood of x in X is a set V \subseteq X such that there exists an open neighbourhood of x, U \in \mathcal{T}, with U \subseteq V.
def Neighbourhood {X : Type} [TopologicalSpace X]
(V : Set X) (x : X) : Prop :=
β U : Set X, U β V β§ OpenNeighbourhood U xExample 3.8
An open neighbourhood is also a neighbourhood. Indeed:
lemma OpenNeighb_is_Neighb {X : Type} [TopologicalSpace X]
(U : Set X) (x : X) : OpenNeighbourhood U x β
Neighbourhood U x := X:Typeinstβ:TopologicalSpace XU:Set Xx:Xβ’ OpenNeighbourhood U x β Neighbourhood U x
X:Typeinstβ:TopologicalSpace XU:Set Xx:XhU:OpenNeighbourhood U xβ’ Neighbourhood U x
All goals completed! πProposition 3.1 (Characterisation of open sets)
Let (X, \mathcal{T}) be a topological space and A \subseteq U any set. A is open if and only if it is a neighbourhood of all of its points.
lemma A_open_iff_neighbourhood_of_all
{X : Type} [T : TopologicalSpace X]
{A : Set X} : IsOpen A β
β x β A, Neighbourhood A x := X:TypeT:TopologicalSpace XA:Set Xβ’ IsOpen A β β x β A, Neighbourhood A xProof. We prove each implication separately.
X:TypeT:TopologicalSpace XA:Set Xβ’ IsOpen A β β x β A, Neighbourhood A xX:TypeT:TopologicalSpace XA:Set Xβ’ (β x β A, Neighbourhood A x) β IsOpen A
all_goals X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xβ’ IsOpen A
(\implies) The first implication is easy: if A is open, for each x \in A it suffices to take A as a neighbourhood of x.
X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Aβ’ β x β A, Neighbourhood A x -- β
intro x X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Ax:Xhx:x β Aβ’ Neighbourhood A x
X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Ax:Xhx:x β Aβ’ A β A β§ OpenNeighbourhood A x
X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Ax:Xhx:x β Aβ’ A β AX:TypeT:TopologicalSpace XA:Set Xh:IsOpen Ax:Xhx:x β Aβ’ OpenNeighbourhood A x
X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Ax:Xhx:x β Aβ’ A β A All goals completed! π
X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Ax:Xhx:x β Aβ’ OpenNeighbourhood A x X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Ax:Xhx:x β Aβ’ x β AX:TypeT:TopologicalSpace XA:Set Xh:IsOpen Ax:Xhx:x β Aβ’ IsOpen A
X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Ax:Xhx:x β Aβ’ x β A All goals completed! π
X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Ax:Xhx:x β Aβ’ IsOpen A All goals completed! π
(\impliedby) The converse is more complicated. We know that for each a \in A there exists U_a, a neighbourhood of a. We will first prove that
A = \bigcup_{a \in A} U_a
X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xβ’ IsOpen A -- β
X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xβ’ A = β a, Classical.choose β―X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xhUnion:A = β a, Classical.choose β―β’ IsOpen A
To do so, we prove both inclusions. If x \in A, then by our hypothesis there exists a neighbourhood of x, U_x. And by the definition of neighbourhood, that means that x \in U_x. Hence x \in \bigcup_{a}U_a.
X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xβ’ A = β a, Classical.choose β― X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xx:Xβ’ x β A β x β β a, Classical.choose β―; X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xx:Xβ’ x β A β x β β a, Classical.choose β―X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xx:Xβ’ x β β a, Classical.choose β― β x β A; all_goals X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xx:Xhx:x β β a, Classical.choose β―β’ x β A
X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xx:Xhx:x β Aβ’ x β β a, Classical.choose β― X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xx:Xhx:x β Aleftβ:Classical.choose β― β AhUx:OpenNeighbourhood (Classical.choose β―) xβ’ x β β a, Classical.choose β―
X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xx:Xhx:x β Aleftβ:Classical.choose β― β AhUx:OpenNeighbourhood (Classical.choose β―) xβ’ β i, β (i_1 : i β A), x β Classical.choose β―
X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xx:Xhx:x β Aleftβ:Classical.choose β― β AhUx:OpenNeighbourhood (Classical.choose β―) xβ’ x β Classical.choose β―
All goals completed! π
Now, if x \in \bigcup_{a}U_a, then there exists an a \in A with x \in U_a and U_a an open neighbourhood of a with U_a \subseteq A. Hence x \in U_a \subseteq A.
X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xx:Xhx:x β β a, Classical.choose β―β’ x β A X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xx:Xhx:β i, β (i_1 : i β A), x β Classical.choose β―β’ x β A
X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xx:Xa:Xha:a β Ahx:x β Classical.choose β―β’ x β A
X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xx:Xa:Xha:a β Ahx:x β Classical.choose β―ha':Classical.choose β― β Arightβ:OpenNeighbourhood (Classical.choose β―) aβ’ x β A
X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xx:Xa:Xha:a β Ahx:x β Classical.choose β―ha':Classical.choose β― β Arightβ:OpenNeighbourhood (Classical.choose β―) aβ’ x β Classical.choose β―
All goals completed! π
Then we have proved that A can be expressed as a union of sets U_a. But we know that all these sets are open neighbourhoods, hence they are open. It suffices to apply that the union of open sets is open.
X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xhUnion:A = β a, Classical.choose β―β’ IsOpen (β a, Classical.choose β―)
X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xhUnion:A = β a, Classical.choose β―β’ β (i : βA), IsOpen (Classical.choose β―)
X:TypeT:TopologicalSpace XA:Set Xh:β x β A, Neighbourhood A xhUnion:A = β a, Classical.choose β―a:βAβ’ IsOpen (Classical.choose β―)
All goals completed! πβ
Definition 3.4 (Interior)
Let (X, \mathcal{T}) be a topological space and A \subseteq X. We define the interior as the set
\overset{\circ}{A} = \bigcup \left\{ U \subseteq X | U \text{ is open and } U \subseteq A \right\}
def interior (s : Set X) : Set X :=
ββ { t | IsOpen t β§ t β s }Let us look at several properties of the interior of a set.
Proposition 3.2
Let (X, \mathcal{T}) be a topological space and A \subseteq X. Then
\overset{\circ}{A} \subseteq A
In Mathlib, this result goes by the name interior_subset.
Proof. Let a \in \overset{\circ}{A}. Then A is a neighbourhood of a and there exists an open set with a \in U \subseteq A. Hence a \in A.
example {X : Type} [T : TopologicalSpace X] (A : Set X) :
interior A β A := X:TypeT:TopologicalSpace XA:Set Xβ’ interior A β A
intro a X:TypeT:TopologicalSpace XA:Set Xa:Xha:a β interior Aβ’ a β A
X:TypeT:TopologicalSpace XA:Set Xa:XU:Set XhU:U β {t | IsOpen t β§ t β A}ha:a β Uβ’ a β A
X:TypeT:TopologicalSpace XA:Set Xa:XU:Set XhU:U β {t | IsOpen t β§ t β A}ha:a β Uβ’ a β U
All goals completed! πβ
Proposition 3.3
Let (X, \mathcal{T}) be a topological space and A \subseteq X. Then \overset{\circ}{A} is an open set.
In Mathlib, this result goes by the name isOpen_interior.
Proof. By the characterisation of open sets (3.1), it suffices to see that, given a \in \overset{\circ}{A}, \overset{\circ}{A} is a neighbourhood of a.
If a \in \overset{\circ}{A}, then there exists an open U with a \in U \subseteq A. We use this U to prove that \overset{\circ}{A} is a neighbourhood of a.
example {X : Type} [T : TopologicalSpace X]
(A : Set X) : IsOpen (interior A) := X:TypeT:TopologicalSpace XA:Set Xβ’ IsOpen (interior A)
X:TypeT:TopologicalSpace XA:Set Xβ’ β x β interior A, Neighbourhood (interior A) x
intro a X:TypeT:TopologicalSpace XA:Set Xa:Xha:a β interior Aβ’ Neighbourhood (interior A) a
X:TypeT:TopologicalSpace XA:Set Xa:XU:Set XhU:U β {t | IsOpen t β§ t β A}ha:a β Uβ’ Neighbourhood (interior A) a
X:TypeT:TopologicalSpace XA:Set Xa:XU:Set XhU:U β {t | IsOpen t β§ t β A}ha:a β Uβ’ U β interior A β§ OpenNeighbourhood U a
X:TypeT:TopologicalSpace XA:Set Xa:XU:Set XhU:U β {t | IsOpen t β§ t β A}ha:a β Uβ’ U β interior AX:TypeT:TopologicalSpace XA:Set Xa:XU:Set XhU:U β {t | IsOpen t β§ t β A}ha:a β Uβ’ OpenNeighbourhood U a
X:TypeT:TopologicalSpace XA:Set Xa:XU:Set XhU:U β {t | IsOpen t β§ t β A}ha:a β Uβ’ U β interior A intro x X:TypeT:TopologicalSpace XA:Set Xa:XU:Set XhU:U β {t | IsOpen t β§ t β A}ha:a β Ux:Xhx:x β Uβ’ x β interior A
All goals completed! π
X:TypeT:TopologicalSpace XA:Set Xa:XU:Set XhU:U β {t | IsOpen t β§ t β A}ha:a β Uβ’ OpenNeighbourhood U a X:TypeT:TopologicalSpace XA:Set Xa:XU:Set XhU:U β {t | IsOpen t β§ t β A}ha:a β Uβ’ a β UX:TypeT:TopologicalSpace XA:Set Xa:XU:Set XhU:U β {t | IsOpen t β§ t β A}ha:a β Uβ’ IsOpen U
X:TypeT:TopologicalSpace XA:Set Xa:XU:Set XhU:U β {t | IsOpen t β§ t β A}ha:a β Uβ’ a β U All goals completed! π
X:TypeT:TopologicalSpace XA:Set Xa:XU:Set XhU:U β {t | IsOpen t β§ t β A}ha:a β Uβ’ IsOpen U All goals completed! πβ
Proposition 3.4
Let (X, \mathcal{T}) be a topological space and A \subseteq X. Then A is open if and only if A is equal to its interior.
In Mathlib, this result goes by the name interior_eq_iff_isOpen.
Proof. The converse is trivial, since we have already seen that the interior of a set is open.
example {X : Type} [T : TopologicalSpace X] (A : Set X) :
IsOpen A β interior A = A:= X:TypeT:TopologicalSpace XA:Set Xβ’ IsOpen A β interior A = A
X:TypeT:TopologicalSpace XA:Set Xβ’ IsOpen A β interior A = AX:TypeT:TopologicalSpace XA:Set Xβ’ interior A = A β IsOpen A; X:TypeT:TopologicalSpace XA:Set Xβ’ interior A = A β IsOpen AX:TypeT:TopologicalSpace XA:Set Xβ’ IsOpen A β interior A = A; all_goals X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Aβ’ interior A = A
X:TypeT:TopologicalSpace XA:Set Xh:interior A = Aβ’ IsOpen A X:TypeT:TopologicalSpace XA:Set Xh:interior A = Aβ’ IsOpen (interior A)
All goals completed! π
Now, suppose that A is open. We have already seen that \overset{\circ}{A} \subseteq A, so it suffices to see the other inclusion. Let a \in A. Since A is open, it is an open neighbourhood of a with A \subseteq A. Hence a \in \overset{\circ}{A}.
X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Aβ’ interior A = A X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Aβ’ interior A β AX:TypeT:TopologicalSpace XA:Set Xh:IsOpen Aβ’ A β interior A
X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Aβ’ interior A β A All goals completed! π
X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Aβ’ A β interior A intro a X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Aa:Xha:a β Aβ’ a β interior A
X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Aa:Xha:a β Aβ’ A β {t | IsOpen t β§ t β A} β§ a β A
X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Aa:Xha:a β Aβ’ A β {t | IsOpen t β§ t β A}X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Aa:Xha:a β Aβ’ a β A
X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Aa:Xha:a β Aβ’ A β {t | IsOpen t β§ t β A} X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Aa:Xha:a β Aβ’ IsOpen A
All goals completed! π
X:TypeT:TopologicalSpace XA:Set Xh:IsOpen Aa:Xha:a β Aβ’ a β A All goals completed! πβ
3.1.2.Β Closed sets
Definition 3.5 (Closed set)
Let (X, \mathcal{T}) be a topological space and A \subseteq X. We say that A is closed in X if A^c is open in X.
class IsClosed (s : Set X) : Prop where
isOpen_compl : IsOpen sαΆExample 3.9
The universe is closed, because the empty set is open. The empty set is closed, because the universe is closed.
example (X : Type) [TopologicalSpace X] : IsClosed (Set.univ : Set X) := X:Typeinstβ:TopologicalSpace Xβ’ IsClosed Set.univ
X:Typeinstβ:TopologicalSpace Xβ’ IsOpen Set.univαΆ
X:Typeinstβ:TopologicalSpace Xβ’ IsOpen β
All goals completed! πExample 3.10
The arbitrary intersection of closed sets is closed. The finite union of closed sets is closed. Both follow easily from the definition of topological space and closed set.
example (X : Type) [TopologicalSpace X] (A B : Set X) (hA : IsClosed A) (hB : IsClosed B) : IsClosed (A βͺ B) := X:Typeinstβ:TopologicalSpace XA:Set XB:Set XhA:IsClosed AhB:IsClosed Bβ’ IsClosed (A βͺ B)
X:Typeinstβ:TopologicalSpace XA:Set XB:Set XhA:IsOpen AαΆhB:IsOpen BαΆβ’ IsOpen (A βͺ B)αΆ
X:Typeinstβ:TopologicalSpace XA:Set XB:Set XhA:IsOpen AαΆhB:IsOpen BαΆβ’ IsOpen (AαΆ β© BαΆ)
X:Typeinstβ:TopologicalSpace XA:Set XB:Set XhA:IsOpen AαΆhB:IsOpen BαΆβ’ TopologicalSpace.IsOpen AαΆX:Typeinstβ:TopologicalSpace XA:Set XB:Set XhA:IsOpen AαΆhB:IsOpen BαΆβ’ TopologicalSpace.IsOpen BαΆ
X:Typeinstβ:TopologicalSpace XA:Set XB:Set XhA:IsOpen AαΆhB:IsOpen BαΆβ’ TopologicalSpace.IsOpen BαΆ
All goals completed! πDefinition 3.6 (Closure)
Let (X, \mathcal{T}) be a topological space and A \subseteq X. We define the closure of A as the set
\overline{A} = \bigcap \{K \subseteq X | K \text{ is closed and } A \subseteq K\}
def closure (s : Set X) : Set X :=
ββ { t | IsClosed t β§ s β t }Let us look at some properties of the closure of a set.
Proposition 3.5
Let (X, \mathcal{T}) be a topological space and A \subseteq X. Then
A \subseteq \overline{A}
In Mathlib, this result goes by the name subset_closure.
Proof. Let a \in A; we want to see that a \in \overline{A}. Since \overline{A} is an intersection, this is equivalent to proving that for each closed K with A \subseteq K, x \in K. But this is trivial because, for each of those K, x \in A \subseteq K.
example {X : Type} [T : TopologicalSpace X] (A : Set X) :
A β closure A := X:TypeT:TopologicalSpace XA:Set Xβ’ A β closure A
intro x X:TypeT:TopologicalSpace XA:Set Xx:Xhx:x β Aβ’ x β closure A
intro K X:TypeT:TopologicalSpace XA:Set Xx:Xhx:x β AK:Set XhK:K β {t | IsClosed t β§ A β t}β’ x β K
X:TypeT:TopologicalSpace XA:Set Xx:Xhx:x β AK:Set XhK:K β {t | IsClosed t β§ A β t}β’ x β A
All goals completed! πβ
Proposition 3.6
Let (X, \mathcal{T}) be a topological space and A \subseteq X. Then
(\overline{A})^c = \overset{\circ}{\overbrace{(A^c)}}
In Mathlib, this result goes by the name interior_compl.
Proof. Let us see both inclusions separately.
example {X : Type} [T : TopologicalSpace X] (A : Set X) :
(closure A)αΆ = interior (AαΆ) := X:TypeT:TopologicalSpace XA:Set Xβ’ (closure A)αΆ = interior AαΆ
X:TypeT:TopologicalSpace XA:Set Xx:Xβ’ x β (closure A)αΆ β x β interior AαΆ; X:TypeT:TopologicalSpace XA:Set Xx:Xβ’ x β (closure A)αΆ β x β interior AαΆX:TypeT:TopologicalSpace XA:Set Xx:Xβ’ x β interior AαΆ β x β (closure A)αΆ; all_goals X:TypeT:TopologicalSpace XA:Set Xx:Xhx:x β interior AαΆβ’ x β (closure A)αΆ
(\subseteq) Suppose that x \in (\overline{A})^c, that is, x \notin \overline{A}. This means that there exists a closed K such that A \subseteq K and x \notin K.
X:TypeT:TopologicalSpace XA:Set Xx:Xhx:x β (closure A)αΆβ’ x β interior AαΆ X:TypeT:TopologicalSpace XA:Set Xx:Xhx:β x_1, IsClosed x_1 β§ A β x_1 β§ x β x_1β’ x β interior AαΆ
X:TypeT:TopologicalSpace XA:Set Xx:XK:Set XhKclosed:IsClosed KhKA:A β KhKx:x β Kβ’ x β interior AαΆ
To see that x is in the interior of A^c, we want to see that there exists an open set contained in A^c that contains x. Consider the open set K^c. Since A \subseteq K, we have K^c \subseteq A^c, and since x \notin K, we have x \in K^c.
X:TypeT:TopologicalSpace XA:Set Xx:XK:Set XhKclosed:IsClosed KhKA:A β KhKx:x β Kβ’ KαΆ β {t | IsOpen t β§ t β AαΆ} β§ x β KαΆ
X:TypeT:TopologicalSpace XA:Set Xx:XK:Set XhKclosed:IsClosed KhKA:A β KhKx:x β Kβ’ KαΆ β {t | IsOpen t β§ t β AαΆ}X:TypeT:TopologicalSpace XA:Set Xx:XK:Set XhKclosed:IsClosed KhKA:A β KhKx:x β Kβ’ x β KαΆ
X:TypeT:TopologicalSpace XA:Set Xx:XK:Set XhKclosed:IsClosed KhKA:A β KhKx:x β Kβ’ KαΆ β {t | IsOpen t β§ t β AαΆ} X:TypeT:TopologicalSpace XA:Set Xx:XK:Set XhKclosed:IsClosed KhKA:A β KhKx:x β Kβ’ IsOpen KαΆX:TypeT:TopologicalSpace XA:Set Xx:XK:Set XhKclosed:IsClosed KhKA:A β KhKx:x β Kβ’ KαΆ β AαΆ
X:TypeT:TopologicalSpace XA:Set Xx:XK:Set XhKclosed:IsClosed KhKA:A β KhKx:x β Kβ’ IsOpen KαΆ All goals completed! π
X:TypeT:TopologicalSpace XA:Set Xx:XK:Set XhKclosed:IsClosed KhKA:A β KhKx:x β Kβ’ KαΆ β AαΆ All goals completed! π
X:TypeT:TopologicalSpace XA:Set Xx:XK:Set XhKclosed:IsClosed KhKA:A β KhKx:x β Kβ’ x β KαΆ All goals completed! π
(\supseteq) Let x be in the interior of A^c. Then there exists an open U with x \in U \subseteq A^c. To see that x is in the complement of \overline{A}, suppose, for contradiction, that x \in \overline{A}.
X:TypeT:TopologicalSpace XA:Set Xx:Xhx:x β interior AαΆβ’ x β (closure A)αΆ X:TypeT:TopologicalSpace XA:Set Xx:XU:Set XhU:U β {t | IsOpen t β§ t β AαΆ}hUx:x β Uβ’ x β (closure A)αΆ
X:TypeT:TopologicalSpace XA:Set Xx:XU:Set XhUx:x β UhUopen:IsOpen UhUA:U β AαΆβ’ x β (closure A)αΆ
X:TypeT:TopologicalSpace XA:Set Xx:XU:Set XhUx:x β UhUopen:IsOpen UhUA:U β AαΆhx:x β (closure A)αΆβ’ False
In that case, for each closed K with A \subseteq K, we have x \in K. In particular, since U^c is closed because U is open, and A \subseteq U^c because U \subseteq A^c, we have that x \in U^c. But x \in U, which is a contradiction.
X:TypeT:TopologicalSpace XA:Set Xx:XU:Set XhUx:x β UhUopen:IsOpen UhUA:U β AαΆhx:β (t : Set X), IsClosed t β A β t β x β tβ’ False
specialize hx UαΆ (X:TypeT:TopologicalSpace XA:Set Xx:XU:Set XhUx:x β UhUopen:IsOpen UhUA:U β AαΆhx:β (t : Set X), IsClosed t β A β t β x β tβ’ IsClosed UαΆ All goals completed! π) (X:TypeT:TopologicalSpace XA:Set Xx:XU:Set XhUx:x β UhUopen:IsOpen UhUA:U β AαΆhx:β (t : Set X), IsClosed t β A β t β x β tβ’ A β UαΆ All goals completed! π)
All goals completed! πβ
Proposition 3.7
Let (X, \mathcal{T}) be a topological space and A \subseteq X. Then \overline{A} is a closed set.
In Mathlib, this result goes by the name isClosed_closure.
Proof. The proof is easy using the previous result: \overline{A} is closed if (\overline{A})^c is open. But we have seen that (\overline{A})^c = (A^c)^\circ, and the interior of any set is open.
example {X : Type} [T : TopologicalSpace X] (A : Set X) :
IsClosed (closure A) := X:TypeT:TopologicalSpace XA:Set Xβ’ IsClosed (closure A)
X:TypeT:TopologicalSpace XA:Set Xβ’ IsOpen (closure A)αΆ
X:TypeT:TopologicalSpace XA:Set Xβ’ IsOpen (interior AαΆ)
All goals completed! πβ
Proposition 3.8
Let (X, \mathcal{T}) be a topological space and A \subseteq X. Then A is closed if and only if it is equal to its closure.
Proof. The converse is trivial, since we have already seen that the closure of a set is closed.
example {X : Type} [T : TopologicalSpace X] (A : Set X) :
IsClosed A β closure A = A := X:TypeT:TopologicalSpace XA:Set Xβ’ IsClosed A β closure A = A
X:TypeT:TopologicalSpace XA:Set Xβ’ IsClosed A β closure A = AX:TypeT:TopologicalSpace XA:Set Xβ’ closure A = A β IsClosed A; X:TypeT:TopologicalSpace XA:Set Xβ’ closure A = A β IsClosed AX:TypeT:TopologicalSpace XA:Set Xβ’ IsClosed A β closure A = A; all_goals X:TypeT:TopologicalSpace XA:Set Xh:IsClosed Aβ’ closure A = A
X:TypeT:TopologicalSpace XA:Set Xh:closure A = Aβ’ IsClosed A X:TypeT:TopologicalSpace XA:Set Xh:closure A = Aβ’ IsClosed (closure A)
All goals completed! π
Now, suppose that A is closed. Then A^c is open, hence it is equal to its interior. But we have seen that the interior of A^c is (\overline{A})^c, hence A^c = (\overline{A})^c, from which we deduce A = \overline{A}.
X:TypeT:TopologicalSpace XA:Set Xh:IsClosed Aβ’ closure A = A X:TypeT:TopologicalSpace XA:Set Xh:(closure A)αΆ = AαΆβ’ closure A = A
X:TypeT:TopologicalSpace XA:Set Xh:(closure A)αΆ = AαΆβ’ closure (closure A) = closure A
All goals completed! πβ