Skip to content

Commit

Permalink
feat(topology/constructions): continuity of uncurried functions when …
Browse files Browse the repository at this point in the history
…the first factor is discrete (#12935)
  • Loading branch information
sgouezel committed Mar 26, 2022
1 parent 5e449c2 commit f68536e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/order/filter/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2661,6 +2661,10 @@ by simp only [filter.prod, comap_principal, principal_eq_iff_eq, comap_principal
@[simp] lemma pure_prod {a : α} {f : filter β} : pure a ×ᶠ f = map (prod.mk a) f :=
by rw [prod_eq, map_pure, pure_seq_eq_map]

lemma map_pure_prod (f : α → β → γ) (a : α) (B : filter β) :
filter.map (function.uncurry f) (pure a ×ᶠ B) = filter.map (f a) B :=
by { rw filter.pure_prod, refl }

@[simp] lemma prod_pure {f : filter α} {b : β} : f ×ᶠ pure b = map (λ a, (a, b)) f :=
by rw [prod_eq, seq_pure, map_map]

Expand Down
4 changes: 4 additions & 0 deletions src/topology/algebra/group.lean
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ lemma continuous_zpow : ∀ z : ℤ, continuous (λ a : G, a ^ z)
instance add_group.has_continuous_const_smul_int {A} [add_group A] [topological_space A]
[topological_add_group A] : has_continuous_const_smul ℤ A := ⟨continuous_zsmul⟩

instance add_group.has_continuous_smul_int {A} [add_group A] [topological_space A]
[topological_add_group A] : has_continuous_smul ℤ A :=
⟨continuous_uncurry_of_discrete_topology continuous_zsmul⟩

@[continuity, to_additive]
lemma continuous.zpow {f : α → G} (h : continuous f) (z : ℤ) :
continuous (λ b, (f b) ^ z) :=
Expand Down
4 changes: 4 additions & 0 deletions src/topology/algebra/monoid.lean
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,10 @@ lemma continuous_pow : ∀ n : ℕ, continuous (λ a : M, a ^ n)
instance add_monoid.has_continuous_const_smul_nat {A} [add_monoid A] [topological_space A]
[has_continuous_add A] : has_continuous_const_smul ℕ A := ⟨continuous_nsmul⟩

instance add_monoid.has_continuous_smul_nat {A} [add_monoid A] [topological_space A]
[has_continuous_add A] : has_continuous_smul ℕ A :=
⟨continuous_uncurry_of_discrete_topology continuous_nsmul⟩

@[continuity, to_additive continuous.nsmul]
lemma continuous.pow {f : X → M} (h : continuous f) (n : ℕ) :
continuous (λ b, (f b) ^ n) :=
Expand Down
12 changes: 12 additions & 0 deletions src/topology/constructions.lean
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,18 @@ is_open.inter (hs.preimage continuous_fst) (ht.preimage continuous_snd)
lemma nhds_prod_eq {a : α} {b : β} : 𝓝 (a, b) = 𝓝 a ×ᶠ 𝓝 b :=
by rw [filter.prod, prod.topological_space, nhds_inf, nhds_induced, nhds_induced]

/-- If a function `f x y` is such that `y ↦ f x y` is continuous for all `x`, and `x` lives in a
discrete space, then `f` is continuous. -/
lemma continuous_uncurry_of_discrete_topology [discrete_topology α]
{f : α → β → γ} (hf : ∀ a, continuous (f a)) : continuous (function.uncurry f) :=
begin
apply continuous_iff_continuous_at.2,
rintros ⟨a, x⟩,
change map _ _ ≤ _,
rw [nhds_prod_eq, nhds_discrete, filter.map_pure_prod],
exact (hf a).continuous_at
end

lemma mem_nhds_prod_iff {a : α} {b : β} {s : set (α × β)} :
s ∈ 𝓝 (a, b) ↔ ∃ (u ∈ 𝓝 a) (v ∈ 𝓝 b), u ×ˢ v ⊆ s :=
by rw [nhds_prod_eq, mem_prod_iff]
Expand Down

0 comments on commit f68536e

Please sign in to comment.