Documentation

Mathlib.Topology.DiscreteSubset

Discrete subsets of topological spaces #

This file contains various additional properties of discrete subsets of topological spaces.

Discreteness and compact sets #

Given a topological space X together with a subset s โІ X, there are two distinct concepts of "discreteness" which may hold. These are: (i) Every point of s is isolated (i.e., the subset topology induced on s is the discrete topology). (ii) Every compact subset of X meets s only finitely often (i.e., the inclusion map s โ†’ X tends to the cocompact filter along the cofinite filter on s).

When s is closed, the two conditions are equivalent provided X is locally compact and T1, see IsClosed.tendsto_coe_cofinite_iff.

Main statements #

Co-discrete open sets #

We define the filter Filter.codiscreteWithin S, which is the supremum of all ๐“[S \ {x}] x. This is the filter of all open codiscrete sets within S. We also define Filter.codiscrete as Filter.codiscreteWithin univ, which is the filter of all open codiscrete sets in the space.

theorem discreteTopology_subtype_iff {Y : Type u_2} [TopologicalSpace Y] {S : Set Y} :
DiscreteTopology โ†‘S โ†” โˆ€ x โˆˆ S, nhdsWithin x {x}แถœ โŠ“ Filter.principal S = โŠฅ
theorem isDiscrete_iff_nhdsNE {Y : Type u_2} [TopologicalSpace Y] {S : Set Y} :
IsDiscrete S โ†” โˆ€ x โˆˆ S, nhdsWithin x {x}แถœ โŠ“ Filter.principal S = โŠฅ
theorem discreteTopology_of_noAccPts {X : Type u_3} [TopologicalSpace X] {E : Set X} (h : โˆ€ x โˆˆ E, ยฌAccPt x (Filter.principal E)) :

If a subset of a topological space has no accumulation points, then it carries the discrete topology.

theorem discreteTopology_subtype_iff' {Y : Type u_2} [TopologicalSpace Y] {S : Set Y} :
DiscreteTopology โ†‘S โ†” โˆ€ y โˆˆ S, โˆƒ (U : Set Y), IsOpen U โˆง U โˆฉ S = {y}
theorem isDiscrete_iff_forall_exists_isOpen {Y : Type u_2} [TopologicalSpace Y] {S : Set Y} :
IsDiscrete S โ†” โˆ€ y โˆˆ S, โˆƒ (U : Set Y), IsOpen U โˆง U โˆฉ S = {y}
theorem isDiscrete_iff_nhdsWithin {X : Type u_1} [TopologicalSpace X] {s : Set X} :
IsDiscrete s โ†” โˆ€ x โˆˆ s, nhdsWithin x s = pure x
theorem IsDiscrete.nhdsWithin {X : Type u_1} [TopologicalSpace X] {s : Set X} :
IsDiscrete s โ†’ โˆ€ x โˆˆ s, nhdsWithin x s = pure x

Alias of the forward direction of isDiscrete_iff_nhdsWithin.

