Skip to content

Commit f9e900a

Browse files
committed
chore(Filter/Prod): drop Filter.prod, use SProd instead (#18315)
This way we can't accidentally use the underlying `Filter.prod` instead of the normal form.
1 parent cf80f34 commit f9e900a

File tree

12 files changed

+68
-108
lines changed

12 files changed

+68
-108
lines changed

Mathlib/Analysis/SpecialFunctions/NonIntegrable.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ theorem not_integrableOn_of_tendsto_norm_atTop_of_deriv_isBigO_filter_aux
5858
(∀ x ∈ s, ∀ y ∈ s, ∀ z ∈ [[x, y]], DifferentiableAt ℝ f z) ∧
5959
∀ x ∈ s, ∀ y ∈ s, ∀ z ∈ [[x, y]], ‖deriv f z‖ ≤ C * ‖g z‖ := by
6060
rcases hfg.exists_nonneg with ⟨C, C₀, hC⟩
61-
have h : ∀ᶠ x : ℝ × ℝ in l.prod l,
61+
have h : ∀ᶠ x : ℝ × ℝ in l ×ˢ l,
6262
∀ y ∈ [[x.1, x.2]], (DifferentiableAt ℝ f y ∧ ‖deriv f y‖ ≤ C * ‖g y‖) ∧ y ∈ k :=
6363
(tendsto_fst.uIcc tendsto_snd).eventually ((hd.and hC.bound).and hl).smallSets
6464
rcases mem_prod_self_iff.1 h with ⟨s, hsl, hs⟩

Mathlib/Data/Analysis/Filter.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ protected def iSup {f : α → Filter β} (F : ∀ i, (f i).Realizer) : (⨆ i,
286286
fun ⟨_, f⟩ i ↦ f i ⟨⟩, fun f ↦ ⟨(), fun i _ ↦ f i⟩, fun _ ↦ rfl, fun _ ↦ rfl⟩
287287

288288
/-- Construct a realizer for the product of filters -/
289-
protected def prod {f g : Filter α} (F : f.Realizer) (G : g.Realizer) : (f.prod g).Realizer :=
289+
protected def prod {f g : Filter α} (F : f.Realizer) (G : g.Realizer) : (f ×ˢ g).Realizer :=
290290
(F.comap _).inf (G.comap _)
291291

292292
theorem le_iff {f g : Filter α} (F : f.Realizer) (G : g.Realizer) :

Mathlib/Order/Filter/Basic.lean

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,10 @@ theorem eventually_or_distrib_right {f : Filter α} {p : α → Prop} {q : Prop}
646646
(∀ᶠ x in f, p x ∨ q) ↔ (∀ᶠ x in f, p x) ∨ q := by
647647
simp only [@or_comm _ q, eventually_or_distrib_left]
648648

649+
theorem eventually_imp_distrib_left {f : Filter α} {p : Prop} {q : α → Prop} :
650+
(∀ᶠ x in f, p → q x) ↔ p → ∀ᶠ x in f, q x := by
651+
simp only [imp_iff_not_or, eventually_or_distrib_left]
652+
649653
@[simp]
650654
theorem eventually_bot {p : α → Prop} : ∀ᶠ x in ⊥, p x :=
651655
⟨⟩
@@ -798,6 +802,16 @@ theorem eventually_imp_distrib_right {f : Filter α} {p : α → Prop} {q : Prop
798802
(∀ᶠ x in f, p x → q) ↔ (∃ᶠ x in f, p x) → q := by
799803
simp only [imp_iff_not_or, eventually_or_distrib_right, not_frequently]
800804

805+
@[simp]
806+
theorem frequently_and_distrib_left {f : Filter α} {p : Prop} {q : α → Prop} :
807+
(∃ᶠ x in f, p ∧ q x) ↔ p ∧ ∃ᶠ x in f, q x := by
808+
simp only [Filter.Frequently, not_and, eventually_imp_distrib_left, Classical.not_imp]
809+
810+
@[simp]
811+
theorem frequently_and_distrib_right {f : Filter α} {p : α → Prop} {q : Prop} :
812+
(∃ᶠ x in f, p x ∧ q) ↔ (∃ᶠ x in f, p x) ∧ q := by
813+
simp only [@and_comm _ q, frequently_and_distrib_left]
814+
801815
@[simp]
802816
theorem frequently_bot {p : α → Prop} : ¬∃ᶠ x in ⊥, p x := by simp
803817

Mathlib/Order/Filter/Curry.lean

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -47,46 +47,34 @@ uniform convergence, curried filters, product filters
4747

4848
namespace Filter
4949

50-
variable {α β γ : Type*}
50+
variable {α β γ : Type*} {l : Filter α} {m : Filter β} {s : Set α} {t : Set β}
5151

52-
theorem eventually_curry_iff {f : Filter α} {g : Filter β} {p : α × β → Prop} :
53-
(∀ᶠ x : α × β in f.curry g, p x) ↔ ∀ᶠ x : α in f, ∀ᶠ y : β in g, p (x, y) :=
52+
theorem eventually_curry_iff {p : α × β → Prop} :
53+
(∀ᶠ x : α × β in l.curry m, p x) ↔ ∀ᶠ x : α in l, ∀ᶠ y : β in m, p (x, y) :=
5454
Iff.rfl
5555

56-
theorem frequently_curry_iff {α β : Type*} {l : Filter α} {m : Filter β}
56+
theorem frequently_curry_iff
5757
(p : (α × β) → Prop) : (∃ᶠ x in l.curry m, p x) ↔ ∃ᶠ x in l, ∃ᶠ y in m, p (x, y) := by
5858
simp_rw [Filter.Frequently, not_iff_not, not_not, eventually_curry_iff]
5959

60-
theorem mem_curry_iff {f : Filter α} {g : Filter β} {s : Set (α × β)} :
61-
s ∈ f.curry g ↔ ∀ᶠ x : α in f, ∀ᶠ y : β in g, (x, y) ∈ s := Iff.rfl
60+
theorem mem_curry_iff {s : Set (α × β)} :
61+
s ∈ l.curry m ↔ ∀ᶠ x : α in l, ∀ᶠ y : β in m, (x, y) ∈ s := Iff.rfl
6262

63-
theorem curry_le_prod {f : Filter α} {g : Filter β} : f.curry g ≤ f.prod g :=
64-
fun _ => Eventually.curry
63+
theorem curry_le_prod : l.curry m ≤ l ×ˢ m := fun _ => Eventually.curry
6564

6665
theorem Tendsto.curry {f : α → β → γ} {la : Filter α} {lb : Filter β} {lc : Filter γ}
6766
(h : ∀ᶠ a in la, Tendsto (fun b : β => f a b) lb lc) : Tendsto (↿f) (la.curry lb) lc :=
6867
fun _s hs => h.mono fun _a ha => ha hs
6968

70-
theorem frequently_curry_prod_iff {α β : Type*} {l : Filter α} {m : Filter β}
71-
(s : Set α) (t : Set β) : (∃ᶠ x in l.curry m, x ∈ s ×ˢ t) ↔ sᶜ ∉ l ∧ tᶜ ∉ m := by
72-
refine ⟨fun h => ?_, fun ⟨hs, ht⟩ => ?_⟩
73-
· exact frequently_prod_and.mp (Frequently.filter_mono h curry_le_prod)
74-
rw [frequently_curry_iff]
75-
exact Frequently.mono hs <| fun x hx => Frequently.mono ht (by simp [hx])
69+
theorem frequently_curry_prod_iff :
70+
(∃ᶠ x in l.curry m, x ∈ s ×ˢ t) ↔ (∃ᶠ x in l, x ∈ s) ∧ ∃ᶠ y in m, y ∈ t := by
71+
simp [frequently_curry_iff]
7672

77-
theorem prod_mem_curry {α β : Type*} {l : Filter α} {m : Filter β} {s : Set α} {t : Set β}
78-
(hs : s ∈ l) (ht : t ∈ m) : s ×ˢ t ∈ l.curry m :=
79-
curry_le_prod <| prod_mem_prod hs ht
80-
81-
theorem eventually_curry_prod_iff {α β : Type*} {l : Filter α} {m : Filter β}
82-
[NeBot l] [NeBot m] (s : Set α) (t : Set β) :
73+
theorem eventually_curry_prod_iff [NeBot l] [NeBot m] :
8374
(∀ᶠ x in l.curry m, x ∈ s ×ˢ t) ↔ s ∈ l ∧ t ∈ m := by
84-
refine ⟨fun h => ⟨?_, ?_⟩, fun ⟨hs, ht⟩ => prod_mem_curry hs ht⟩ <;>
85-
rw [eventually_curry_iff] at h
86-
· apply mem_of_superset h
87-
simp
88-
rcases h.exists with ⟨_, hx⟩
89-
apply mem_of_superset hx
90-
exact fun _ hy => hy.2
75+
simp [eventually_curry_iff]
76+
77+
theorem prod_mem_curry (hs : s ∈ l) (ht : t ∈ m) : s ×ˢ t ∈ l.curry m :=
78+
curry_le_prod <| prod_mem_prod hs ht
9179

9280
end Filter

Mathlib/Order/Filter/Defs.lean

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,17 +301,20 @@ def comap (m : α → β) (f : Filter β) : Filter α where
301301
inter_sets := fun ⟨a', ha₁, ha₂⟩ ⟨b', hb₁, hb₂⟩ =>
302302
⟨a' ∩ b', inter_mem ha₁ hb₁, inter_subset_inter ha₂ hb₂⟩
303303

304-
/-- Product of filters. This is the filter generated by cartesian products
305-
of elements of the component filters. -/
306-
protected def prod (f : Filter α) (g : Filter β) : Filter (α × β) :=
307-
f.comap Prod.fst ⊓ g.comap Prod.snd
308-
309304
/-- Coproduct of filters. -/
310305
protected def coprod (f : Filter α) (g : Filter β) : Filter (α × β) :=
311306
f.comap Prod.fst ⊔ g.comap Prod.snd
312307

308+
/-- Product of filters. This is the filter generated by cartesian products
309+
of elements of the component filters. -/
313310
instance instSProd : SProd (Filter α) (Filter β) (Filter (α × β)) where
314-
sprod := Filter.prod
311+
sprod f g := f.comap Prod.fst ⊓ g.comap Prod.snd
312+
313+
/-- Product of filters. This is the filter generated by cartesian products
314+
of elements of the component filters.
315+
Deprecated. Use `f ×ˢ g` instead. -/
316+
@[deprecated (since := "2024-11-29")]
317+
protected def prod (f : Filter α) (g : Filter β) : Filter (α × β) := f ×ˢ g
315318

316319
theorem prod_eq_inf (f : Filter α) (g : Filter β) : f ×ˢ g = f.comap Prod.fst ⊓ g.comap Prod.snd :=
317320
rfl

Mathlib/Order/Filter/Finite.lean

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -263,23 +263,6 @@ alias _root_.Finset.eventually_all := eventually_all_finset
263263

264264
-- attribute [protected] Finset.eventually_all
265265

266-
theorem eventually_imp_distrib_left {f : Filter α} {p : Prop} {q : α → Prop} :
267-
(∀ᶠ x in f, p → q x) ↔ p → ∀ᶠ x in f, q x :=
268-
eventually_all
269-
270-
271-
/-! ### Frequently -/
272-
273-
@[simp]
274-
theorem frequently_and_distrib_left {f : Filter α} {p : Prop} {q : α → Prop} :
275-
(∃ᶠ x in f, p ∧ q x) ↔ p ∧ ∃ᶠ x in f, q x := by
276-
simp only [Filter.Frequently, not_and, eventually_imp_distrib_left, Classical.not_imp]
277-
278-
@[simp]
279-
theorem frequently_and_distrib_right {f : Filter α} {p : α → Prop} {q : Prop} :
280-
(∃ᶠ x in f, p x ∧ q) ↔ (∃ᶠ x in f, p x) ∧ q := by
281-
simp only [@and_comm _ q, frequently_and_distrib_left]
282-
283266
/-!
284267
### Relation “eventually equal”
285268
-/

Mathlib/Order/Filter/Prod.lean

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ theorem prod_mem_prod (hs : s ∈ f) (ht : t ∈ g) : s ×ˢ t ∈ f ×ˢ g :=
5151

5252
theorem mem_prod_iff {s : Set (α × β)} {f : Filter α} {g : Filter β} :
5353
s ∈ f ×ˢ g ↔ ∃ t₁ ∈ f, ∃ t₂ ∈ g, t₁ ×ˢ t₂ ⊆ s := by
54-
simp only [SProd.sprod, Filter.prod]
5554
constructor
5655
· rintro ⟨t₁, ⟨s₁, hs₁, hts₁⟩, t₂, ⟨s₂, hs₂, hts₂⟩, rfl⟩
5756
exact ⟨s₁, hs₁, s₂, hs₂, fun p ⟨h, h'⟩ => ⟨hts₁ h, hts₂ h'⟩⟩
@@ -100,20 +99,16 @@ theorem comap_prodMap_prod (f : α → β) (g : γ → δ) (lb : Filter β) (ld
10099
simp [prod_eq_inf, comap_comap, Function.comp_def]
101100

102101
theorem prod_top : f ×ˢ (⊤ : Filter β) = f.comap Prod.fst := by
103-
dsimp only [SProd.sprod]
104-
rw [Filter.prod, comap_top, inf_top_eq]
102+
rw [prod_eq_inf, comap_top, inf_top_eq]
105103

106104
theorem top_prod : (⊤ : Filter α) ×ˢ g = g.comap Prod.snd := by
107-
dsimp only [SProd.sprod]
108-
rw [Filter.prod, comap_top, top_inf_eq]
105+
rw [prod_eq_inf, comap_top, top_inf_eq]
109106

110107
theorem sup_prod (f₁ f₂ : Filter α) (g : Filter β) : (f₁ ⊔ f₂) ×ˢ g = (f₁ ×ˢ g) ⊔ (f₂ ×ˢ g) := by
111-
dsimp only [SProd.sprod]
112-
rw [Filter.prod, comap_sup, inf_sup_right, ← Filter.prod, ← Filter.prod]
108+
simp only [prod_eq_inf, comap_sup, inf_sup_right]
113109

114110
theorem prod_sup (f : Filter α) (g₁ g₂ : Filter β) : f ×ˢ (g₁ ⊔ g₂) = (f ×ˢ g₁) ⊔ (f ×ˢ g₂) := by
115-
dsimp only [SProd.sprod]
116-
rw [Filter.prod, comap_sup, inf_sup_left, ← Filter.prod, ← Filter.prod]
111+
simp only [prod_eq_inf, comap_sup, inf_sup_left]
117112

118113
theorem eventually_prod_iff {p : α × β → Prop} :
119114
(∀ᶠ x in f ×ˢ g, p x) ↔
@@ -203,15 +198,11 @@ theorem tendsto_diag : Tendsto (fun i => (i, i)) f (f ×ˢ f) :=
203198

204199
theorem prod_iInf_left [Nonempty ι] {f : ι → Filter α} {g : Filter β} :
205200
(⨅ i, f i) ×ˢ g = ⨅ i, f i ×ˢ g := by
206-
dsimp only [SProd.sprod]
207-
rw [Filter.prod, comap_iInf, iInf_inf]
208-
simp only [Filter.prod, eq_self_iff_true]
201+
simp only [prod_eq_inf, comap_iInf, iInf_inf]
209202

210203
theorem prod_iInf_right [Nonempty ι] {f : Filter α} {g : ι → Filter β} :
211204
(f ×ˢ ⨅ i, g i) = ⨅ i, f ×ˢ g i := by
212-
dsimp only [SProd.sprod]
213-
rw [Filter.prod, comap_iInf, inf_iInf]
214-
simp only [Filter.prod, eq_self_iff_true]
205+
simp only [prod_eq_inf, comap_iInf, inf_iInf]
215206

216207
@[mono, gcongr]
217208
theorem prod_mono {f₁ f₂ : Filter α} {g₁ g₂ : Filter β} (hf : f₁ ≤ f₂) (hg : g₁ ≤ g₂) :
@@ -229,11 +220,10 @@ theorem prod_mono_right (f : Filter α) {g₁ g₂ : Filter β} (hf : g₁ ≤ g
229220
theorem prod_comap_comap_eq.{u, v, w, x} {α₁ : Type u} {α₂ : Type v} {β₁ : Type w} {β₂ : Type x}
230221
{f₁ : Filter α₁} {f₂ : Filter α₂} {m₁ : β₁ → α₁} {m₂ : β₂ → α₂} :
231222
comap m₁ f₁ ×ˢ comap m₂ f₂ = comap (fun p : β₁ × β₂ => (m₁ p.1, m₂ p.2)) (f₁ ×ˢ f₂) := by
232-
simp only [SProd.sprod, Filter.prod, comap_comap, comap_inf, Function.comp_def]
223+
simp only [prod_eq_inf, comap_comap, comap_inf, Function.comp_def]
233224

234225
theorem prod_comm' : f ×ˢ g = comap Prod.swap (g ×ˢ f) := by
235-
simp only [SProd.sprod, Filter.prod, comap_comap, Function.comp_def, inf_comm, Prod.swap,
236-
comap_inf]
226+
simp only [prod_eq_inf, comap_comap, Function.comp_def, inf_comm, Prod.swap, comap_inf]
237227

238228
theorem prod_comm : f ×ˢ g = map (fun p : β × α => (p.2, p.1)) (g ×ˢ f) := by
239229
rw [prod_comm', ← map_swap_eq_comap_swap]
@@ -280,12 +270,12 @@ theorem eventually_swap_iff {p : α × β → Prop} :
280270

281271
theorem prod_assoc (f : Filter α) (g : Filter β) (h : Filter γ) :
282272
map (Equiv.prodAssoc α β γ) ((f ×ˢ g) ×ˢ h) = f ×ˢ (g ×ˢ h) := by
283-
simp_rw [← comap_equiv_symm, SProd.sprod, Filter.prod, comap_inf, comap_comap, inf_assoc,
273+
simp_rw [← comap_equiv_symm, prod_eq_inf, comap_inf, comap_comap, inf_assoc,
284274
Function.comp_def, Equiv.prodAssoc_symm_apply]
285275

286276
theorem prod_assoc_symm (f : Filter α) (g : Filter β) (h : Filter γ) :
287277
map (Equiv.prodAssoc α β γ).symm (f ×ˢ (g ×ˢ h)) = (f ×ˢ g) ×ˢ h := by
288-
simp_rw [map_equiv_symm, SProd.sprod, Filter.prod, comap_inf, comap_comap, inf_assoc,
278+
simp_rw [map_equiv_symm, prod_eq_inf, comap_inf, comap_comap, inf_assoc,
289279
Function.comp_def, Equiv.prodAssoc_apply]
290280

291281
theorem tendsto_prodAssoc {h : Filter γ} :
@@ -300,7 +290,7 @@ theorem tendsto_prodAssoc_symm {h : Filter γ} :
300290
theorem map_swap4_prod {h : Filter γ} {k : Filter δ} :
301291
map (fun p : (α × β) × γ × δ => ((p.1.1, p.2.1), (p.1.2, p.2.2))) ((f ×ˢ g) ×ˢ (h ×ˢ k)) =
302292
(f ×ˢ h) ×ˢ (g ×ˢ k) := by
303-
simp_rw [map_swap4_eq_comap, SProd.sprod, Filter.prod, comap_inf, comap_comap]; ac_rfl
293+
simp_rw [map_swap4_eq_comap, prod_eq_inf, comap_inf, comap_comap]; ac_rfl
304294

305295
theorem tendsto_swap4_prod {h : Filter γ} {k : Filter δ} :
306296
Tendsto (fun p : (α × β) × γ × δ => ((p.1.1, p.2.1), (p.1.2, p.2.2))) ((f ×ˢ g) ×ˢ (h ×ˢ k))
@@ -351,7 +341,7 @@ theorem prod_eq : f ×ˢ g = (f.map Prod.mk).seq g := f.map_prod id g
351341

352342
theorem prod_inf_prod {f₁ f₂ : Filter α} {g₁ g₂ : Filter β} :
353343
(f₁ ×ˢ g₁) ⊓ (f₂ ×ˢ g₂) = (f₁ ⊓ f₂) ×ˢ (g₁ ⊓ g₂) := by
354-
simp only [SProd.sprod, Filter.prod, comap_inf, inf_comm, inf_assoc, inf_left_comm]
344+
simp only [prod_eq_inf, comap_inf, inf_comm, inf_assoc, inf_left_comm]
355345

356346
theorem inf_prod {f₁ f₂ : Filter α} : (f₁ ⊓ f₂) ×ˢ g = (f₁ ×ˢ g) ⊓ (f₂ ×ˢ g) := by
357347
rw [prod_inf_prod, inf_idem]
@@ -361,8 +351,7 @@ theorem prod_inf {g₁ g₂ : Filter β} : f ×ˢ (g₁ ⊓ g₂) = (f ×ˢ g₁
361351

362352
@[simp]
363353
theorem prod_principal_principal {s : Set α} {t : Set β} : 𝓟 s ×ˢ 𝓟 t = 𝓟 (s ×ˢ t) := by
364-
simp only [SProd.sprod, Filter.prod, comap_principal, principal_eq_iff_eq, comap_principal,
365-
inf_principal]; rfl
354+
simp only [prod_eq_inf, comap_principal, principal_eq_iff_eq, comap_principal, inf_principal]; rfl
366355

367356
@[simp]
368357
theorem pure_prod {a : α} {f : Filter β} : pure a ×ˢ f = map (Prod.mk a) f := by
@@ -413,9 +402,7 @@ theorem tendsto_prod_iff {f : α × β → γ} {x : Filter α} {y : Filter β} {
413402

414403
theorem tendsto_prod_iff' {g' : Filter γ} {s : α → β × γ} :
415404
Tendsto s f (g ×ˢ g') ↔ Tendsto (fun n => (s n).1) f g ∧ Tendsto (fun n => (s n).2) f g' := by
416-
dsimp only [SProd.sprod]
417-
unfold Filter.prod
418-
simp only [tendsto_inf, tendsto_comap_iff, Function.comp_def]
405+
simp only [prod_eq_inf, tendsto_inf, tendsto_comap_iff, Function.comp_def]
419406

420407
theorem le_prod {f : Filter (α × β)} {g : Filter α} {g' : Filter β} :
421408
(f ≤ g ×ˢ g') ↔ Tendsto Prod.fst f g ∧ Tendsto Prod.snd f g' :=

Mathlib/Topology/Algebra/UniformGroup/Defs.lean

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -406,19 +406,11 @@ variable {G}
406406
@[to_additive]
407407
-- Porting note: renamed theorem to conform to naming convention
408408
theorem comm_topologicalGroup_is_uniform : UniformGroup G := by
409-
have :
410-
Tendsto
411-
((fun p : G × G => p.1 / p.2) ∘ fun p : (G × G) × G × G => (p.1.2 / p.1.1, p.2.2 / p.2.1))
412-
(comap (fun p : (G × G) × G × G => (p.1.2 / p.1.1, p.2.2 / p.2.1)) ((𝓝 1).prod (𝓝 1)))
413-
(𝓝 (1 / 1)) :=
414-
(tendsto_fst.div' tendsto_snd).comp tendsto_comap
415409
constructor
416-
rw [UniformContinuous, uniformity_prod_eq_prod, tendsto_map'_iff, uniformity_eq_comap_nhds_one' G,
417-
tendsto_comap_iff, prod_comap_comap_eq]
418-
simp only [Function.comp_def, div_eq_mul_inv, mul_inv_rev, inv_inv, mul_comm, mul_left_comm] at *
419-
simp only [inv_one, mul_one, ← mul_assoc] at this
420-
simp_rw [← mul_assoc, mul_comm]
421-
assumption
410+
simp only [UniformContinuous, uniformity_prod_eq_prod, uniformity_eq_comap_nhds_one',
411+
tendsto_comap_iff, tendsto_map'_iff, prod_comap_comap_eq, Function.comp_def,
412+
div_div_div_comm _ (Prod.snd (Prod.snd _)), ← nhds_prod_eq, Prod.mk_one_one]
413+
exact (continuous_div'.tendsto' 1 1 (div_one 1)).comp tendsto_comap
422414

423415
open Set
424416

Mathlib/Topology/Constructions.lean

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,9 @@ theorem IsOpen.prod {s : Set X} {t : Set Y} (hs : IsOpen s) (ht : IsOpen t) : Is
477477

478478
-- Porting note (https://github.com/leanprover-community/mathlib4/issues/11215): TODO: Lean fails to find `t₁` and `t₂` by unification
479479
theorem nhds_prod_eq {x : X} {y : Y} : 𝓝 (x, y) = 𝓝 x ×ˢ 𝓝 y := by
480-
dsimp only [SProd.sprod]
481-
rw [Filter.prod, instTopologicalSpaceProd, nhds_inf (t₁ := TopologicalSpace.induced Prod.fst _)
480+
rw [prod_eq_inf, instTopologicalSpaceProd, nhds_inf (t₁ := TopologicalSpace.induced Prod.fst _)
482481
(t₂ := TopologicalSpace.induced Prod.snd _), nhds_induced, nhds_induced]
483482

484-
-- Porting note: moved from `Topology.ContinuousOn`
485483
theorem nhdsWithin_prod_eq (x : X) (y : Y) (s : Set X) (t : Set Y) :
486484
𝓝[s ×ˢ t] (x, y) = 𝓝[s] x ×ˢ 𝓝[t] y := by
487485
simp only [nhdsWithin, nhds_prod_eq, ← prod_inf_prod, prod_principal_principal]
@@ -504,15 +502,13 @@ theorem mem_nhdsWithin_prod_iff {x : X} {y : Y} {s : Set (X × Y)} {tx : Set X}
504502
s ∈ 𝓝[tx ×ˢ ty] (x, y) ↔ ∃ u ∈ 𝓝[tx] x, ∃ v ∈ 𝓝[ty] y, u ×ˢ v ⊆ s := by
505503
rw [nhdsWithin_prod_eq, mem_prod_iff]
506504

507-
-- Porting note: moved up
508505
theorem Filter.HasBasis.prod_nhds {ιX ιY : Type*} {px : ιX → Prop} {py : ιY → Prop}
509506
{sx : ιX → Set X} {sy : ιY → Set Y} {x : X} {y : Y} (hx : (𝓝 x).HasBasis px sx)
510507
(hy : (𝓝 y).HasBasis py sy) :
511508
(𝓝 (x, y)).HasBasis (fun i : ιX × ιY => px i.1 ∧ py i.2) fun i => sx i.1 ×ˢ sy i.2 := by
512509
rw [nhds_prod_eq]
513510
exact hx.prod hy
514511

515-
-- Porting note: moved up
516512
theorem Filter.HasBasis.prod_nhds' {ιX ιY : Type*} {pX : ιX → Prop} {pY : ιY → Prop}
517513
{sx : ιX → Set X} {sy : ιY → Set Y} {p : X × Y} (hx : (𝓝 p.1).HasBasis pX sx)
518514
(hy : (𝓝 p.2).HasBasis pY sy) :

Mathlib/Topology/Instances/TrivSqZeroExt.lean

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,12 @@ instance instTopologicalSpace : TopologicalSpace (tsze R M) :=
4242
instance [T2Space R] [T2Space M] : T2Space (tsze R M) :=
4343
Prod.t2Space
4444

45-
theorem nhds_def (x : tsze R M) : 𝓝 x = (𝓝 x.fst).prod (𝓝 x.snd) := by
46-
cases x using Prod.rec
47-
exact nhds_prod_eq
45+
theorem nhds_def (x : tsze R M) : 𝓝 x = 𝓝 x.fst ×ˢ 𝓝 x.snd := nhds_prod_eq
4846

49-
theorem nhds_inl [Zero M] (x : R) : 𝓝 (inl x : tsze R M) = (𝓝 x).prod (𝓝 0) :=
47+
theorem nhds_inl [Zero M] (x : R) : 𝓝 (inl x : tsze R M) = 𝓝 x ×ˢ 𝓝 0 :=
5048
nhds_def _
5149

52-
theorem nhds_inr [Zero R] (m : M) : 𝓝 (inr m : tsze R M) = (𝓝 0).prod (𝓝 m) :=
50+
theorem nhds_inr [Zero R] (m : M) : 𝓝 (inr m : tsze R M) = 𝓝 0 ×ˢ 𝓝 m :=
5351
nhds_def _
5452

5553
nonrec theorem continuous_fst : Continuous (fst : tsze R M → R) :=

0 commit comments

Comments
 (0)