Skip to content

Commit 33a6bc2

Browse files
committed
Add monotone subseq
1 parent 404a8d9 commit 33a6bc2

18 files changed

Lines changed: 789 additions & 188 deletions

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ check: generate
1414
generate:
1515
slope generate Munkres.Defs
1616
slope generate Munkres.Mathlib
17+
slope generate Munkres.Mathlib.Set
18+
slope generate Munkres.Mathlib.AccPt
1719

1820
sorry:
1921
rg sorry -t lean --colors 'match:fg:yellow' --colors 'line:fg:white'

Munkres/Closure/Properties.lean

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import Mathlib.Algebra.Order.Archimedean.Basic
2+
import Mathlib.Algebra.Order.Ring.Star
3+
import Mathlib.Topology.Bases
4+
import Munkres.Mathlib.Disjoint
5+
6+
open Topology Filter TopologicalSpace
7+
8+
universe u
9+
10+
variable {α : Type u} [TopologicalSpace α] {A : Set α} {x : α} {B : Set (Set α)}
11+
12+
--* Theorem 17.5(a): equivalence for mem_closure. Mathlib's `mem_closure_iff`.
13+
example : x ∈ closure A ↔ ∀ U, IsOpen U → x ∈ U → (U ∩ A).Nonempty
14+
:= by --
15+
refine not_iff_not.mp ⟨?_, ?_⟩
16+
· intro h
17+
push_neg
18+
refine ⟨(closure A)ᶜ, isClosed_closure.isOpen_compl, h, ?_⟩
19+
refine Disjoint.inter_eq ?_
20+
rw [Set.disjoint_compl_left_iff_subset]
21+
exact subset_closure
22+
· intro h
23+
push_neg at h
24+
obtain ⟨U, hU, hxU, hd⟩ := h
25+
have : IsClosed Uᶜ := hU.isClosed_compl
26+
have : A ⊆ Uᶜ := (Disjoint.tfae.out 0 3).mp hd
27+
have : closure A ⊆ Uᶜ := (hU.isClosed_compl.closure_subset_iff).mpr this
28+
exact (this · hxU) -- ∎
29+
30+
example : x ∈ closure A ↔ ∀ U, IsOpen U → x ∈ U → (U ∩ A).Nonempty
31+
:= by --
32+
rw [mem_closure_iff] -- ∎
33+
34+
--* Theorem 17.5(b). Mathlib's `IsTopologicalBasis.mem_closure_iff`.
35+
example (hB : IsTopologicalBasis B) : x ∈ closure A ↔ ∀ b ∈ B, x ∈ b → (b ∩ A).Nonempty
36+
:= by --
37+
rw [mem_closure_iff]
38+
constructor
39+
· intro h b hbB hxb
40+
have : IsOpen b := hB.isOpen hbB
41+
exact h b this hxb
42+
· intro h u hu hxu
43+
rw [hB.isOpen_iff] at hu
44+
obtain ⟨b, hbB, hxb, hbu⟩ := hu x hxu
45+
exact (h b hbB hxb).mono (Set.inter_subset_inter_left A hbu) -- ∎
46+
47+
example (hB : IsTopologicalBasis B) : x ∈ closure A ↔ ∀ b ∈ B, x ∈ b → (b ∩ A).Nonempty
48+
:= by --
49+
exact hB.mem_closure_iff -- ∎
50+
51+
section Tendsto
52+
-- If a sequence converges to a point x, then that point x is in the closure of
53+
-- the set containing that sequence.
54+
variable (f : ℕ → α) (h : Tendsto f atTop (𝓝 x))
55+
56+
example (hf : ∀ i, f i ∈ A) : x ∈ closure A
57+
:= by --
58+
have : ∀ᶠ n in atTop, f n ∈ A := Eventually.of_forall hf
59+
exact mem_closure_of_tendsto h this -- ∎
60+
61+
example : x ∈ closure (Set.range f)
62+
:= by --
63+
have : ∀ᶠ n in atTop, f n ∈ Set.range f := Eventually.of_forall Set.mem_range_self
64+
exact mem_closure_of_tendsto h this -- ∎
65+
66+
end Tendsto

