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

Commit 51526ae

Browse files
committed
chore(topology): rename mem_nhds_sets and mem_of_nhds and mem_nhds_sets_iff (#7690)
Rename `mem_nhds_sets` to `is_open.mem_nhds`, and `mem_nhds_sets_iff` to `mem_nhds_iff`, and `mem_of_nhds` to `mem_of_mem_nhds`.
1 parent 91a547e commit 51526ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+277
-266
lines changed

src/algebra/ordered_monoid.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,6 @@ instance [ordered_comm_monoid α] : ordered_comm_monoid (order_dual α) :=
849849
..order_dual.partial_order α,
850850
..show comm_monoid α, by apply_instance }
851851

852-
853852
@[to_additive]
854853
instance [ordered_cancel_comm_monoid α] : ordered_cancel_comm_monoid (order_dual α) :=
855854
{ le_of_mul_le_mul_left := λ a b c : α, le_of_mul_le_mul_left',

src/analysis/analytic/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ begin
588588
assume u hu x hx,
589589
rcases ennreal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩,
590590
have : emetric.ball (0 : E) r' ∈ 𝓝 x :=
591-
mem_nhds_sets emetric.is_open_ball xr',
591+
is_open.mem_nhds emetric.is_open_ball xr',
592592
refine ⟨emetric.ball (0 : E) r', mem_nhds_within_of_mem_nhds this, _⟩,
593593
simpa [metric.emetric_ball_nnreal] using hf.tendsto_uniformly_on hr' u hu
594594
end

src/analysis/analytic/composition.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ begin
761761
have B₁ : continuous_at (λ (z : F), g (f x + z)) (f (x + y) - f x),
762762
{ refine continuous_at.comp _ (continuous_const.add continuous_id).continuous_at,
763763
simp only [add_sub_cancel'_right, id.def],
764-
exact Hg.continuous_on.continuous_at (mem_nhds_sets (emetric.is_open_ball) fy_mem) },
764+
exact Hg.continuous_on.continuous_at (is_open.mem_nhds (emetric.is_open_ball) fy_mem) },
765765
have B₂ : f (x + y) - f x ∈ emetric.ball (0 : F) rg,
766766
by simpa [edist_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] using fy_mem,
767767
rw [← nhds_within_eq_of_open B₂ emetric.is_open_ball] at A,

src/analysis/calculus/deriv.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ h.congr_of_eventually_eq h₁ (h₁.eq_of_nhds_within hx)
426426

427427
lemma has_deriv_at.congr_of_eventually_eq (h : has_deriv_at f f' x)
428428
(h₁ : f₁ =ᶠ[𝓝 x] f) : has_deriv_at f₁ f' x :=
429-
has_deriv_at_filter.congr_of_eventually_eq h h₁ (mem_of_nhds h₁ : _)
429+
has_deriv_at_filter.congr_of_eventually_eq h h₁ (mem_of_mem_nhds h₁ : _)
430430

431431
lemma filter.eventually_eq.deriv_within_eq (hs : unique_diff_within_at 𝕜 s x)
432432
(hL : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) :
@@ -1338,7 +1338,7 @@ begin
13381338
suffices : is_o (λ p : 𝕜 × 𝕜, (p.1 - p.2) * ((x * x)⁻¹ - (p.1 * p.2)⁻¹))
13391339
(λ (p : 𝕜 × 𝕜), (p.1 - p.2) * 1) (𝓝 (x, x)),
13401340
{ refine this.congr' _ (eventually_of_forall $ λ _, mul_one _),
1341-
refine eventually.mono (mem_nhds_sets (is_open_ne.prod is_open_ne) ⟨hx, hx⟩) _,
1341+
refine eventually.mono (is_open.mem_nhds (is_open_ne.prod is_open_ne) ⟨hx, hx⟩) _,
13421342
rintro ⟨y, z⟩ ⟨hy, hz⟩,
13431343
simp only [mem_set_of_eq] at hy hz, -- hy : y ≠ 0, hz : z ≠ 0
13441344
field_simp [hx, hy, hz], ring, },
@@ -1833,7 +1833,7 @@ begin
18331833
sub_zero, int.cast_one] },
18341834
{ rw [function.iterate_succ', finset.prod_range_succ, int.cast_mul, mul_assoc,
18351835
int.coe_nat_succ, ← sub_sub, ← ((has_deriv_at_fpow _ hx).const_mul _).deriv],
1836-
exact filter.eventually_eq.deriv_eq (eventually.mono (mem_nhds_sets is_open_ne hx) @ihk) }
1836+
exact filter.eventually_eq.deriv_eq (eventually.mono (is_open.mem_nhds is_open_ne hx) @ihk) }
18371837
end
18381838

