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

Commit 0854536

Browse files
committed
feat(topology/constructions): add map_fst_nhds and map_snd_nhds (#6142)
* Move the definition of `nhds_within` to `topology/basic`. The theory is still in `continuous_on`. * Add `filter.map_inf_principal_preimage`. * Add `map_fst_nhds_within`, `map_fst_nhds`, `map_snd_nhds_within`, and `map_snd_nhds`.
1 parent 7fd4dcf commit 0854536

File tree

4 files changed

+41
-21
lines changed

4 files changed

+41
-21
lines changed

src/order/filter/basic.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,6 +2206,10 @@ lemma tendsto_pure_left {f : α → β} {a : α} {l : filter β} :
22062206
tendsto f (pure a) l ↔ ∀ s ∈ l, f a ∈ s :=
22072207
iff.rfl
22082208

2209+
@[simp] lemma map_inf_principal_preimage {f : α → β} {s : set β} {l : filter α} :
2210+
map f (l ⊓ 𝓟 (f ⁻¹' s)) = map f l ⊓ 𝓟 s :=
2211+
filter.ext $ λ t, by simp only [mem_map, mem_inf_principal, mem_set_of_eq, mem_preimage]
2212+
22092213
/-- If two filters are disjoint, then a function cannot tend to both of them along a non-trivial
22102214
filter. -/
22112215
lemma tendsto.not_tendsto {f : α → β} {a : filter α} {b₁ b₂ : filter β} (hf : tendsto f a b₁)

src/topology/basic.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ partially defined functions.
2929
3030
* `𝓝 x`: the filter of neighborhoods of a point `x`;
3131
* `𝓟 s`: the principal filter of a set `s`;
32+
* `𝓝[s] x`: the filter `nhds_within x s` of neighborhoods of a point `x` within a set `s`.
3233
3334
## Implementation notes
3435
@@ -480,6 +481,12 @@ infimum over the principal filters of all open sets containing `a`. -/
480481

481482
localized "notation `𝓝` := nhds" in topological_space
482483

484+
/-- The "neighborhood within" filter. Elements of `𝓝[s] a` are sets containing the
485+
intersection of `s` and a neighborhood of `a`. -/
486+
def nhds_within (a : α) (s : set α) : filter α := 𝓝 a ⊓ 𝓟 s
487+
488+
localized "notation `𝓝[` s `] ` x:100 := nhds_within x s" in topological_space
489+
483490
lemma nhds_def (a : α) : 𝓝 a = (⨅ s ∈ {s : set α | a ∈ s ∧ is_open s}, 𝓟 s) := by rw nhds
484491

485492
/-- The open sets containing `a` are a basis for the neighborhood filter. See `nhds_basis_opens'`

src/topology/constructions.lean

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -269,28 +269,43 @@ lemma exists_nhds_square {s : set (α × α)} {x : α} (hx : s ∈ 𝓝 (x, x))
269269
∃U, is_open U ∧ x ∈ U ∧ set.prod U U ⊆ s :=
270270
by simpa [nhds_prod_eq, (nhds_basis_opens x).prod_self.mem_iff, and.assoc, and.left_comm] using hx
271271

272+
/-- `prod.fst` maps neighborhood of `x : α × β` within the section `prod.snd ⁻¹' {x.2}`
273+
to `𝓝 x.1`. -/
274+
lemma map_fst_nhds_within (x : α × β) : map prod.fst (𝓝[prod.snd ⁻¹' {x.2}] x) = 𝓝 x.1 :=
275+
begin
276+
refine le_antisymm (continuous_at_fst.mono_left inf_le_left) (λ s hs, _),
277+
rcases x with ⟨x, y⟩,
278+
rw [mem_map, nhds_within, mem_inf_principal, mem_nhds_prod_iff] at hs,
279+
rcases hs with ⟨u, hu, v, hv, H⟩,
280+
simp only [prod_subset_iff, mem_singleton_iff, mem_set_of_eq, mem_preimage] at H,
281+
exact mem_sets_of_superset hu (λ z hz, H _ hz _ (mem_of_nhds hv) rfl)
282+
end
283+
284+
@[simp] lemma map_fst_nhds (x : α × β) : map prod.fst (𝓝 x) = 𝓝 x.1 :=
285+
le_antisymm continuous_at_fst $ (map_fst_nhds_within x).symm.trans_le (map_mono inf_le_left)
286+
272287
/-- The first projection in a product of topological spaces sends open sets to open sets. -/
273288
lemma is_open_map_fst : is_open_map (@prod.fst α β) :=
289+
is_open_map_iff_nhds_le.2 $ λ x, (map_fst_nhds x).ge
290+
291+
/-- `prod.snd` maps neighborhood of `x : α × β` within the section `prod.fst ⁻¹' {x.1}`
292+
to `𝓝 x.2`. -/
293+
lemma map_snd_nhds_within (x : α × β) : map prod.snd (𝓝[prod.fst ⁻¹' {x.1}] x) = 𝓝 x.2 :=
274294
begin
275-
rw is_open_map_iff_nhds_le,
276-
rintro ⟨x, y⟩ s hs,
277-
rcases mem_nhds_prod_iff.1 hs with ⟨tx, htx, ty, hty, ht⟩,
278-
simp only [subset_def, prod.forall, mem_prod] at ht,
279-
exact mem_sets_of_superset htx (λ x hx, ht x y ⟨hx, mem_of_nhds hty⟩)
295+
refine le_antisymm (continuous_at_snd.mono_left inf_le_left) (λ s hs, _),
296+
rcases x with ⟨x, y⟩,
297+
rw [mem_map, nhds_within, mem_inf_principal, mem_nhds_prod_iff] at hs,
298+
rcases hs with ⟨u, hu, v, hv, H⟩,
299+
simp only [prod_subset_iff, mem_singleton_iff, mem_set_of_eq, mem_preimage] at H,
300+
exact mem_sets_of_superset hv (λ z hz, H _ (mem_of_nhds hu) _ hz rfl)
280301
end
281302

303+
@[simp] lemma map_snd_nhds (x : α × β) : map prod.snd (𝓝 x) = 𝓝 x.2 :=
304+
le_antisymm continuous_at_snd $ (map_snd_nhds_within x).symm.trans_le (map_mono inf_le_left)
305+
282306
/-- The second projection in a product of topological spaces sends open sets to open sets. -/
283307
lemma is_open_map_snd : is_open_map (@prod.snd α β) :=
284-
begin
285-
/- This lemma could be proved by composing the fact that the first projection is open, and
286-
exchanging coordinates is a homeomorphism, hence open. As the `prod_comm` homeomorphism is defined
287-
later, we rather go for the direct proof, copy-pasting the proof for the first projection. -/
288-
rw is_open_map_iff_nhds_le,
289-
rintro ⟨x, y⟩ s hs,
290-
rcases mem_nhds_prod_iff.1 hs with ⟨tx, htx, ty, hty, ht⟩,
291-
simp only [subset_def, prod.forall, mem_prod] at ht,
292-
exact mem_sets_of_superset hty (λ y hy, ht x y ⟨mem_of_nhds htx, hy⟩)
293-
end
308+
is_open_map_iff_nhds_le.2 $ λ x, (map_snd_nhds x).ge
294309

295310
/-- A product set is open in a product space if and only if each factor is open, or one of them is
296311
empty -/

src/topology/continuous_on.lean

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ open_locale topological_space filter
3232
variables {α : Type*} {β : Type*} {γ : Type*} {δ : Type*}
3333
variables [topological_space α]
3434

35-
/-- The "neighborhood within" filter. Elements of `𝓝[s] a` are sets containing the
36-
intersection of `s` and a neighborhood of `a`. -/
37-
def nhds_within (a : α) (s : set α) : filter α := 𝓝 a ⊓ 𝓟 s
38-
39-
localized "notation `𝓝[` s `] ` x:100 := nhds_within x s" in topological_space
40-
4135
@[simp] lemma nhds_bind_nhds_within {a : α} {s : set α} :
4236
(𝓝 a).bind (λ x, 𝓝[s] x) = 𝓝[s] a :=
4337
bind_inf_principal.trans $ congr_arg2 _ nhds_bind_nhds rfl

0 commit comments

Comments
 (0)