Munkres/Closure/Subtype.lean

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import Mathlib.Topology.Constructions
2+
import Munkres.Mathlib.Set.As
3+
4+
universe u
5+
6+
variable {α : Type u} [TopologicalSpace α] {Y A : Set α}
7+
8+
example (A : Set Y) {x : Y} : x ∈ closure A ↔ ↑x ∈ closure (Subtype.val '' A) := closure_subtype
9+
10+
--* Theorem 17.4: the closure of A in Y equals (closure A) ∩ Y.
11+
theorem closure_subtype₂ (A : Set Y) : closure A = closure (A : Set α) ∩ Y
12+
:= by --
13+
refine le_antisymm ?_ ?_
14+
· intro x hx
15+
rw [Subtype.coe_image] at hx
16+
obtain ⟨hxY, hx⟩ := hx
17+
exact ⟨closure_subtype.mp hx, hxY⟩
18+
· intro x ⟨hx, hxY⟩
19+
exact ⟨⟨x, hxY⟩, closure_subtype.mpr hx, rfl⟩ -- ∎
20+
21+
--* Theorem 17.4: If A ⊆ Y, the closure of A in Y equals (closure A) ∩ Y.
22+
theorem closure_subtype₃ {hAY : A ⊆ Y} : closure (A.as Y) = closure A ∩ Y
23+
:= by --
24+
rw [closure_subtype₂ (A.as Y)]
25+
refine congrArg (closure · ∩ Y) ?_
26+
exact Set.as_subtype_subset_eq hAY -- ∎

Munkres/Defs.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Munkres.Defs.IsBasisAt
66
import Munkres.Defs.IsSaturated
77
import Munkres.Defs.Metric.Basic
88
import Munkres.Defs.OpenCover
9+
import Munkres.Defs.Separation
910
import Munkres.Defs.Subspace
1011
import Munkres.Defs.Subtype
1112
set_option linter.style.longLine false

Munkres/Defs/Separation.lean

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Mathlib.Data.Set.BooleanAlgebra
2+
import Mathlib.Order.CompletePartialOrder
3+
import Mathlib.Topology.Defs.Basic
4+
5+
universe u
6+
7+
variable {α : Type u} [TopologicalSpace α]
8+
9+
/-- The existence of a separation implies that a space is not connected. -/
10+
structure IsSeparation (U V : Set α) : Prop where
11+
left' : IsOpen U ∧ U.Nonempty
12+
right' : IsOpen V ∧ V.Nonempty
13+
disjoint' : Disjoint U V
14+
union' : U ∪ V = Set.univ
15+
16+
def HasSeparation (α : Type u) [TopologicalSpace α] : Prop := ∃ U V : Set α, IsSeparation U V

Munkres/Disjoint.lean

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import Munkres.Mathlib.Disjoint
2+
import Munkres.Mathlib.Prelude
3+
import Munkres.Closure.Subtype
4+
5+
universe u
6+
7+
variable {α : Type u} [TopologicalSpace α]
8+
9+
section SubspaceTopology
10+
11+
variable {X : Set α} {A B : Set X}
12+
13+
/-- If A and B are disjoint and A is closed, then
14+
A = closure A ∩ X ↔ Disjoint (closure A) B,
15+
where both closures are in the superspace. -/
16+
theorem Disjoint.eq_closure_iff_disjoint (hAB : Disjoint A B) (hA : IsClosed A)
17+
: A = closure (Subtype.val '' A) ∩ X ↔
18+
Disjoint (closure (Subtype.val '' A)) (Subtype.val '' B)
19+
:= by --
20+
rw [<-Set.image_val_inter_self_right_eq_coe (D := B), <-disjoint_assoc₂]
21+
refine ⟨(· ▸ Set.disjoint_image_subtype_iff.mpr hAB), ?_⟩
22+
intro h'
23+
rw [<-closure_subtype₂ A, Set.image_val_inj]
24+
exact hA.closure_eq.symm -- ∎
25+
26+
end SubspaceTopology

Munkres/Mathlib.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import Munkres.Mathlib.AccPt
2+
import Munkres.Mathlib.AccPt.Basic
3+
import Munkres.Mathlib.AccPt.Countable
4+
import Munkres.Mathlib.Disjoint
25
import Munkres.Mathlib.Lipschitz
36
import Munkres.Mathlib.MonotoneSubseq
47
import Munkres.Mathlib.Prelude
8+
import Munkres.Mathlib.Set
9+
import Munkres.Mathlib.Set.As
510
import Munkres.Mathlib.Subtype
611
set_option linter.style.longLine false
712

