Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit afda1a2

Browse files
rwbartonmergify[bot]
authored andcommitted
refactor(topology/continuous_on): move continuous_{on,within_at} to own file (#1516)
* refactor(topology/continuous_on): move continuous_{on,within_at} to own file * Update src/topology/continuous_on.lean
1 parent 045d931 commit afda1a2

File tree

6 files changed

+427
-412
lines changed

6 files changed

+427
-412
lines changed

src/topology/algebra/monoid.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Theory of topological monoids.
88
TODO: generalize `topological_monoid` and `topological_add_monoid` to semigroups, or add a type class
99
`topological_operator α (*)`.
1010
-/
11-
import topology.constructions
11+
import topology.constructions topology.continuous_on
1212
import algebra.pi_instances
1313

1414
open classical set lattice filter topological_space

src/topology/basic.lean

Lines changed: 15 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@ import order.filter
1111
1212
The main definition is the type class `topological space α` which endows a type `α` with a topology.
1313
Then `set α` gets predicates `is_open`, `is_closed` and functions `interior`, `closure` and
14-
`frontier`. Each point `x` of `α` gets a neighborhood filter `nhds x`, and relative versions
15-
`nhds_within x s` for every set `s` in `α`.
14+
`frontier`. Each point `x` of `α` gets a neighborhood filter `nhds x`.
1615
1716
This file also defines locally finite families of subsets of `α`.
1817
1918
For topological spaces `α` and `β`, a function `f : α → β` and a point `a : α`,
2019
`continuous_at f a` means `f` is continuous at `a`, and global continuity is
21-
`continuous f`. There are also relative versions `continuous_within_at` and `continuous_on`
22-
and continuity `pcontinuous` for partially defined functions. Some basic properties
23-
of these various notions of continuity are proved in `topology.order`, after the
24-
ordering on topologies has been established.
20+
`continuous f`. There is also a version of continuity `pcontinuous` for
21+
partially defined functions.
2522
2623
## Implementation notes
2724
@@ -549,129 +546,6 @@ noncomputable def lim (f : filter α) : α := epsilon $ λa, f ≤ nhds a
549546
lemma lim_spec {f : filter α} (h : ∃a, f ≤ nhds a) : f ≤ nhds (lim f) := epsilon_spec h
550547
end lim
551548

552-
/-- The "neighborhood within" filter. Elements of `nhds_within a s` are sets containing the
553-
intersection of `s` and a neighborhood of `a`. -/
554-
def nhds_within (a : α) (s : set α) : filter α := nhds a ⊓ principal s
555-
556-
theorem nhds_within_eq (a : α) (s : set α) :
557-
nhds_within a s = ⨅ t ∈ {t : set α | a ∈ t ∧ is_open t}, principal (t ∩ s) :=
558-
have set.univ ∈ {s : set α | a ∈ s ∧ is_open s}, from ⟨set.mem_univ _, is_open_univ⟩,
559-
begin
560-
rw [nhds_within, nhds, lattice.binfi_inf]; try { exact this },
561-
simp only [inf_principal]
562-
end
563-
564-
theorem nhds_within_univ (a : α) : nhds_within a set.univ = nhds a :=
565-
by rw [nhds_within, principal_univ, lattice.inf_top_eq]
566-
567-
theorem mem_nhds_within (t : set α) (a : α) (s : set α) :
568-
t ∈ nhds_within a s ↔ ∃ u, is_open u ∧ a ∈ u ∧ u ∩ s ⊆ t :=
569-
begin
570-
rw [nhds_within, mem_inf_principal, mem_nhds_sets_iff], split,
571-
{ rintros ⟨u, hu, openu, au⟩,
572-
exact ⟨u, openu, au, λ x ⟨xu, xs⟩, hu xu xs⟩ },
573-
rintros ⟨u, openu, au, hu⟩,
574-
exact ⟨u, λ x xu xs, hu ⟨xu, xs⟩, openu, au⟩
575-
end
576-
577-
theorem self_mem_nhds_within {a : α} {s : set α} : s ∈ nhds_within a s :=
578-
begin
579-
rw [nhds_within, mem_inf_principal],
580-
simp only [imp_self],
581-
exact univ_mem_sets
582-
end
583-
584-
theorem inter_mem_nhds_within (s : set α) {t : set α} {a : α} (h : t ∈ nhds a) :
585-
s ∩ t ∈ nhds_within a s :=
586-
inter_mem_sets (mem_inf_sets_of_right (mem_principal_self s)) (mem_inf_sets_of_left h)
587-
588-
theorem nhds_within_mono (a : α) {s t : set α} (h : s ⊆ t) : nhds_within a s ≤ nhds_within a t :=
589-
lattice.inf_le_inf (le_refl _) (principal_mono.mpr h)
590-
591-
theorem nhds_within_restrict'' {a : α} (s : set α) {t : set α} (h : t ∈ nhds_within a s) :
592-
nhds_within a s = nhds_within a (s ∩ t) :=
593-
le_antisymm
594-
(lattice.le_inf lattice.inf_le_left (le_principal_iff.mpr (inter_mem_sets self_mem_nhds_within h)))
595-
(lattice.inf_le_inf (le_refl _) (principal_mono.mpr (set.inter_subset_left _ _)))
596-
597-
theorem nhds_within_restrict' {a : α} (s : set α) {t : set α} (h : t ∈ nhds a) :
598-
nhds_within a s = nhds_within a (s ∩ t) :=
599-
nhds_within_restrict'' s $ mem_inf_sets_of_left h
600-
601-
theorem nhds_within_restrict {a : α} (s : set α) {t : set α} (h₀ : a ∈ t) (h₁ : is_open t) :
602-
nhds_within a s = nhds_within a (s ∩ t) :=
603-
nhds_within_restrict' s (mem_nhds_sets h₁ h₀)
604-
605-
theorem nhds_within_le_of_mem {a : α} {s t : set α} (h : s ∈ nhds_within a t) :
606-
nhds_within a t ≤ nhds_within a s :=
607-
begin
608-
rcases (mem_nhds_within _ _ _).1 h with ⟨u, u_open, au, uts⟩,
609-
have : nhds_within a t = nhds_within a (t ∩ u) := nhds_within_restrict _ au u_open,
610-
rw [this, inter_comm],
611-
exact nhds_within_mono _ uts
612-
end
613-
614-
theorem nhds_within_eq_nhds_within {a : α} {s t u : set α}
615-
(h₀ : a ∈ s) (h₁ : is_open s) (h₂ : t ∩ s = u ∩ s) :
616-
nhds_within a t = nhds_within a u :=
617-
by rw [nhds_within_restrict t h₀ h₁, nhds_within_restrict u h₀ h₁, h₂]
618-
619-
theorem nhds_within_eq_of_open {a : α} {s : set α} (h₀ : a ∈ s) (h₁ : is_open s) :
620-
nhds_within a s = nhds a :=
621-
by rw [←nhds_within_univ]; apply nhds_within_eq_nhds_within h₀ h₁;
622-
rw [set.univ_inter, set.inter_self]
623-
624-
@[simp] theorem nhds_within_empty (a : α) : nhds_within a {} = ⊥ :=
625-
by rw [nhds_within, principal_empty, lattice.inf_bot_eq]
626-
627-
theorem nhds_within_union (a : α) (s t : set α) :
628-
nhds_within a (s ∪ t) = nhds_within a s ⊔ nhds_within a t :=
629-
by unfold nhds_within; rw [←lattice.inf_sup_left, sup_principal]
630-
631-
theorem nhds_within_inter (a : α) (s t : set α) :
632-
nhds_within a (s ∩ t) = nhds_within a s ⊓ nhds_within a t :=
633-
by unfold nhds_within; rw [lattice.inf_left_comm, lattice.inf_assoc, inf_principal,
634-
←lattice.inf_assoc, lattice.inf_idem]
635-
636-
theorem nhds_within_inter' (a : α) (s t : set α) :
637-
nhds_within a (s ∩ t) = (nhds_within a s) ⊓ principal t :=
638-
by { unfold nhds_within, rw [←inf_principal, lattice.inf_assoc] }
639-
640-
theorem tendsto_if_nhds_within {f g : α → β} {p : α → Prop} [decidable_pred p]
641-
{a : α} {s : set α} {l : filter β}
642-
(h₀ : tendsto f (nhds_within a (s ∩ p)) l)
643-
(h₁ : tendsto g (nhds_within a (s ∩ {x | ¬ p x})) l) :
644-
tendsto (λ x, if p x then f x else g x) (nhds_within a s) l :=
645-
by apply tendsto_if; rw [←nhds_within_inter']; assumption
646-
647-
lemma map_nhds_within (f : α → β) (a : α) (s : set α) :
648-
map f (nhds_within a s) =
649-
⨅ t ∈ {t : set α | a ∈ t ∧ is_open t}, principal (set.image f (t ∩ s)) :=
650-
have h₀ : directed_on ((λ (i : set α), principal (i ∩ s)) ⁻¹'o ge)
651-
{x : set α | x ∈ {t : set α | a ∈ t ∧ is_open t}}, from
652-
assume x ⟨ax, openx⟩ y ⟨ay, openy⟩,
653-
⟨x ∩ y, ⟨⟨ax, ay⟩, is_open_inter openx openy⟩,
654-
le_principal_iff.mpr (set.inter_subset_inter_left _ (set.inter_subset_left _ _)),
655-
le_principal_iff.mpr (set.inter_subset_inter_left _ (set.inter_subset_right _ _))⟩,
656-
have h₁ : ∃ (i : set α), i ∈ {t : set α | a ∈ t ∧ is_open t},
657-
from ⟨set.univ, set.mem_univ _, is_open_univ⟩,
658-
by { rw [nhds_within_eq, map_binfi_eq h₀ h₁], simp only [map_principal] }
659-
660-
theorem tendsto_nhds_within_mono_left {f : α → β} {a : α}
661-
{s t : set α} {l : filter β} (hst : s ⊆ t) (h : tendsto f (nhds_within a t) l) :
662-
tendsto f (nhds_within a s) l :=
663-
tendsto_le_left (nhds_within_mono a hst) h
664-
665-
theorem tendsto_nhds_within_mono_right {f : β → α} {l : filter β}
666-
{a : α} {s t : set α} (hst : s ⊆ t) (h : tendsto f l (nhds_within a s)) :
667-
tendsto f l (nhds_within a t) :=
668-
tendsto_le_right (nhds_within_mono a hst) h
669-
670-
theorem tendsto_nhds_within_of_tendsto_nhds {f : α → β} {a : α}
671-
{s : set α} {l : filter β} (h : tendsto f (nhds a) l) :
672-
tendsto f (nhds_within a s) l :=
673-
by rw [←nhds_within_univ] at h; exact tendsto_nhds_within_mono_left (set.subset_univ _) h
674-
675549

676550
/- locally finite family [General Topology (Bourbaki, 1995)] -/
677551
section locally_finite
@@ -731,14 +605,9 @@ def continuous (f : α → β) := ∀s, is_open s → is_open (f ⁻¹' s)
731605
if `f x` tends to `f x₀` when `x` tends to `x₀`. -/
732606
def continuous_at (f : α → β) (x : α) := tendsto f (nhds x) (nhds (f x))
733607

734-
/-- A function between topological spaces is continuous at a point `x₀` within a subset `s`
735-
if `f x` tends to `f x₀` when `x` tends to `x₀` while staying within `s`. -/
736-
def continuous_within_at (f : α → β) (s : set α) (x : α) : Prop :=
737-
tendsto f (nhds_within x s) (nhds (f x))
738-
739-
/-- A function between topological spaces is continuous on a subset `s`
740-
when it's continuous at every point of `s` within `s`. -/
741-
def continuous_on (f : α → β) (s : set α) : Prop := ∀ x ∈ s, continuous_within_at f s x
608+
lemma continuous_at.preimage_mem_nhds {f : α → β} {x : α} {t : set β} (h : continuous_at f x)
609+
(ht : t ∈ nhds (f x)) : f ⁻¹' t ∈ nhds x :=
610+
h ht
742611

743612
lemma continuous_id : continuous (id : α → α) :=
744613
assume s h, h
@@ -747,13 +616,22 @@ lemma continuous.comp {g : β → γ} {f : α → β} (hg : continuous g) (hf :
747616
continuous (g ∘ f) :=
748617
assume s h, hf _ (hg s h)
749618

619+
lemma continuous_at.comp {g : β → γ} {f : α → β} {x : α}
620+
(hg : continuous_at g (f x)) (hf : continuous_at f x) :
621+
continuous_at (g ∘ f) x :=
622+
hg.comp hf
623+
750624
lemma continuous.tendsto {f : α → β} (hf : continuous f) (x) :
751625
tendsto f (nhds x) (nhds (f x)) | s :=
752626
show s ∈ nhds (f x) → s ∈ map f (nhds x),
753627
by simp [nhds_sets]; exact
754628
assume t t_subset t_open fx_in_t,
755629
⟨f ⁻¹' t, preimage_mono t_subset, hf t t_open, fx_in_t⟩
756630

631+
lemma continuous.continuous_at {f : α → β} {x : α} (h : continuous f) :
632+
continuous_at f x :=
633+
h.tendsto x
634+
757635
lemma continuous_iff_continuous_at {f : α → β} : continuous f ↔ ∀ x, continuous_at f x :=
758636
⟨continuous.tendsto,
759637
assume hf : ∀x, tendsto f (nhds x) (nhds (f x)),

src/topology/constructions.lean

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,10 @@ lemma tendsto_prod_mk_nhds {γ} {a : α} {b : β} {f : filter γ} {ma : γ →
5454
tendsto (λc, (ma c, mb c)) f (nhds (a, b)) :=
5555
by rw [nhds_prod_eq]; exact filter.tendsto.prod_mk ha hb
5656

57-
lemma continuous_within_at.prod {f : α → β} {g : α → γ} {s : set α} {x : α}
58-
(hf : continuous_within_at f s x) (hg : continuous_within_at g s x) :
59-
continuous_within_at (λx, (f x, g x)) s x :=
60-
tendsto_prod_mk_nhds hf hg
61-
6257
lemma continuous_at.prod {f : α → β} {g : α → γ} {x : α}
6358
(hf : continuous_at f x) (hg : continuous_at g x) : continuous_at (λx, (f x, g x)) x :=
6459
tendsto_prod_mk_nhds hf hg
6560

66-
lemma continuous_on.prod {f : α → β} {g : α → γ} {s : set α}
67-
(hf : continuous_on f s) (hg : continuous_on g s) : continuous_on (λx, (f x, g x)) s :=
68-
λx hx, continuous_within_at.prod (hf x hx) (hg x hx)
69-
7061
lemma prod_generate_from_generate_from_eq {α : Type*} {β : Type*} {s : set (set α)} {t : set (set β)}
7162
(hs : ⋃₀ s = univ) (ht : ⋃₀ t = univ) :
7263
@prod.topological_space α β (generate_from s) (generate_from t) =

0 commit comments

Comments
 (0)