theorem IsDiscrete.of_nhdsWithin {X : Type u_1} [TopologicalSpace X] {s : Set X} (H : โˆ€ x โˆˆ s, nhdsWithin x s โ‰ค pure x) :
theorem IsDiscrete.image_of_isOpenMap {X : Type u_1} {Y : Type u_2} [TopologicalSpace X] [TopologicalSpace Y] {f : X โ†’ Y} {s : Set X} (hs : IsDiscrete s) (hf : IsOpenMap f) (hf' : Function.Injective f) :
theorem IsDiscrete.image_of_isOpenMap_of_isOpen {X : Type u_1} {Y : Type u_2} [TopologicalSpace X] [TopologicalSpace Y] {f : X โ†’ Y} {s : Set X} (hs : IsDiscrete s) (hf : IsOpenMap f) (hs' : IsOpen s) :
theorem IsDiscrete.image {X : Type u_1} {Y : Type u_2} [TopologicalSpace X] [TopologicalSpace Y] {f : X โ†’ Y} {s : Set X} (hs : IsDiscrete s) (hf : Topology.IsInducing f) :
@[deprecated IsInducing.isDiscrete_range (since := "2026-03-30")]

Alias of IsInducing.isDiscrete_range.

theorem IsDiscrete.preimage {X : Type u_1} {Y : Type u_2} [TopologicalSpace X] [TopologicalSpace Y] {f : X โ†’ Y} {s : Set Y} (hs : IsDiscrete s) (hf : ContinuousOn f (f โปยน' s)) (hf' : Function.Injective f) :
theorem IsDiscrete.preimage' {X : Type u_1} {Y : Type u_2} [TopologicalSpace X] [TopologicalSpace Y] {f : X โ†’ Y} {s : Set Y} (hs : IsDiscrete s) (hf : ContinuousOn f (f โปยน' s)) (H : โˆ€ (x : Y), IsDiscrete (f โปยน' {x})) :

If f is continuous with discrete fibers, then the preimage of discrete sets are discrete.

theorem IsDiscrete.eq_of_specializes {X : Type u_1} [TopologicalSpace X] {s : Set X} (hs : IsDiscrete s) {a b : X} (hab : a โคณ b) (ha : a โˆˆ s) (hb : b โˆˆ s) :
a = b
theorem tendsto_cofinite_cocompact_iff {X : Type u_1} {Y : Type u_2} [TopologicalSpace Y] {f : X โ†’ Y} :
Filter.Tendsto f Filter.cofinite (Filter.cocompact Y) โ†” โˆ€ (K : Set Y), IsCompact K โ†’ (f โปยน' K).Finite
@[deprecated IsClosed.tendsto_coe_cofinite_of_isDiscrete (since := "2025-10-08")]

Alias of IsClosed.tendsto_coe_cofinite_of_isDiscrete.

theorem isClosed_and_discrete_iff {X : Type u_1} [TopologicalSpace X] {S : Set X} :
IsClosed S โˆง IsDiscrete S โ†” โˆ€ (x : X), Disjoint (nhdsWithin x {x}แถœ) (Filter.principal S)

Criterion for a subset S โІ X to be closed and discrete in terms of the punctured neighbourhood filter at an arbitrary point of X. (Compare isDiscrete_iff_nhds_ne.)

The filter of sets with no accumulation points inside a set S : Set X, implemented as the supremum over all punctured neighborhoods within S.

Instances For
    theorem mem_codiscreteWithin {X : Type u_1} [TopologicalSpace X] {S T : Set X} :
    S โˆˆ Filter.codiscreteWithin T โ†” โˆ€ x โˆˆ T, Disjoint (nhdsWithin x {x}แถœ) (Filter.principal (T \ S))
    theorem mem_codiscreteWithin_iff_forall_mem_nhdsNE {X : Type u_1} [TopologicalSpace X] {S T : Set X} :
    S โˆˆ Filter.codiscreteWithin T โ†” โˆ€ x โˆˆ T, S โˆช Tแถœ โˆˆ nhdsWithin x {x}แถœ

    A set s is codiscrete within U iff s โˆช Uแถœ is a punctured neighborhood of every point in U.

    theorem mem_codiscreteWithin_accPt {X : Type u_1} [TopologicalSpace X] {S T : Set X} :
    S โˆˆ Filter.codiscreteWithin T โ†” โˆ€ x โˆˆ T, ยฌAccPt x (Filter.principal (T \ S))
    @[simp]

    Any set is codiscrete within itself.

    theorem Filter.codiscreteWithin.mono {X : Type u_1} [TopologicalSpace X] {Uโ‚ U : Set X} (hU : Uโ‚ โІ U) :

    If a set is codiscrete within U, then it is codiscrete within any subset of U.

    theorem isDiscrete_of_codiscreteWithin {X : Type u_1} [TopologicalSpace X] {U s : Set X} (h : sแถœ โˆˆ Filter.codiscreteWithin U) :
    IsDiscrete (s โˆฉ U)

    If s is codiscrete within U, then sแถœ โˆฉ U has discrete topology.

    @[deprecated isDiscrete_of_codiscreteWithin (since := "2025-10-08")]
    theorem discreteTopology_of_codiscreteWithin {X : Type u_1} [TopologicalSpace X] {U s : Set X} (h : sแถœ โˆˆ Filter.codiscreteWithin U) :
    IsDiscrete (s โˆฉ U)

    Alias of isDiscrete_of_codiscreteWithin.


    If s is codiscrete within U, then sแถœ โˆฉ U has discrete topology.

    theorem codiscreteWithin_iff_locallyEmptyComplementWithin {X : Type u_1} [TopologicalSpace X] {s U : Set X} :
    s โˆˆ Filter.codiscreteWithin U โ†” โˆ€ z โˆˆ U, โˆƒ t โˆˆ nhdsWithin z {z}แถœ, t โˆฉ (U \ s) = โˆ…

    Helper lemma for codiscreteWithin_iff_locallyFiniteComplementWithin: A set s is codiscreteWithin U iff every point z โˆˆ U has a punctured neighborhood that does not intersect U \ s.

    theorem isClosed_sdiff_of_codiscreteWithin {X : Type u_1} [TopologicalSpace X] {s U : Set X} (hs : s โˆˆ Filter.codiscreteWithin U) (hU : IsClosed U) :
    IsClosed (U \ s)

    If U is closed and s is codiscrete within U, then U \ s is closed.

    theorem nhdsNE_of_nhdsNE_sdiff_finite {X : Type u_3} [TopologicalSpace X] [T1Space X] {x : X} {U s : Set X} (hU : U โˆˆ nhdsWithin x {x}แถœ) (hs : Finite โ†‘s) :
    U \ s โˆˆ nhdsWithin x {x}แถœ

    In a T1Space, punctured neighborhoods are stable under removing finite sets of points.

    theorem codiscreteWithin_iff_locallyFiniteComplementWithin {X : Type u_1} [TopologicalSpace X] [T1Space X] {s U : Set X} :
    s โˆˆ Filter.codiscreteWithin U โ†” โˆ€ z โˆˆ U, โˆƒ t โˆˆ nhds z, (t โˆฉ (U \ s)).Finite

    In a T1Space, a set s is codiscreteWithin U iff it has locally finite complement within U. More precisely: s is codiscreteWithin U iff every point z โˆˆ U has a punctured neighborhood intersect U \ s in only finitely many points.

    In any topological space, the open sets with discrete complement form a filter, defined as the supremum of all punctured neighborhoods.

    See Filter.mem_codiscrete' for the equivalence.

    Instances For
      theorem mem_codiscrete {X : Type u_1} [TopologicalSpace X] {S : Set X} :
      S โˆˆ Filter.codiscrete X โ†” โˆ€ (x : X), Disjoint (nhdsWithin x {x}แถœ) (Filter.principal Sแถœ)
      theorem mem_codiscrete_accPt {X : Type u_1} [TopologicalSpace X] {S : Set X} :
      S โˆˆ Filter.codiscrete X โ†” โˆ€ (x : X), ยฌAccPt x (Filter.principal Sแถœ)
      theorem mem_codiscrete' {X : Type u_1} [TopologicalSpace X] {S : Set X} :
      S โˆˆ Filter.codiscrete X โ†” IsOpen S โˆง IsDiscrete Sแถœ
      theorem mem_codiscrete_subtype_iff_mem_codiscreteWithin {X : Type u_1} [TopologicalSpace X] {S : Set X} {U : Set โ†‘S} :
      U โˆˆ Filter.codiscrete โ†‘S โ†” Subtype.val '' U โˆˆ Filter.codiscreteWithin S
      theorem discreteTopology_union {X : Type u_1} [TopologicalSpace X] {S T : Set X} (hs : DiscreteTopology โ†‘S) (ht : DiscreteTopology โ†‘T) (hs' : IsClosed S) (ht' : IsClosed T) :
      DiscreteTopology โ†‘(S โˆช T)

      The union of two discrete closed subsets is discrete.

      theorem discreteTopology_biUnion_finset {X : Type u_1} [TopologicalSpace X] {ฮน : Type u_3} {I : Finset ฮน} {s : ฮน โ†’ Set X} (hs : โˆ€ i โˆˆ I, DiscreteTopology โ†‘(s i)) (hs' : โˆ€ i โˆˆ I, IsClosed (s i)) :
      DiscreteTopology โ†‘(โ‹ƒ i โˆˆ I, s i)

      The union of finitely many discrete closed subsets is discrete.

      theorem discreteTopology_iUnion_finite {X : Type u_1} [TopologicalSpace X] {ฮน : Type u_3} [Finite ฮน] {s : ฮน โ†’ Set X} (hs : โˆ€ (i : ฮน), DiscreteTopology โ†‘(s i)) (hs' : โˆ€ (i : ฮน), IsClosed (s i)) :
      DiscreteTopology โ†‘(โ‹ƒ (i : ฮน), s i)

      The union of finitely many discrete closed subsets is discrete.

      @[deprecated discreteTopology_iUnion_finite (since := "2025-11-28")]
      theorem discreteTopology_iUnion_fintype {X : Type u_1} [TopologicalSpace X] {ฮน : Type u_3} [Finite ฮน] {s : ฮน โ†’ Set X} (hs : โˆ€ (i : ฮน), DiscreteTopology โ†‘(s i)) (hs' : โˆ€ (i : ฮน), IsClosed (s i)) :
      DiscreteTopology โ†‘(โ‹ƒ (i : ฮน), s i)

      Alias of discreteTopology_iUnion_finite.


      The union of finitely many discrete closed subsets is discrete.