Munkres/Mathlib/AccPt.lean

Lines changed: 4 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,5 @@
1-
import Munkres.Defs.Countable
1+
import Munkres.Mathlib.AccPt.Basic
2+
import Munkres.Mathlib.AccPt.Countable
3+
set_option linter.style.longLine false
24

3-
open Filter Set Munkres
4-
open scoped Topology
5-
6-
universe u v
7-
8-
variable {α : Type u} [TopologicalSpace α]
9-
{β : Type v}
10-
{A : Set α} {x : α}
11-
12-
/-- Munkres defines that x is a limit point of A if every open U ⊆ X containing
13-
x intersects with A \ {x}. This is equivalent to Mathlib's `AccPt x (𝓟 A)`. -/
14-
protected theorem AccPt.iff {x : α} : AccPt x (𝓟 A) ↔ ∀ U ∈ nhds' x, (U ∩ (A \ {x})).Nonempty
15-
:= by --
16-
rw [accPt_principal_iff_clusterPt, clusterPt_principal_iff]
17-
simp only [mem_nhds_iff]
18-
refine ⟨fun h U ⟨hU, hxU⟩ ↦ (h U ⟨U, le_refl _, hU, hxU⟩), ?_⟩
19-
intro h S ⟨U, hUS, hU, hxU⟩
20-
let ⟨t, htU, htA, hne⟩ := h U ⟨hU, hxU⟩
21-
exact ⟨t, hUS htU, htA, hne⟩ -- ∎
22-
23-
--* closure A = A ∪ A'
24-
theorem AccPt.union_eq_closure : A ∪ { x | AccPt x (𝓟 A)} = closure A
25-
:= by --
26-
refine le_antisymm ?_ ?_
27-
· intro x hx
28-
rcases hx with h | (h : AccPt x (𝓟 A))
29-
· exact subset_closure h
30-
· rw [AccPt.iff] at h
31-
rw [mem_closure_iff]
32-
intro U hU hxU
33-
obtain ⟨t, htU, htA, htx⟩ := h U ⟨hU, hxU⟩
34-
exact ⟨t, htU, htA⟩
35-
· intro x hx
36-
refine or_iff_not_imp_left.mpr fun h ↦ ?_
37-
simp
38-
refine AccPt.iff.mpr ?_
39-
intro U ⟨hU, hxU⟩
40-
rw [mem_closure_iff] at hx
41-
obtain ⟨y, hyU, hyA⟩ := hx U hU hxU
42-
have : y ≠ x := ne_of_mem_of_not_mem hyA h
43-
refine ⟨y, hyU, hyA, this⟩ -- ∎
44-
45-
theorem AccPt.mem_closure (h : AccPt x (𝓟 A)) : x ∈ closure A
46-
:= by --
47-
exact mem_closure_iff_clusterPt.mpr h.clusterPt -- ∎
48-
49-
-- Alternative proof.
50-
example (h : AccPt x (𝓟 A)) : x ∈ closure A
51-
:= by --
52-
have : x ∈ A ∪ { x | AccPt x (𝓟 A) } := Set.mem_union_right A h
53-
rw [AccPt.union_eq_closure] at this
54-
exact this -- ∎
55-
56-
theorem AccPt.of_tendsto [Nonempty β] [SemilatticeSup β] {f : β → α}
57-
(hA : ∀ᶠ n in atTop, f n ∈ A) (htt : Tendsto f atTop (𝓝[≠] x))
58-
: AccPt x (𝓟 A)
59-
:= by --
60-
rw [AccPt.iff]
61-
intro U ⟨hU, hxU⟩
62-
rw [tendsto_nhdsWithin_iff] at htt
63-
obtain ⟨htt, hne⟩ := htt
64-
rw [tendsto_atTop_nhds] at htt
65-
rw [eventually_atTop] at hne hA
66-
specialize htt U hxU hU
67-
obtain ⟨N₁, htt⟩ := htt
68-
obtain ⟨N₂, hne⟩ := hne
69-
obtain ⟨N₃, hA⟩ := hA
70-
let N := (N₁ ⊔ N₂) ⊔ N₃
71-
have hN₁ : N₁ ≤ N := le_sup_left.trans le_sup_left
72-
have hN₂ : N₂ ≤ N := le_sup_right.trans le_sup_left
73-
have hN₃ : N₃ ≤ N := le_sup_right
74-
specialize htt N hN₁
75-
specialize hne N hN₂
76-
specialize hA N hN₃
77-
exact ⟨f N, htt, hA, hne⟩ -- ∎
78-
79-
theorem AccPt.of_tendsto_nat {f : ℕ → α} (hA : ∀ᶠ n in atTop, f n ∈ A)
80-
(htt : Tendsto f atTop (𝓝[≠] x)) : AccPt x (𝓟 A)
81-
:= by --
82-
exact AccPt.of_tendsto hA htt -- ∎
83-
84-
-- And this is the reason why we need (𝓝[] x) above, and not just (𝓝 x).
85-
example [h₀ : Nonempty α] : ∃ (A : Set α) (x : α) (f : ℕ → α),
86-
(∀ᶠ n in atTop, f n ∈ A) ∧ Tendsto f atTop (𝓝 x) ∧ ¬AccPt x (𝓟 A)
87-
:= by --
88-
let x := h₀.some
89-
refine ⟨{x}, x, fun _ ↦ x, ?_, ?_, ?_⟩
90-
· exact eventually_const.mpr rfl
91-
· exact tendsto_const_nhds
92-
· by_contra! h
93-
rw [AccPt.iff] at h
94-
specialize h univ ⟨isOpen_univ, trivial⟩
95-
rw [sdiff_self, bot_eq_empty, inter_empty] at h
96-
exact Set.not_nonempty_empty h -- ∎
97-
98-
theorem AccPt.exists_tendsto [h₁ : FirstCountableTopology α]
99-
: AccPt x (𝓟 A) → ∃ (f : ℕ → α), (∀ n, f n ∈ A) ∧ Tendsto f atTop (𝓝 x)
100-
:= by --
101-
intro hx
102-
rw [AccPt.iff] at hx
103-
rw [FirstCountableTopology.iff] at h₁
104-
specialize h₁ x
105-
obtain ⟨β, hβ_countable, hβx⟩ := h₁
106-
haveI : Countable β := hβ_countable
107-
obtain ⟨B, hB_anti, hB⟩ := hβx.exists_antitone_eq_range
108-
let hδ (n : ℕ) := hx (B n) (hB.nhds' ⟨n, rfl⟩)
109-
let f (n : ℕ) : α := (hδ n).some
110-
use f
111-
refine ⟨?_, ?_⟩
112-
· intro n
113-
obtain ⟨hfB : f n ∈ B n, hfA : f n ∈ A \ {x}⟩ := (hδ n).some_mem
114-
exact hfA.1
115-
· rw [tendsto_atTop_nhds]
116-
intro U hxU hU
117-
obtain ⟨b, ⟨N, heq⟩, hbU⟩ := hB.exists_mem_subset' hU hxU
118-
subst heq
119-
use N
120-
intro n hn
121-
obtain ⟨hfB : f n ∈ B n, hfA : f n ∈ A \ {x}⟩ := (hδ n).some_mem
122-
exact hbU <| hB_anti hn hfB -- ∎
5+
-- WARNING: THIS FILE IS AUTO-GENERATED.

Munkres/Mathlib/AccPt/Basic.lean

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
import Mathlib.Order.OmegaCompletePartialOrder
2+
import Mathlib.Topology.NhdsWithin
3+
import Munkres.Defs.Basic
4+
5+
open Filter Set Munkres
6+
open scoped Topology
7+
8+
universe u v
9+
10+
variable {α : Type u} [TopologicalSpace α] {s : Set α} {x : α}
11+
12+
/-- Munkres defines that x is a limit point of A if every open U ⊆ X containing
13+
x intersects with A \ {x}. This is equivalent to Mathlib's `AccPt x (𝓟 A)`. -/
14+
protected theorem AccPt.iff
15+
: AccPt x (𝓟 s) ↔ ∀ u, IsOpen u → x ∈ u → (u ∩ (s \ {x})).Nonempty
16+
:= by --
17+
rw [accPt_principal_iff_clusterPt, clusterPt_principal_iff]
18+
refine ⟨(· · <| ·.mem_nhds ·), ?_⟩
19+
intro h v hv
20+
rw [mem_nhds_iff] at hv
21+
obtain ⟨u, huv, hu, hxu⟩ := hv
22+
exact (h u hu hxu).mono (inter_subset_inter_left _ huv) -- ∎
23+
24+
theorem mem_closure_iff_accPt {x : α} : x ∈ closure s ↔ x ∈ s ∨ AccPt x (𝓟 s)
25+
:= by --
26+
rw [mem_closure_iff_clusterPt]
27+
exact clusterPt_principal -- ∎
28+
29+
--* closure A = A ∪ A'
30+
theorem AccPt.union_eq_closure : s ∪ { x | AccPt x (𝓟 s)} = closure s
31+
:= by --
32+
refine Set.ext fun x ↦ ?_
33+
simp only [mem_closure_iff_accPt]
34+
exact Eq.to_iff rfl -- ∎
35+
36+
theorem AccPt.mem_closure (h : AccPt x (𝓟 s)) : x ∈ closure s
37+
:= by --
38+
exact mem_closure_iff_clusterPt.mpr h.clusterPt -- ∎
39+
40+
-- Alternative proof.
41+
example (h : AccPt x (𝓟 s)) : x ∈ closure s
42+
:= by --
43+
rw [<-AccPt.union_eq_closure]
44+
exact mem_union_right s h -- ∎
45+
46+
theorem AccPt.of_tendsto {β : Type v} [Nonempty β] [SemilatticeSup β]
47+
{f : β → α} (hs : ∀ᶠ n in atTop, f n ∈ s) (h : Tendsto f atTop (𝓝[≠] x))
48+
: AccPt x (𝓟 s)
49+
:= by --
50+
rw [AccPt.iff]
51+
intro U hU hxU
52+
rw [tendsto_nhdsWithin_iff] at h
53+
obtain ⟨h, hne⟩ := h
54+
rw [tendsto_atTop_nhds] at h
55+
rw [eventually_atTop] at hne hs
56+
specialize h U hxU hU
57+
obtain ⟨N₁, h⟩ := h
58+
obtain ⟨N₂, hne⟩ := hne
59+
obtain ⟨N₃, hs⟩ := hs
60+
let N := (N₁ ⊔ N₂) ⊔ N₃
61+
have hN₁ : N₁ ≤ N := le_sup_left.trans le_sup_left
62+
have hN₂ : N₂ ≤ N := le_sup_right.trans le_sup_left
63+
have hN₃ : N₃ ≤ N := le_sup_right
64+
specialize h N hN₁
65+
specialize hne N hN₂
66+
specialize hs N hN₃
67+
exact ⟨f N, h, hs, hne⟩ -- ∎
68+
69+
-- Applies to natural numbers.
70+
example {f : ℕ → α} (hs : ∀ᶠ n in atTop, f n ∈ s)
71+
(htt : Tendsto f atTop (𝓝[≠] x)) : AccPt x (𝓟 s)
72+
:= by --
73+
exact AccPt.of_tendsto hs htt -- ∎
74+
75+
-- And this is the reason why we need (𝓝[] x) above, and not just (𝓝 x).
76+
example [h₀ : Nonempty α] : ∃ (A : Set α) (x : α) (f : ℕ → α),
77+
(∀ᶠ n in atTop, f n ∈ A) ∧ Tendsto f atTop (𝓝 x) ∧ ¬AccPt x (𝓟 A)
78+
:= by --
79+
let x := h₀.some
80+
refine ⟨{x}, x, fun _ ↦ x, ?_, ?_, ?_⟩
81+
· exact eventually_const.mpr rfl
82+
· exact tendsto_const_nhds
83+
· by_contra! h
84+
rw [AccPt.iff] at h
85+
specialize h univ isOpen_univ trivial
86+
rw [sdiff_self, bot_eq_empty, inter_empty] at h
87+
exact Set.not_nonempty_empty h -- ∎

0 commit comments

Comments
 (0)