Skip to content

Commit

Permalink
feat: add Tendsto.fst, Tendsto.snd, Tendsto.apply and nhds versions (#…
Browse files Browse the repository at this point in the history
…11812)

- Add `Tendsto.fst`, `Tendsto.snd` and `Tendsto.apply` (these are about product of filters)
- Move the current `Tendsto.apply` to `Tendsto.apply_nhds`, and add `Tendsto.fst_nhds` and `Tendsto.snd_nhds` (these are about neighborhoods in a product space)
  • Loading branch information
ADedecker committed Mar 31, 2024
1 parent 522c668 commit 6452826
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Mathlib/Analysis/NormedSpace/lpSpace.lean
Expand Up @@ -1191,7 +1191,7 @@ theorem tendsto_lp_of_tendsto_pi {F : ℕ → lp E p} (hF : CauchySeq F) {f : lp
refine' norm_le_of_tendsto (hn.mono fun k hk => hk.le) _
rw [tendsto_pi_nhds]
intro a
exact (hf.apply a).const_sub (F n a)
exact (hf.apply_nhds a).const_sub (F n a)
#align lp.tendsto_lp_of_tendsto_pi lp.tendsto_lp_of_tendsto_pi

variable [∀ a, CompleteSpace (E a)]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/MeasureTheory/Covering/BesicovitchVectorSpace.lean
Expand Up @@ -247,7 +247,7 @@ theorem exists_goodδ :
· simp only [pi_norm_le_iff_of_nonneg zero_le_two, mem_closedBall, dist_zero_right] at fmem
exact fmem i
· have A : Tendsto (fun n => ‖F (u (φ n)) i - F (u (φ n)) j‖) atTop (𝓝 ‖f i - f j‖) :=
((hf.apply i).sub (hf.apply j)).norm
((hf.apply_nhds i).sub (hf.apply_nhds j)).norm
have B : Tendsto (fun n => 1 - u (φ n)) atTop (𝓝 (1 - 0)) :=
tendsto_const_nhds.sub (hu.comp φ_mono.tendsto_atTop)
rw [sub_zero] at B
Expand Down
5 changes: 5 additions & 0 deletions Mathlib/Order/Filter/Pi.lean
Expand Up @@ -53,6 +53,11 @@ theorem tendsto_pi {β : Type*} {m : β → ∀ i, α i} {l : Filter β} :
simp only [pi, tendsto_iInf, tendsto_comap_iff]; rfl
#align filter.tendsto_pi Filter.tendsto_pi

/-- If a function tends to a product `Filter.pi f` of filters, then its `i`-th component tends to
`f i`. See also `Filter.Tendsto.apply_nhds` for the special case of converging to a point in a
product of topological spaces. -/
alias ⟨Tendsto.apply, _⟩ := tendsto_pi

theorem le_pi {g : Filter (∀ i, α i)} : g ≤ pi f ↔ ∀ i, Tendsto (eval i) g (f i) :=
tendsto_pi
#align filter.le_pi Filter.le_pi
Expand Down
14 changes: 14 additions & 0 deletions Mathlib/Order/Filter/Prod.lean
Expand Up @@ -139,6 +139,20 @@ theorem tendsto_snd : Tendsto Prod.snd (f ×ˢ g) g :=
tendsto_inf_right tendsto_comap
#align filter.tendsto_snd Filter.tendsto_snd

/-- If a function tends to a product `g ×ˢ h` of filters, then its first component tends to
`g`. See also `Filter.Tendsto.fst_nhds` for the special case of converging to a point in a
product of two topological spaces. -/
theorem Tendsto.fst {h : Filter γ} {m : α → β × γ} (H : Tendsto m f (g ×ˢ h)) :
Tendsto (fun a ↦ (m a).1) f g :=
tendsto_fst.comp H

/-- If a function tends to a product `g ×ˢ h` of filters, then its second component tends to
`h`. See also `Filter.Tendsto.snd_nhds` for the special case of converging to a point in a
product of two topological spaces. -/
theorem Tendsto.snd {h : Filter γ} {m : α → β × γ} (H : Tendsto m f (g ×ˢ h)) :
Tendsto (fun a ↦ (m a).2) f h :=
tendsto_snd.comp H

theorem Tendsto.prod_mk {h : Filter γ} {m₁ : α → β} {m₂ : α → γ}
(h₁ : Tendsto m₁ f g) (h₂ : Tendsto m₂ f h) : Tendsto (fun x => (m₁ x, m₂ x)) f (g ×ˢ h) :=
tendsto_inf.2 ⟨tendsto_comap_iff.2 h₁, tendsto_comap_iff.2 h₂⟩
Expand Down
14 changes: 11 additions & 3 deletions Mathlib/Topology/Constructions.lean
Expand Up @@ -366,6 +366,10 @@ theorem ContinuousAt.fst'' {f : X → Z} {x : X × Y} (hf : ContinuousAt f x.fst
hf.comp continuousAt_fst
#align continuous_at.fst'' ContinuousAt.fst''

theorem Filter.Tendsto.fst_nhds {l : Filter X} {f : X → Y × Z} {p : Y × Z}
(h : Tendsto f l (𝓝 p)) : Tendsto (fun a ↦ (f a).1) l (𝓝 <| p.1) :=
continuousAt_fst.tendsto.comp h

@[continuity]
theorem continuous_snd : Continuous (@Prod.snd X Y) :=
(continuous_prod_mk.1 continuous_id).2
Expand Down Expand Up @@ -405,6 +409,10 @@ theorem ContinuousAt.snd'' {f : Y → Z} {x : X × Y} (hf : ContinuousAt f x.snd
hf.comp continuousAt_snd
#align continuous_at.snd'' ContinuousAt.snd''

theorem Filter.Tendsto.snd_nhds {l : Filter X} {f : X → Y × Z} {p : Y × Z}
(h : Tendsto f l (𝓝 p)) : Tendsto (fun a ↦ (f a).2) l (𝓝 <| p.2) :=
continuousAt_snd.tendsto.comp h

@[continuity, fun_prop]
theorem Continuous.prod_mk {f : Z → X} {g : Z → Y} (hf : Continuous f) (hg : Continuous g) :
Continuous fun x => (f x, g x) :=
Expand Down Expand Up @@ -1294,10 +1302,10 @@ theorem continuousAt_apply (i : ι) (x : ∀ i, π i) : ContinuousAt (fun p :
(continuous_apply i).continuousAt
#align continuous_at_apply continuousAt_apply

theorem Filter.Tendsto.apply {l : Filter Y} {f : Y → ∀ i, π i} {x : ∀ i, π i}
theorem Filter.Tendsto.apply_nhds {l : Filter Y} {f : Y → ∀ i, π i} {x : ∀ i, π i}
(h : Tendsto f l (𝓝 x)) (i : ι) : Tendsto (fun a => f a i) l (𝓝 <| x i) :=
(continuousAt_apply i _).tendsto.comp h
#align filter.tendsto.apply Filter.Tendsto.apply
#align filter.tendsto.apply Filter.Tendsto.apply_nhds

theorem nhds_pi {a : ∀ i, π i} : 𝓝 a = pi fun i => 𝓝 (a i) := by
simp only [nhds_iInf, nhds_induced, Filter.pi]
Expand Down Expand Up @@ -1358,7 +1366,7 @@ lemma Pi.induced_restrict (S : Set ι) :
theorem Filter.Tendsto.update [DecidableEq ι] {l : Filter Y} {f : Y → ∀ i, π i} {x : ∀ i, π i}
(hf : Tendsto f l (𝓝 x)) (i : ι) {g : Y → π i} {xi : π i} (hg : Tendsto g l (𝓝 xi)) :
Tendsto (fun a => update (f a) i (g a)) l (𝓝 <| update x i xi) :=
tendsto_pi_nhds.2 fun j => by rcases eq_or_ne j i with (rfl | hj) <;> simp [*, hf.apply]
tendsto_pi_nhds.2 fun j => by rcases eq_or_ne j i with (rfl | hj) <;> simp [*, hf.apply_nhds]
#align filter.tendsto.update Filter.Tendsto.update

theorem ContinuousAt.update [DecidableEq ι] {x : X} (hf : ContinuousAt f x) (i : ι) {g : X → π i}
Expand Down

0 comments on commit 6452826

Please sign in to comment.