18391839
end fpow
@@ -1846,12 +1846,12 @@ variables {f : ℝ → ℝ} {f' : ℝ} {s : set ℝ} {x : ℝ} {r : ℝ}
18461846

18471847
lemma has_deriv_within_at.limsup_slope_le (hf : has_deriv_within_at f f' s x) (hr : f' < r) :
18481848
∀ᶠ z in 𝓝[s \ {x}] x, (z - x)⁻¹ * (f z - f x) < r :=
1849-
has_deriv_within_at_iff_tendsto_slope.1 hf (mem_nhds_sets is_open_Iio hr)
1849+
has_deriv_within_at_iff_tendsto_slope.1 hf (is_open.mem_nhds is_open_Iio hr)
18501850

18511851
lemma has_deriv_within_at.limsup_slope_le' (hf : has_deriv_within_at f f' s x)
18521852
(hs : x ∉ s) (hr : f' < r) :
18531853
∀ᶠ z in 𝓝[s] x, (z - x)⁻¹ * (f z - f x) < r :=
1854-
(has_deriv_within_at_iff_tendsto_slope' hs).1 hf (mem_nhds_sets is_open_Iio hr)
1854+
(has_deriv_within_at_iff_tendsto_slope' hs).1 hf (is_open.mem_nhds is_open_Iio hr)
18551855

18561856
lemma has_deriv_within_at.liminf_right_slope_le
18571857
(hf : has_deriv_within_at f f' (Ici x) x) (hr : f' < r) :
@@ -1877,7 +1877,7 @@ lemma has_deriv_within_at.limsup_norm_slope_le
18771877
begin
18781878
have hr₀ : 0 < r, from lt_of_le_of_lt (norm_nonneg f') hr,
18791879
have A : ∀ᶠ z in 𝓝[s \ {x}] x, ∥(z - x)⁻¹ • (f z - f x)∥ ∈ Iio r,
1880-
from (has_deriv_within_at_iff_tendsto_slope.1 hf).norm (mem_nhds_sets is_open_Iio hr),
1880+
from (has_deriv_within_at_iff_tendsto_slope.1 hf).norm (is_open.mem_nhds is_open_Iio hr),
18811881
have B : ∀ᶠ z in 𝓝[{x}] x, ∥(z - x)⁻¹ • (f z - f x)∥ ∈ Iio r,
18821882
from mem_sets_of_superset self_mem_nhds_within
18831883
(singleton_subset_iff.2 $ by simp [hr₀]),

src/analysis/calculus/extend_deriv.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ begin
7171
convert le_of_lt (hδ _ z_in.2 z_in.1),
7272
have op : is_open (B ∩ s) := is_open_ball.inter s_open,
7373
rw differentiable_at.fderiv_within _ (op.unique_diff_on z z_in),
74-
exact (diff z z_in).differentiable_at (mem_nhds_sets op z_in) },
74+
exact (diff z z_in).differentiable_at (is_open.mem_nhds op z_in) },
7575
simpa using conv.norm_image_sub_le_of_norm_fderiv_within_le' diff bound u_in v_in },
7676
rintros ⟨u, v⟩ uv_in,
7777
refine continuous_within_at.closure_le uv_in _ _ key,

src/analysis/calculus/fderiv.lean

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ begin
299299
exact add_nonneg C.coe_nonneg ε0.le,
300300
have hs' := hs, rw [← map_add_left_nhds_zero x₀, mem_map] at hs',
301301
filter_upwards [is_o_iff.1 (has_fderiv_at_iff_is_o_nhds_zero.1 hf) ε0, hs'], intros y hy hys,
302-
have := hlip.norm_sub_le hys (mem_of_nhds hs), rw add_sub_cancel' at this,
302+
have := hlip.norm_sub_le hys (mem_of_mem_nhds hs), rw add_sub_cancel' at this,
303303
calc ∥f' y∥ ≤ ∥f (x₀ + y) - f x₀∥ + ∥f (x₀ + y) - f x₀ - f' y∥ : norm_le_insert _ _
304304
... ≤ C * ∥y∥ + ε * ∥y∥ : add_le_add this hy
305305
... = (C + ε) * ∥y∥ : (add_mul _ _ _).symm
@@ -359,7 +359,7 @@ begin
359359
refine (has_fderiv_within_at_univ.2 hf).lim _ (univ_mem_sets' (λ _, trivial)) hc _,
360360
assume U hU,
361361
refine (eventually_ne_of_tendsto_norm_at_top hc (0:𝕜)).mono (λ y hy, _),
362-
convert mem_of_nhds hU,
362+
convert mem_of_mem_nhds hU,
363363
dsimp only,
364364
rw [← mul_smul, mul_inv_cancel hy, one_smul]
365365
end
@@ -494,7 +494,7 @@ lemma differentiable_on_of_locally_differentiable_on
494494
begin
495495
assume x xs,
496496
rcases h x xs with ⟨t, t_open, xt, ht⟩,
497-
exact (differentiable_within_at_inter (mem_nhds_sets t_open xt)).1 (ht x ⟨xs, xt⟩)
497+
exact (differentiable_within_at_inter (is_open.mem_nhds t_open xt)).1 (ht x ⟨xs, xt⟩)
498498
end
499499

500500
lemma fderiv_within_subset (st : s ⊆ t) (ht : unique_diff_within_at 𝕜 s x)
@@ -537,7 +537,7 @@ end
537537

538538
lemma fderiv_within_of_open (hs : is_open s) (hx : x ∈ s) :
539539
fderiv_within 𝕜 f s x = fderiv 𝕜 f x :=
540-
fderiv_within_of_mem_nhds (mem_nhds_sets hs hx)
540+
fderiv_within_of_mem_nhds (is_open.mem_nhds hs hx)
541541

542542
lemma fderiv_within_eq_fderiv (hs : unique_diff_within_at 𝕜 s x) (h : differentiable_at 𝕜 f x) :
543543
fderiv_within 𝕜 f s x = fderiv 𝕜 f x :=
@@ -660,7 +660,7 @@ has_fderiv_at_filter.congr_of_eventually_eq h h₁ hx
660660

661661
lemma has_fderiv_at.congr_of_eventually_eq (h : has_fderiv_at f f' x)
662662
(h₁ : f₁ =ᶠ[𝓝 x] f) : has_fderiv_at f₁ f' x :=
663-
has_fderiv_at_filter.congr_of_eventually_eq h h₁ (mem_of_nhds h₁ : _)
663+
has_fderiv_at_filter.congr_of_eventually_eq h h₁ (mem_of_mem_nhds h₁ : _)
664664

665665
lemma differentiable_within_at.congr_mono (h : differentiable_within_at 𝕜 f s x)
666666
(ht : ∀x ∈ t, f₁ x = f x) (hx : f₁ x = f x) (h₁ : t ⊆ s) : differentiable_within_at 𝕜 f₁ t x :=
@@ -691,7 +691,7 @@ lemma differentiable_on_congr (h' : ∀x ∈ s, f₁ x = f x) :
691691
lemma differentiable_at.congr_of_eventually_eq (h : differentiable_at 𝕜 f x) (hL : f₁ =ᶠ[𝓝 x] f) :
692692
differentiable_at 𝕜 f₁ x :=
693693
has_fderiv_at.differentiable_at
694-
(has_fderiv_at_filter.congr_of_eventually_eq h.has_fderiv_at hL (mem_of_nhds hL : _))
694+
(has_fderiv_at_filter.congr_of_eventually_eq h.has_fderiv_at hL (mem_of_mem_nhds hL : _))
695695

696696
lemma differentiable_within_at.fderiv_within_congr_mono (h : differentiable_within_at 𝕜 f s x)
697697
(hs : ∀x ∈ t, f₁ x = f x) (hx : f₁ x = f x) (hxt : unique_diff_within_at 𝕜 t x) (h₁ : t ⊆ s) :
@@ -2118,7 +2118,7 @@ protected lemma is_open [complete_space E] : is_open (range (coe : (E ≃L[𝕜]
21182118
begin
21192119
nontriviality E,
21202120
rw [is_open_iff_mem_nhds, forall_range_iff],
2121-
refine λ e, mem_nhds_sets _ (mem_range_self _),
2121+
refine λ e, is_open.mem_nhds _ (mem_range_self _),
21222122
let O : (E →L[𝕜] F) → (E →L[𝕜] E) := λ f, (e.symm : F →L[𝕜] E).comp f,
21232123
have h_O : continuous O := is_bounded_bilinear_map_comp.continuous_left,
21242124
convert units.is_open.preimage h_O using 1,
@@ -2134,7 +2134,7 @@ end
21342134

21352135
protected lemma nhds [complete_space E] (e : E ≃L[𝕜] F) :
21362136
(range (coe : (E ≃L[𝕜] F) → (E →L[𝕜] F))) ∈ 𝓝 (e : E →L[𝕜] F) :=
2137-
mem_nhds_sets continuous_linear_equiv.is_open (by simp)
2137+
is_open.mem_nhds continuous_linear_equiv.is_open (by simp)
21382138

21392139
end continuous_linear_equiv
21402140

src/analysis/calculus/inverse.lean

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,16 +314,17 @@ lemma image_mem_nhds (hf : approximates_linear_on f f' s c) (f'symm : f'.nonline
314314
{x : E} (hs : s ∈ 𝓝 x) (hc : subsingleton F ∨ c < f'symm.nnnorm⁻¹) :
315315
f '' s ∈ 𝓝 (f x) :=
316316
begin
317-
obtain ⟨t, hts, ht, xt⟩ : ∃ t ⊆ s, is_open t ∧ x ∈ t := mem_nhds_sets_iff.1 hs,
318-
have := mem_nhds_sets ((hf.mono_set hts).open_image f'symm ht hc) (mem_image_of_mem _ xt),
317+
obtain ⟨t, hts, ht, xt⟩ : ∃ t ⊆ s, is_open t ∧ x ∈ t := _root_.mem_nhds_iff.1 hs,
318+
have := is_open.mem_nhds ((hf.mono_set hts).open_image f'symm ht hc) (mem_image_of_mem _ xt),
319319
exact mem_sets_of_superset this (image_subset _ hts),
320320
end
321321

322322
lemma map_nhds_eq (hf : approximates_linear_on f f' s c) (f'symm : f'.nonlinear_right_inverse)
323323
{x : E} (hs : s ∈ 𝓝 x) (hc : subsingleton F ∨ c < f'symm.nnnorm⁻¹) :
324324
map f (𝓝 x) = 𝓝 (f x) :=
325325
begin
326-
refine le_antisymm ((hf.continuous_on x (mem_of_nhds hs)).continuous_at hs) (le_map (λ t ht, _)),
326+
refine le_antisymm ((hf.continuous_on x (mem_of_mem_nhds hs)).continuous_at hs)
327+
(le_map (λ t ht, _)),
327328
have : f '' (s ∩ t) ∈ 𝓝 (f x) := (hf.mono_set (inter_subset_left s t)).image_mem_nhds
328329
f'symm (inter_mem_sets hs ht) hc,
329330
exact mem_sets_of_superset this (image_subset _ (inter_subset_right _ _)),
@@ -436,7 +437,7 @@ lemma approximates_deriv_on_nhds {f : E → F} {f' : E →L[𝕜] F} {a : E}
436437
∃ s ∈ 𝓝 a, approximates_linear_on f f' s c :=
437438
begin
438439
cases hc with hE hc,
439-
{ refine ⟨univ, mem_nhds_sets is_open_univ trivial, λ x hx y hy, _⟩,
440+
{ refine ⟨univ, is_open.mem_nhds is_open_univ trivial, λ x hx y hy, _⟩,
440441
simp [@subsingleton.elim E hE x y] },
441442
have := hf.def hc,
442443
rw [nhds_prod_eq, filter.eventually, mem_prod_same_iff] at this,

src/analysis/calculus/mean_value.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ begin
104104
refine nonempty_of_mem_sets (inter_mem_sets _ (Ioc_mem_nhds_within_Ioi ⟨le_rfl, hy⟩)),
105105
have : ∀ᶠ x in 𝓝[Icc a b] x, f x < B x,
106106
from A x (Ico_subset_Icc_self xab)
107-
(mem_nhds_sets (is_open_lt continuous_fst continuous_snd) hxB),
107+
(is_open.mem_nhds (is_open_lt continuous_fst continuous_snd) hxB),
108108
have : ∀ᶠ x in 𝓝[Ioi x] x, f x < B x,
109109
from nhds_within_le_of_mem (Icc_mem_nhds_within_Ioi xab) this,
110110
exact this.mono (λ y, le_of_lt) },
@@ -739,9 +739,9 @@ omit hff'
739739
lemma exists_ratio_deriv_eq_ratio_slope :
740740
∃ c ∈ Ioo a b, (g b - g a) * (deriv f c) = (f b - f a) * (deriv g c) :=
741741
exists_ratio_has_deriv_at_eq_ratio_slope f (deriv f) hab hfc
742-
(λ x hx, ((hfd x hx).differentiable_at $ mem_nhds_sets is_open_Ioo hx).has_deriv_at)
742+
(λ x hx, ((hfd x hx).differentiable_at $ is_open.mem_nhds is_open_Ioo hx).has_deriv_at)
743743
g (deriv g) hgc $
744-
λ x hx, ((hgd x hx).differentiable_at $ mem_nhds_sets is_open_Ioo hx).has_deriv_at
744+
λ x hx, ((hgd x hx).differentiable_at $ is_open.mem_nhds is_open_Ioo hx).has_deriv_at
745745

746746
omit hfc
747747

@@ -759,7 +759,7 @@ exists_ratio_has_deriv_at_eq_ratio_slope' _ _ hab _ _
759759
/-- Lagrange's Mean Value Theorem, `deriv` version. -/
760760
lemma exists_deriv_eq_slope : ∃ c ∈ Ioo a b, deriv f c = (f b - f a) / (b - a) :=
761761
exists_has_deriv_at_eq_slope f (deriv f) hab hfc
762-
(λ x hx, ((hfd x hx).differentiable_at $ mem_nhds_sets is_open_Ioo hx).has_deriv_at)
762+
(λ x hx, ((hfd x hx).differentiable_at $ is_open.mem_nhds is_open_Ioo hx).has_deriv_at)
763763

764764
end interval
765765

@@ -1078,7 +1078,7 @@ begin
10781078
{ unfold continuous_on,
10791079
exact λ t Ht, (hfg t Ht).continuous_within_at },
10801080
{ refine λ t Ht, (hfg t $ hIccIoo Ht).has_deriv_at _,
1081-
refine mem_nhds_sets_iff.mpr _,
1081+
refine _root_.mem_nhds_iff.mpr _,
10821082
use (Ioo (0:ℝ) 1),
10831083
refine ⟨hIccIoo, _, Ht⟩,
10841084
simp [real.Ioo_eq_ball, is_open_ball] } },
@@ -1113,7 +1113,7 @@ begin
11131113
-- turn little-o definition of strict_fderiv into an epsilon-delta statement
11141114
refine is_o_iff.mpr (λ c hc, metric.eventually_nhds_iff_ball.mpr _),
11151115
-- the correct ε is the modulus of continuity of f'
1116-
rcases mem_nhds_iff.mp (inter_mem_sets hder (hcont $ ball_mem_nhds _ hc)) with ⟨ε, ε0, hε⟩,
1116+
rcases metric.mem_nhds_iff.mp (inter_mem_sets hder (hcont $ ball_mem_nhds _ hc)) with ⟨ε, ε0, hε⟩,
11171117
refine ⟨ε, ε0, _⟩,
11181118
-- simplify formulas involving the product E × E
11191119
rintros ⟨a, b⟩ h,

src/analysis/calculus/tangent_cone.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ lemma unique_diff_within_at_of_mem_nhds (h : s ∈ 𝓝 x) : unique_diff_within_
296296
by simpa only [univ_inter] using unique_diff_within_at_univ.inter h
297297

298298
lemma is_open.unique_diff_within_at (hs : is_open s) (xs : x ∈ s) : unique_diff_within_at 𝕜 s x :=
299-
unique_diff_within_at_of_mem_nhds (mem_nhds_sets hs xs)
299+
unique_diff_within_at_of_mem_nhds (is_open.mem_nhds hs xs)
300300

301301
lemma unique_diff_on.inter (hs : unique_diff_on 𝕜 s) (ht : is_open t) : unique_diff_on 𝕜 (s ∩ t) :=
302-
λx hx, (hs x hx.1).inter (mem_nhds_sets ht hx.2)
302+
λx hx, (hs x hx.1).inter (is_open.mem_nhds ht hx.2)
303303

304304
lemma is_open.unique_diff_on (hs : is_open s) : unique_diff_on 𝕜 s :=
305305
λx hx, is_open.unique_diff_within_at hs hx

0 commit comments

Comments
 (0)