state
stringlengths
0
159k
srcUpToTactic
stringlengths
387
167k
nextTactic
stringlengths
3
9k
declUpToTactic
stringlengths
22
11.5k
declId
stringlengths
38
95
decl
stringlengths
16
1.89k
file_tag
stringlengths
17
73
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝⁸ : TopologicalSpace X inst✝⁷ : TopologicalSpace M inst✝⁶ : Mul M inst✝⁵ : ContinuousMul M inst✝⁴ : TopologicalSpace N inst✝³ : Monoid N inst✝² : ContinuousMul N inst✝¹ : T2Space N f : ι → Nˣ r₁ r₂ : N l : Filter ι inst✝ : NeBot l h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁) h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂) ⊢ 1 = r₂ * r₁
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm
simpa using h₂.mul h₁
/-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm
Mathlib.Topology.Algebra.Monoid.197_0.3p9EZf9ZWFxWOAq
/-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : Monoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) hright : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1) ⊢ Continuous fun p => p.1 * p.2
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by
rw [continuous_iff_continuousAt]
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by
Mathlib.Topology.Algebra.Monoid.263_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : Monoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) hright : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1) ⊢ ∀ (x : M × M), ContinuousAt (fun p => p.1 * p.2) x
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt]
rintro ⟨x₀, y₀⟩
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt]
Mathlib.Topology.Algebra.Monoid.263_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
case mk ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : Monoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) hright : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1) x₀ y₀ : M ⊢ ContinuousAt (fun p => p.1 * p.2) (x₀, y₀)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩
have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc]
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩
Mathlib.Topology.Algebra.Monoid.263_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : Monoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) hright : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1) x₀ y₀ : M ⊢ (fun p => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry fun x x_1 => x * x_1
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by
ext p
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by
Mathlib.Topology.Algebra.Monoid.263_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
case h ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : Monoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) hright : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1) x₀ y₀ : M p : M × M ⊢ x₀ * p.1 * (p.2 * y₀) = (((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry fun x x_1 => x * x_1) p
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p
simp [uncurry, mul_assoc]
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p
Mathlib.Topology.Algebra.Monoid.263_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
case mk ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : Monoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) hright : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1) x₀ y₀ : M key : (fun p => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry fun x x_1 => x * x_1 ⊢ ContinuousAt (fun p => p.1 * p.2) (x₀, y₀)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc]
have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc]
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc]
Mathlib.Topology.Algebra.Monoid.263_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : Monoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) hright : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1) x₀ y₀ : M key : (fun p => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry fun x x_1 => x * x_1 ⊢ ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by
ext x
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by
Mathlib.Topology.Algebra.Monoid.263_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
case h ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : Monoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) hright : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1) x₀ y₀ : M key : (fun p => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry fun x x_1 => x * x_1 x : M ⊢ ((fun x => x₀ * x) ∘ fun x => y₀ * x) x = x₀ * y₀ * x
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x
simp [mul_assoc]
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x
Mathlib.Topology.Algebra.Monoid.263_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
case mk ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : Monoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) hright : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1) x₀ y₀ : M key : (fun p => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry fun x x_1 => x * x_1 key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x ⊢ ContinuousAt (fun p => p.1 * p.2) (x₀, y₀)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc]
calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc]
Mathlib.Topology.Algebra.Monoid.263_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : Monoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) hright : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1) x₀ y₀ : M key : (fun p => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry fun x x_1 => x * x_1 key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x ⊢ map (uncurry fun x x_1 => x * x_1) (𝓝 (x₀, y₀)) = map (uncurry fun x x_1 => x * x_1) (𝓝 x₀ ×ˢ 𝓝 y₀)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by
rw [nhds_prod_eq]
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by
Mathlib.Topology.Algebra.Monoid.263_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : Monoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) hright : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1) x₀ y₀ : M key : (fun p => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry fun x x_1 => x * x_1 key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x ⊢ map (uncurry fun x x_1 => x * x_1) (𝓝 x₀ ×ˢ 𝓝 y₀) = map (fun p => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`.
simp (config := { unfoldPartialApp := true }) only [uncurry]
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`.
Mathlib.Topology.Algebra.Monoid.263_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : Monoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) hright : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1) x₀ y₀ : M key : (fun p => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry fun x x_1 => x * x_1 key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x ⊢ map (fun a => a.1 * a.2) (𝓝 x₀ ×ˢ 𝓝 y₀) = map (fun p => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry]
simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def]
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry]
Mathlib.Topology.Algebra.Monoid.263_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : Monoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) hright : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1) x₀ y₀ : M key : (fun p => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry fun x x_1 => x * x_1 key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x ⊢ map (fun p => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1))
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by
rw [key, ← Filter.map_map]
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by
Mathlib.Topology.Algebra.Monoid.263_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : Monoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) hright : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1) x₀ y₀ : M key : (fun p => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry fun x x_1 => x * x_1 key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x ⊢ map ((fun x => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) = 𝓝 (x₀ * y₀)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by
rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by
Mathlib.Topology.Algebra.Monoid.263_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : CommMonoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) ⊢ ContinuousMul M
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by
apply ContinuousMul.of_nhds_one hmul hleft
@[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by
Mathlib.Topology.Algebra.Monoid.296_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : CommMonoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) ⊢ ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft
intro x₀
@[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft
Mathlib.Topology.Algebra.Monoid.296_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X inst✝⁴ : TopologicalSpace M✝ inst✝³ : Mul M✝ inst✝² : ContinuousMul M✝ M : Type u inst✝¹ : CommMonoid M inst✝ : TopologicalSpace M hmul : Tendsto (uncurry fun x x_1 => x * x_1) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1) hleft : ∀ (x₀ : M), 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1) x₀ : M ⊢ 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀
simp_rw [mul_comm, hleft x₀]
@[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀
Mathlib.Topology.Algebra.Monoid.296_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X M₁ : Type u_6 M₂ : Type u_7 inst✝⁴ : TopologicalSpace M₂ inst✝³ : T2Space M₂ inst✝² : Mul M₁ inst✝¹ : Mul M₂ inst✝ : ContinuousMul M₂ ⊢ IsClosed {f | ∀ (x y : M₁), f (x * y) = f x * f y}
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by
simp only [setOf_forall]
@[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by
Mathlib.Topology.Algebra.Monoid.318_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y }
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X M₁ : Type u_6 M₂ : Type u_7 inst✝⁴ : TopologicalSpace M₂ inst✝³ : T2Space M₂ inst✝² : Mul M₁ inst✝¹ : Mul M₂ inst✝ : ContinuousMul M₂ ⊢ IsClosed (⋂ i, ⋂ i_1, {x | x (i * i_1) = x i * x i_1})
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall]
exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity)
@[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall]
Mathlib.Topology.Algebra.Monoid.318_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y }
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝⁵ : TopologicalSpace X M₁ : Type u_6 M₂ : Type u_7 inst✝⁴ : TopologicalSpace M₂ inst✝³ : T2Space M₂ inst✝² : Mul M₁ inst✝¹ : Mul M₂ inst✝ : ContinuousMul M₂ x y : M₁ ⊢ Continuous fun x_1 => x_1 x * x_1 y
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by
continuity
@[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by
Mathlib.Topology.Algebra.Monoid.318_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y }
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N✝ : Type u_4 X : Type u_5 inst✝⁶ : TopologicalSpace X M : Type u_6 N : Type u_7 F : Type u_8 inst✝⁵ : Mul M inst✝⁴ : Mul N inst✝³ : MulHomClass F M N inst✝² : TopologicalSpace M inst✝¹ : TopologicalSpace N inst✝ : ContinuousMul N f : F hf : Inducing ⇑f ⊢ Continuous (⇑f ∘ fun p => p.1 * p.2)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by
simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'
@[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by
Mathlib.Topology.Algebra.Monoid.375_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M s : Set M hs : s ∈ 𝓝 1 ⊢ ∃ V, IsOpen V ∧ 1 ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by
have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs)
@[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by
Mathlib.Topology.Algebra.Monoid.475_0.3p9EZf9ZWFxWOAq
@[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M s : Set M hs : s ∈ 𝓝 1 ⊢ s ∈ 𝓝 (1 * 1)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by
simpa only [one_mul] using hs
@[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by
Mathlib.Topology.Algebra.Monoid.475_0.3p9EZf9ZWFxWOAq
@[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M s : Set M hs : s ∈ 𝓝 1 this : (fun a => a.1 * a.2) ⁻¹' s ∈ 𝓝 (1, 1) ⊢ ∃ V, IsOpen V ∧ 1 ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs)
simpa only [prod_subset_iff] using exists_nhds_square this
@[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs)
Mathlib.Topology.Algebra.Monoid.475_0.3p9EZf9ZWFxWOAq
@[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M u : Set M hu : u ∈ 𝓝 1 ⊢ ∃ V ∈ 𝓝 1, ∀ {v w s t : M}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by
rcases exists_nhds_one_split hu with ⟨W, W1, h⟩
@[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by
Mathlib.Topology.Algebra.Monoid.492_0.3p9EZf9ZWFxWOAq
@[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u
Mathlib_Topology_Algebra_Monoid
case intro.intro ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M u : Set M hu : u ∈ 𝓝 1 W : Set M W1 : W ∈ 𝓝 1 h : ∀ v ∈ W, ∀ w ∈ W, v * w ∈ u ⊢ ∃ V ∈ 𝓝 1, ∀ {v w s t : M}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩
rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩
@[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩
Mathlib.Topology.Algebra.Monoid.492_0.3p9EZf9ZWFxWOAq
@[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u
Mathlib_Topology_Algebra_Monoid
case intro.intro.intro.intro ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M u : Set M hu : u ∈ 𝓝 1 W : Set M W1 : W ∈ 𝓝 1 h : ∀ v ∈ W, ∀ w ∈ W, v * w ∈ u V : Set M V1 : V ∈ 𝓝 1 h' : ∀ v ∈ V, ∀ w ∈ V, v * w ∈ W ⊢ ∃ V ∈ 𝓝 1, ∀ {v w s t : M}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩
use V, V1
@[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩
Mathlib.Topology.Algebra.Monoid.492_0.3p9EZf9ZWFxWOAq
@[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u
Mathlib_Topology_Algebra_Monoid
case right ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M u : Set M hu : u ∈ 𝓝 1 W : Set M W1 : W ∈ 𝓝 1 h : ∀ v ∈ W, ∀ w ∈ W, v * w ∈ u V : Set M V1 : V ∈ 𝓝 1 h' : ∀ v ∈ V, ∀ w ∈ V, v * w ∈ W ⊢ ∀ {v w s t : M}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1
intro v w s t v_in w_in s_in t_in
@[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1
Mathlib.Topology.Algebra.Monoid.492_0.3p9EZf9ZWFxWOAq
@[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u
Mathlib_Topology_Algebra_Monoid
case right ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M u : Set M hu : u ∈ 𝓝 1 W : Set M W1 : W ∈ 𝓝 1 h : ∀ v ∈ W, ∀ w ∈ W, v * w ∈ u V : Set M V1 : V ∈ 𝓝 1 h' : ∀ v ∈ V, ∀ w ∈ V, v * w ∈ W v w s t : M v_in : v ∈ V w_in : w ∈ V s_in : s ∈ V t_in : t ∈ V ⊢ v * w * s * t ∈ u
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in
simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in)
@[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in
Mathlib.Topology.Algebra.Monoid.492_0.3p9EZf9ZWFxWOAq
@[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M U : Set M hU : U ∈ 𝓝 1 ⊢ ∃ V, IsOpen V ∧ 1 ∈ V ∧ V * V ⊆ U
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by
rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩
/-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by
Mathlib.Topology.Algebra.Monoid.503_0.3p9EZf9ZWFxWOAq
/-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U
Mathlib_Topology_Algebra_Monoid
case intro.intro.intro ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M U : Set M hU : U ∈ 𝓝 1 V : Set M Vo : IsOpen V V1 : 1 ∈ V hV : ∀ v ∈ V, ∀ w ∈ V, v * w ∈ U ⊢ ∃ V, IsOpen V ∧ 1 ∈ V ∧ V * V ⊆ U
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩
use V, Vo, V1
/-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩
Mathlib.Topology.Algebra.Monoid.503_0.3p9EZf9ZWFxWOAq
/-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U
Mathlib_Topology_Algebra_Monoid
case right ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M U : Set M hU : U ∈ 𝓝 1 V : Set M Vo : IsOpen V V1 : 1 ∈ V hV : ∀ v ∈ V, ∀ w ∈ V, v * w ∈ U ⊢ V * V ⊆ U
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1
rintro _ ⟨x, y, hx, hy, rfl⟩
/-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1
Mathlib.Topology.Algebra.Monoid.503_0.3p9EZf9ZWFxWOAq
/-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U
Mathlib_Topology_Algebra_Monoid
case right.intro.intro.intro.intro ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M U : Set M hU : U ∈ 𝓝 1 V : Set M Vo : IsOpen V V1 : 1 ∈ V hV : ∀ v ∈ V, ∀ w ∈ V, v * w ∈ U x y : M hx : x ∈ V hy : y ∈ V ⊢ (fun x x_1 => x * x_1) x y ∈ U
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩
exact hV _ hx _ hy
/-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩
Mathlib.Topology.Algebra.Monoid.503_0.3p9EZf9ZWFxWOAq
/-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M s t : Set M hs : IsCompact s ht : IsCompact t ⊢ IsCompact (s * t)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by
rw [← image_mul_prod]
@[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by
Mathlib.Topology.Algebra.Monoid.516_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t)
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M s t : Set M hs : IsCompact s ht : IsCompact t ⊢ IsCompact ((fun x => x.1 * x.2) '' s ×ˢ t)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod]
exact (hs.prod ht).image continuous_mul
@[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod]
Mathlib.Topology.Algebra.Monoid.516_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t)
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M f : ι → α → M x : Filter α a : ι → M x✝ : ∀ i ∈ [], Tendsto (f i) x (𝓝 (a i)) ⊢ Tendsto (fun b => List.prod (List.map (fun c => f c b) [])) x (𝓝 (List.prod (List.map a [])))
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by
simp [tendsto_const_nhds]
@[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by
Mathlib.Topology.Algebra.Monoid.523_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc))
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M f✝ : ι → α → M x : Filter α a : ι → M f : ι l : List ι h : ∀ i ∈ f :: l, Tendsto (f✝ i) x (𝓝 (a i)) ⊢ Tendsto (fun b => List.prod (List.map (fun c => f✝ c b) (f :: l))) x (𝓝 (List.prod (List.map a (f :: l))))
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by
simp only [List.map_cons, List.prod_cons]
@[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by
Mathlib.Topology.Algebra.Monoid.523_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc))
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M f✝ : ι → α → M x : Filter α a : ι → M f : ι l : List ι h : ∀ i ∈ f :: l, Tendsto (f✝ i) x (𝓝 (a i)) ⊢ Tendsto (fun b => f✝ f b * List.prod (List.map (fun c => f✝ c b) l)) x (𝓝 (a f * List.prod (List.map a l)))
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons]
exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc))
@[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons]
Mathlib.Topology.Algebra.Monoid.523_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc))
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M f : ι → X → M l : List ι t : Set X h : ∀ i ∈ l, ContinuousOn (f i) t ⊢ ContinuousOn (fun a => List.prod (List.map (fun i => f i a) l)) t
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by
intro x hx
@[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by
Mathlib.Topology.Algebra.Monoid.545_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M f : ι → X → M l : List ι t : Set X h : ∀ i ∈ l, ContinuousOn (f i) t x : X hx : x ∈ t ⊢ ContinuousWithinAt (fun a => List.prod (List.map (fun i => f i a) l)) t x
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx
rw [continuousWithinAt_iff_continuousAt_restrict _ hx]
@[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx
Mathlib.Topology.Algebra.Monoid.545_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M f : ι → X → M l : List ι t : Set X h : ∀ i ∈ l, ContinuousOn (f i) t x : X hx : x ∈ t ⊢ ContinuousAt (restrict t fun a => List.prod (List.map (fun i => f i a) l)) { val := x, property := hx }
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx]
refine' tendsto_list_prod _ fun i hi => _
@[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx]
Mathlib.Topology.Algebra.Monoid.545_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M f : ι → X → M l : List ι t : Set X h : ∀ i ∈ l, ContinuousOn (f i) t x : X hx : x ∈ t i : ι hi : i ∈ l ⊢ Tendsto (fun b => f i ↑b) (𝓝 { val := x, property := hx }) (𝓝 (f i ↑{ val := x, property := hx }))
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _
specialize h i hi x hx
@[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _
Mathlib.Topology.Algebra.Monoid.545_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M f : ι → X → M l : List ι t : Set X x : X hx : x ∈ t i : ι hi : i ∈ l h : ContinuousWithinAt (f i) t x ⊢ Tendsto (fun b => f i ↑b) (𝓝 { val := x, property := hx }) (𝓝 (f i ↑{ val := x, property := hx }))
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx
rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h
@[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx
Mathlib.Topology.Algebra.Monoid.545_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M f : ι → X → M l : List ι t : Set X x : X hx : x ∈ t i : ι hi : i ∈ l h : ContinuousAt (restrict t (f i)) { val := x, property := hx } ⊢ Tendsto (fun b => f i ↑b) (𝓝 { val := x, property := hx }) (𝓝 (f i ↑{ val := x, property := hx }))
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h
exact h
@[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h
Mathlib.Topology.Algebra.Monoid.545_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M ⊢ Continuous fun a => a ^ 0
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by
simpa using continuous_const
@[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by
Mathlib.Topology.Algebra.Monoid.558_0.3p9EZf9ZWFxWOAq
@[to_additive (attr
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M k : ℕ ⊢ Continuous fun a => a ^ (k + 1)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by
simp only [pow_succ]
@[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by
Mathlib.Topology.Algebra.Monoid.558_0.3p9EZf9ZWFxWOAq
@[to_additive (attr
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M k : ℕ ⊢ Continuous fun a => a * a ^ k
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ]
exact continuous_id.mul (continuous_pow _)
@[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ]
Mathlib.Topology.Algebra.Monoid.558_0.3p9EZf9ZWFxWOAq
@[to_additive (attr
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M a b : M ha : b * a = 1 ⊢ Tendsto (fun x => a * x) (cocompact M) (cocompact M)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by
refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b))
/-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by
Mathlib.Topology.Algebra.Monoid.631_0.3p9EZf9ZWFxWOAq
/-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M)
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M a b : M ha : b * a = 1 ⊢ Tendsto ((fun b_1 => b * b_1) ∘ fun x => a * x) (cocompact M) (cocompact M)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b))
simp only [comp_mul_left, ha, one_mul]
/-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b))
Mathlib.Topology.Algebra.Monoid.631_0.3p9EZf9ZWFxWOAq
/-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M)
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M a b : M ha : b * a = 1 ⊢ Tendsto (fun x => x) (cocompact M) (cocompact M)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul]
exact Filter.tendsto_id
/-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul]
Mathlib.Topology.Algebra.Monoid.631_0.3p9EZf9ZWFxWOAq
/-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M)
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M a b : M ha : a * b = 1 ⊢ Tendsto (fun x => x * a) (cocompact M) (cocompact M)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by
refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b))
/-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by
Mathlib.Topology.Algebra.Monoid.645_0.3p9EZf9ZWFxWOAq
/-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M)
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M a b : M ha : a * b = 1 ⊢ Tendsto ((fun b_1 => b_1 * b) ∘ fun x => x * a) (cocompact M) (cocompact M)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b))
simp only [comp_mul_right, ha, mul_one]
/-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b))
Mathlib.Topology.Algebra.Monoid.645_0.3p9EZf9ZWFxWOAq
/-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M)
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : Monoid M inst✝ : ContinuousMul M a b : M ha : a * b = 1 ⊢ Tendsto (fun x => x) (cocompact M) (cocompact M)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one]
exact Filter.tendsto_id
/-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one]
Mathlib.Topology.Algebra.Monoid.645_0.3p9EZf9ZWFxWOAq
/-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M)
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝⁸ : TopologicalSpace X inst✝⁷ : TopologicalSpace M inst✝⁶ : Monoid M inst✝⁵ : ContinuousMul M R : Type u_6 A : Type u_7 inst✝⁴ : Monoid A inst✝³ : SMul R A inst✝² : IsScalarTower R A A inst✝¹ : TopologicalSpace A inst✝ : ContinuousMul A q : R ⊢ Continuous fun x => q • x
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by
simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)]
/-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by
Mathlib.Topology.Algebra.Monoid.655_0.3p9EZf9ZWFxWOAq
/-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝⁸ : TopologicalSpace X inst✝⁷ : TopologicalSpace M inst✝⁶ : Monoid M inst✝⁵ : ContinuousMul M R : Type u_6 A : Type u_7 inst✝⁴ : Monoid A inst✝³ : SMul R A inst✝² : IsScalarTower R A A inst✝¹ : TopologicalSpace A inst✝ : ContinuousMul A q : R ⊢ Continuous fun x => q • 1 * x
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)]
exact continuous_const.mul continuous_id
/-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)]
Mathlib.Topology.Algebra.Monoid.655_0.3p9EZf9ZWFxWOAq
/-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝⁸ : TopologicalSpace X inst✝⁷ : TopologicalSpace M inst✝⁶ : Monoid M inst✝⁵ : ContinuousMul M R : Type u_6 A : Type u_7 inst✝⁴ : Monoid A inst✝³ : SMul R A inst✝² : SMulCommClass R A A inst✝¹ : TopologicalSpace A inst✝ : ContinuousMul A q : R ⊢ Continuous fun x => q • x
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by
simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)]
/-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by
Mathlib.Topology.Algebra.Monoid.669_0.3p9EZf9ZWFxWOAq
/-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝⁸ : TopologicalSpace X inst✝⁷ : TopologicalSpace M inst✝⁶ : Monoid M inst✝⁵ : ContinuousMul M R : Type u_6 A : Type u_7 inst✝⁴ : Monoid A inst✝³ : SMul R A inst✝² : SMulCommClass R A A inst✝¹ : TopologicalSpace A inst✝ : ContinuousMul A q : R ⊢ Continuous fun x => x * q • 1
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)]
exact continuous_id.mul continuous_const
/-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)]
Mathlib.Topology.Algebra.Monoid.669_0.3p9EZf9ZWFxWOAq
/-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : CommMonoid M inst✝ : ContinuousMul M f : ι → α → M x : Filter α a : ι → M s : Multiset ι ⊢ (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => Multiset.prod (Multiset.map (fun c => f c b) s)) x (𝓝 (Multiset.prod (Multiset.map a s)))
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by
rcases s with ⟨l⟩
@[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by
Mathlib.Topology.Algebra.Monoid.737_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod)
Mathlib_Topology_Algebra_Monoid
case mk ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : CommMonoid M inst✝ : ContinuousMul M f : ι → α → M x : Filter α a : ι → M s : Multiset ι l : List ι ⊢ (∀ i ∈ Quot.mk Setoid.r l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => Multiset.prod (Multiset.map (fun c => f c b) (Quot.mk Setoid.r l))) x (𝓝 (Multiset.prod (Multiset.map a (Quot.mk Setoid.r l))))
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩
simpa using tendsto_list_prod l
@[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩
Mathlib.Topology.Algebra.Monoid.737_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod)
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : CommMonoid M inst✝ : ContinuousMul M f : ι → X → M s : Multiset ι ⊢ (∀ i ∈ s, Continuous (f i)) → Continuous fun a => Multiset.prod (Multiset.map (fun i => f i a) s)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by
rcases s with ⟨l⟩
@[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by
Mathlib.Topology.Algebra.Monoid.754_0.3p9EZf9ZWFxWOAq
@[to_additive (attr
Mathlib_Topology_Algebra_Monoid
case mk ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : CommMonoid M inst✝ : ContinuousMul M f : ι → X → M s : Multiset ι l : List ι ⊢ (∀ i ∈ Quot.mk Setoid.r l, Continuous (f i)) → Continuous fun a => Multiset.prod (Multiset.map (fun i => f i a) (Quot.mk Setoid.r l))
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩
simpa using continuous_list_prod l
@[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩
Mathlib.Topology.Algebra.Monoid.754_0.3p9EZf9ZWFxWOAq
@[to_additive (attr
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : CommMonoid M inst✝ : ContinuousMul M f : ι → X → M s : Multiset ι t : Set X ⊢ (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => Multiset.prod (Multiset.map (fun i => f i a) s)) t
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by
rcases s with ⟨l⟩
@[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by
Mathlib.Topology.Algebra.Monoid.762_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t
Mathlib_Topology_Algebra_Monoid
case mk ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : CommMonoid M inst✝ : ContinuousMul M f : ι → X → M s : Multiset ι t : Set X l : List ι ⊢ (∀ i ∈ Quot.mk Setoid.r l, ContinuousOn (f i) t) → ContinuousOn (fun a => Multiset.prod (Multiset.map (fun i => f i a) (Quot.mk Setoid.r l))) t
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩
simpa using continuousOn_list_prod l
@[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩
Mathlib.Topology.Algebra.Monoid.762_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X✝ : Type u_5 inst✝⁴ : TopologicalSpace X✝ inst✝³ : TopologicalSpace M✝ inst✝² : CommMonoid M✝ inst✝¹ : ContinuousMul M✝ X : Type u_6 M : Type u_7 inst✝ : CommMonoid M s : Finset ι l : Filter X f g : ι → X → M hs : ∀ i ∈ s, f i =ᶠ[l] g i ⊢ ∏ i in s, f i =ᶠ[l] ∏ i in s, g i
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by
replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x
@[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by
Mathlib.Topology.Algebra.Monoid.784_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i
Mathlib_Topology_Algebra_Monoid
case hs ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X✝ : Type u_5 inst✝⁴ : TopologicalSpace X✝ inst✝³ : TopologicalSpace M✝ inst✝² : CommMonoid M✝ inst✝¹ : ContinuousMul M✝ X : Type u_6 M : Type u_7 inst✝ : CommMonoid M s : Finset ι l : Filter X f g : ι → X → M hs : ∀ i ∈ s, f i =ᶠ[l] g i ⊢ ∀ᶠ (x : X) in l, ∀ i ∈ s, f i x = g i x
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x ·
rwa [eventually_all_finset]
@[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x ·
Mathlib.Topology.Algebra.Monoid.784_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X✝ : Type u_5 inst✝⁴ : TopologicalSpace X✝ inst✝³ : TopologicalSpace M✝ inst✝² : CommMonoid M✝ inst✝¹ : ContinuousMul M✝ X : Type u_6 M : Type u_7 inst✝ : CommMonoid M s : Finset ι l : Filter X f g : ι → X → M hs : ∀ᶠ (x : X) in l, ∀ i ∈ s, f i x = g i x ⊢ ∏ i in s, f i =ᶠ[l] ∏ i in s, g i
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset]
filter_upwards [hs] with x hx
@[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset]
Mathlib.Topology.Algebra.Monoid.784_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i
Mathlib_Topology_Algebra_Monoid
case h ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X✝ : Type u_5 inst✝⁴ : TopologicalSpace X✝ inst✝³ : TopologicalSpace M✝ inst✝² : CommMonoid M✝ inst✝¹ : ContinuousMul M✝ X : Type u_6 M : Type u_7 inst✝ : CommMonoid M s : Finset ι l : Filter X f g : ι → X → M hs : ∀ᶠ (x : X) in l, ∀ i ∈ s, f i x = g i x x : X hx : ∀ i ∈ s, f i x = g i x ⊢ Finset.prod s (fun i => f i) x = Finset.prod s (fun i => g i) x
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx
simp only [Finset.prod_apply, Finset.prod_congr rfl hx]
@[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx
Mathlib.Topology.Algebra.Monoid.784_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁴ : TopologicalSpace X inst✝³ : TopologicalSpace M✝ inst✝² : CommMonoid M✝ inst✝¹ : ContinuousMul M✝ M : Type u_6 inst✝ : CommMonoid M f : ι → X → M hf : LocallyFinite fun i => mulSupport (f i) x₀ : X ⊢ ∃ I, ∀ᶠ (x : X) in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ ↑I
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by
rcases hf x₀ with ⟨U, hxU, hUf⟩
@[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by
Mathlib.Topology.Algebra.Monoid.796_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I
Mathlib_Topology_Algebra_Monoid
case intro.intro ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁴ : TopologicalSpace X inst✝³ : TopologicalSpace M✝ inst✝² : CommMonoid M✝ inst✝¹ : ContinuousMul M✝ M : Type u_6 inst✝ : CommMonoid M f : ι → X → M hf : LocallyFinite fun i => mulSupport (f i) x₀ : X U : Set X hxU : U ∈ 𝓝 x₀ hUf : Set.Finite {i | Set.Nonempty ((fun i => mulSupport (f i)) i ∩ U)} ⊢ ∃ I, ∀ᶠ (x : X) in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ ↑I
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩
refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩
@[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩
Mathlib.Topology.Algebra.Monoid.796_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I
Mathlib_Topology_Algebra_Monoid
case intro.intro ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁴ : TopologicalSpace X inst✝³ : TopologicalSpace M✝ inst✝² : CommMonoid M✝ inst✝¹ : ContinuousMul M✝ M : Type u_6 inst✝ : CommMonoid M f : ι → X → M hf : LocallyFinite fun i => mulSupport (f i) x₀ : X U : Set X hxU : U ∈ 𝓝 x₀ hUf : Set.Finite {i | Set.Nonempty ((fun i => mulSupport (f i)) i ∩ U)} y : X hy : y ∈ U i : ι hi : i ∈ mulSupport fun i => f i y ⊢ i ∈ ↑(Finite.toFinset hUf)
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩
rw [hUf.coe_toFinset]
@[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩
Mathlib.Topology.Algebra.Monoid.796_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I
Mathlib_Topology_Algebra_Monoid
case intro.intro ι : Type u_1 α : Type u_2 M✝ : Type u_3 N : Type u_4 X : Type u_5 inst✝⁴ : TopologicalSpace X inst✝³ : TopologicalSpace M✝ inst✝² : CommMonoid M✝ inst✝¹ : ContinuousMul M✝ M : Type u_6 inst✝ : CommMonoid M f : ι → X → M hf : LocallyFinite fun i => mulSupport (f i) x₀ : X U : Set X hxU : U ∈ 𝓝 x₀ hUf : Set.Finite {i | Set.Nonempty ((fun i => mulSupport (f i)) i ∩ U)} y : X hy : y ∈ U i : ι hi : i ∈ mulSupport fun i => f i y ⊢ i ∈ {i | Set.Nonempty ((fun i => mulSupport (f i)) i ∩ U)}
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩ rw [hUf.coe_toFinset]
exact ⟨y, hi, hy⟩
@[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩ rw [hUf.coe_toFinset]
Mathlib.Topology.Algebra.Monoid.796_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : CommMonoid M inst✝ : ContinuousMul M f : ι → X → M hc : ∀ (i : ι), Continuous (f i) hf : LocallyFinite fun i => mulSupport (f i) ⊢ Continuous fun x => ∏ᶠ (i : ι), f i x
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩ rw [hUf.coe_toFinset] exact ⟨y, hi, hy⟩ #align locally_finite.exists_finset_mul_support LocallyFinite.exists_finset_mulSupport #align locally_finite.exists_finset_support LocallyFinite.exists_finset_support @[to_additive] theorem finprod_eventually_eq_prod {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport (f i)) (x : X) : ∃ s : Finset ι, ∀ᶠ y in 𝓝 x, ∏ᶠ i, f i y = ∏ i in s, f i y := let ⟨I, hI⟩ := hf.exists_finset_mulSupport x ⟨I, hI.mono fun _ hy => finprod_eq_prod_of_mulSupport_subset _ fun _ hi => hy hi⟩ #align finprod_eventually_eq_prod finprod_eventually_eq_prod #align finsum_eventually_eq_sum finsum_eventually_eq_sum @[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by
refine' continuous_iff_continuousAt.2 fun x => _
@[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by
Mathlib.Topology.Algebra.Monoid.816_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : CommMonoid M inst✝ : ContinuousMul M f : ι → X → M hc : ∀ (i : ι), Continuous (f i) hf : LocallyFinite fun i => mulSupport (f i) x : X ⊢ ContinuousAt (fun x => ∏ᶠ (i : ι), f i x) x
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩ rw [hUf.coe_toFinset] exact ⟨y, hi, hy⟩ #align locally_finite.exists_finset_mul_support LocallyFinite.exists_finset_mulSupport #align locally_finite.exists_finset_support LocallyFinite.exists_finset_support @[to_additive] theorem finprod_eventually_eq_prod {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport (f i)) (x : X) : ∃ s : Finset ι, ∀ᶠ y in 𝓝 x, ∏ᶠ i, f i y = ∏ i in s, f i y := let ⟨I, hI⟩ := hf.exists_finset_mulSupport x ⟨I, hI.mono fun _ hy => finprod_eq_prod_of_mulSupport_subset _ fun _ hi => hy hi⟩ #align finprod_eventually_eq_prod finprod_eventually_eq_prod #align finsum_eventually_eq_sum finsum_eventually_eq_sum @[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by refine' continuous_iff_continuousAt.2 fun x => _
rcases finprod_eventually_eq_prod hf x with ⟨s, hs⟩
@[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by refine' continuous_iff_continuousAt.2 fun x => _
Mathlib.Topology.Algebra.Monoid.816_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x
Mathlib_Topology_Algebra_Monoid
case intro ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : CommMonoid M inst✝ : ContinuousMul M f : ι → X → M hc : ∀ (i : ι), Continuous (f i) hf : LocallyFinite fun i => mulSupport (f i) x : X s : Finset ι hs : ∀ᶠ (y : X) in 𝓝 x, ∏ᶠ (i : ι), f i y = ∏ i in s, f i y ⊢ ContinuousAt (fun x => ∏ᶠ (i : ι), f i x) x
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩ rw [hUf.coe_toFinset] exact ⟨y, hi, hy⟩ #align locally_finite.exists_finset_mul_support LocallyFinite.exists_finset_mulSupport #align locally_finite.exists_finset_support LocallyFinite.exists_finset_support @[to_additive] theorem finprod_eventually_eq_prod {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport (f i)) (x : X) : ∃ s : Finset ι, ∀ᶠ y in 𝓝 x, ∏ᶠ i, f i y = ∏ i in s, f i y := let ⟨I, hI⟩ := hf.exists_finset_mulSupport x ⟨I, hI.mono fun _ hy => finprod_eq_prod_of_mulSupport_subset _ fun _ hi => hy hi⟩ #align finprod_eventually_eq_prod finprod_eventually_eq_prod #align finsum_eventually_eq_sum finsum_eventually_eq_sum @[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by refine' continuous_iff_continuousAt.2 fun x => _ rcases finprod_eventually_eq_prod hf x with ⟨s, hs⟩
refine' ContinuousAt.congr _ (EventuallyEq.symm hs)
@[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by refine' continuous_iff_continuousAt.2 fun x => _ rcases finprod_eventually_eq_prod hf x with ⟨s, hs⟩
Mathlib.Topology.Algebra.Monoid.816_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x
Mathlib_Topology_Algebra_Monoid
case intro ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : CommMonoid M inst✝ : ContinuousMul M f : ι → X → M hc : ∀ (i : ι), Continuous (f i) hf : LocallyFinite fun i => mulSupport (f i) x : X s : Finset ι hs : ∀ᶠ (y : X) in 𝓝 x, ∏ᶠ (i : ι), f i y = ∏ i in s, f i y ⊢ ContinuousAt (fun x => ∏ i in s, f i x) x
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩ rw [hUf.coe_toFinset] exact ⟨y, hi, hy⟩ #align locally_finite.exists_finset_mul_support LocallyFinite.exists_finset_mulSupport #align locally_finite.exists_finset_support LocallyFinite.exists_finset_support @[to_additive] theorem finprod_eventually_eq_prod {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport (f i)) (x : X) : ∃ s : Finset ι, ∀ᶠ y in 𝓝 x, ∏ᶠ i, f i y = ∏ i in s, f i y := let ⟨I, hI⟩ := hf.exists_finset_mulSupport x ⟨I, hI.mono fun _ hy => finprod_eq_prod_of_mulSupport_subset _ fun _ hi => hy hi⟩ #align finprod_eventually_eq_prod finprod_eventually_eq_prod #align finsum_eventually_eq_sum finsum_eventually_eq_sum @[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by refine' continuous_iff_continuousAt.2 fun x => _ rcases finprod_eventually_eq_prod hf x with ⟨s, hs⟩ refine' ContinuousAt.congr _ (EventuallyEq.symm hs)
exact tendsto_finset_prod _ fun i _ => (hc i).continuousAt
@[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by refine' continuous_iff_continuousAt.2 fun x => _ rcases finprod_eventually_eq_prod hf x with ⟨s, hs⟩ refine' ContinuousAt.congr _ (EventuallyEq.symm hs)
Mathlib.Topology.Algebra.Monoid.816_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : CommMonoid M inst✝ : ContinuousMul M f : ι → X → M p : ι → Prop hc : ∀ (i : ι), p i → Continuous (f i) hf : LocallyFinite fun i => mulSupport (f i) ⊢ Continuous fun x => ∏ᶠ (i : ι) (_ : p i), f i x
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩ rw [hUf.coe_toFinset] exact ⟨y, hi, hy⟩ #align locally_finite.exists_finset_mul_support LocallyFinite.exists_finset_mulSupport #align locally_finite.exists_finset_support LocallyFinite.exists_finset_support @[to_additive] theorem finprod_eventually_eq_prod {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport (f i)) (x : X) : ∃ s : Finset ι, ∀ᶠ y in 𝓝 x, ∏ᶠ i, f i y = ∏ i in s, f i y := let ⟨I, hI⟩ := hf.exists_finset_mulSupport x ⟨I, hI.mono fun _ hy => finprod_eq_prod_of_mulSupport_subset _ fun _ hi => hy hi⟩ #align finprod_eventually_eq_prod finprod_eventually_eq_prod #align finsum_eventually_eq_sum finsum_eventually_eq_sum @[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by refine' continuous_iff_continuousAt.2 fun x => _ rcases finprod_eventually_eq_prod hf x with ⟨s, hs⟩ refine' ContinuousAt.congr _ (EventuallyEq.symm hs) exact tendsto_finset_prod _ fun i _ => (hc i).continuousAt #align continuous_finprod continuous_finprod #align continuous_finsum continuous_finsum @[to_additive] theorem continuous_finprod_cond {f : ι → X → M} {p : ι → Prop} (hc : ∀ i, p i → Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ (i) (_ : p i), f i x := by
simp only [← finprod_subtype_eq_finprod_cond]
@[to_additive] theorem continuous_finprod_cond {f : ι → X → M} {p : ι → Prop} (hc : ∀ i, p i → Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ (i) (_ : p i), f i x := by
Mathlib.Topology.Algebra.Monoid.826_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuous_finprod_cond {f : ι → X → M} {p : ι → Prop} (hc : ∀ i, p i → Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ (i) (_ : p i), f i x
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝³ : TopologicalSpace X inst✝² : TopologicalSpace M inst✝¹ : CommMonoid M inst✝ : ContinuousMul M f : ι → X → M p : ι → Prop hc : ∀ (i : ι), p i → Continuous (f i) hf : LocallyFinite fun i => mulSupport (f i) ⊢ Continuous fun x => ∏ᶠ (j : { i // p i }), f (↑j) x
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩ rw [hUf.coe_toFinset] exact ⟨y, hi, hy⟩ #align locally_finite.exists_finset_mul_support LocallyFinite.exists_finset_mulSupport #align locally_finite.exists_finset_support LocallyFinite.exists_finset_support @[to_additive] theorem finprod_eventually_eq_prod {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport (f i)) (x : X) : ∃ s : Finset ι, ∀ᶠ y in 𝓝 x, ∏ᶠ i, f i y = ∏ i in s, f i y := let ⟨I, hI⟩ := hf.exists_finset_mulSupport x ⟨I, hI.mono fun _ hy => finprod_eq_prod_of_mulSupport_subset _ fun _ hi => hy hi⟩ #align finprod_eventually_eq_prod finprod_eventually_eq_prod #align finsum_eventually_eq_sum finsum_eventually_eq_sum @[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by refine' continuous_iff_continuousAt.2 fun x => _ rcases finprod_eventually_eq_prod hf x with ⟨s, hs⟩ refine' ContinuousAt.congr _ (EventuallyEq.symm hs) exact tendsto_finset_prod _ fun i _ => (hc i).continuousAt #align continuous_finprod continuous_finprod #align continuous_finsum continuous_finsum @[to_additive] theorem continuous_finprod_cond {f : ι → X → M} {p : ι → Prop} (hc : ∀ i, p i → Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ (i) (_ : p i), f i x := by simp only [← finprod_subtype_eq_finprod_cond]
exact continuous_finprod (fun i => hc i i.2) (hf.comp_injective Subtype.coe_injective)
@[to_additive] theorem continuous_finprod_cond {f : ι → X → M} {p : ι → Prop} (hc : ∀ i, p i → Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ (i) (_ : p i), f i x := by simp only [← finprod_subtype_eq_finprod_cond]
Mathlib.Topology.Algebra.Monoid.826_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuous_finprod_cond {f : ι → X → M} {p : ι → Prop} (hc : ∀ i, p i → Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ (i) (_ : p i), f i x
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝¹ : TopologicalSpace X ι' : Sort u_6 inst✝ : Mul M ts : ι' → TopologicalSpace M h' : ∀ (i : ι'), ContinuousMul M ⊢ ContinuousMul M
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩ rw [hUf.coe_toFinset] exact ⟨y, hi, hy⟩ #align locally_finite.exists_finset_mul_support LocallyFinite.exists_finset_mulSupport #align locally_finite.exists_finset_support LocallyFinite.exists_finset_support @[to_additive] theorem finprod_eventually_eq_prod {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport (f i)) (x : X) : ∃ s : Finset ι, ∀ᶠ y in 𝓝 x, ∏ᶠ i, f i y = ∏ i in s, f i y := let ⟨I, hI⟩ := hf.exists_finset_mulSupport x ⟨I, hI.mono fun _ hy => finprod_eq_prod_of_mulSupport_subset _ fun _ hi => hy hi⟩ #align finprod_eventually_eq_prod finprod_eventually_eq_prod #align finsum_eventually_eq_sum finsum_eventually_eq_sum @[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by refine' continuous_iff_continuousAt.2 fun x => _ rcases finprod_eventually_eq_prod hf x with ⟨s, hs⟩ refine' ContinuousAt.congr _ (EventuallyEq.symm hs) exact tendsto_finset_prod _ fun i _ => (hc i).continuousAt #align continuous_finprod continuous_finprod #align continuous_finsum continuous_finsum @[to_additive] theorem continuous_finprod_cond {f : ι → X → M} {p : ι → Prop} (hc : ∀ i, p i → Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ (i) (_ : p i), f i x := by simp only [← finprod_subtype_eq_finprod_cond] exact continuous_finprod (fun i => hc i i.2) (hf.comp_injective Subtype.coe_injective) #align continuous_finprod_cond continuous_finprod_cond #align continuous_finsum_cond continuous_finsum_cond end instance [TopologicalSpace M] [Mul M] [ContinuousMul M] : ContinuousAdd (Additive M) where continuous_add := @continuous_mul M _ _ _ instance [TopologicalSpace M] [Add M] [ContinuousAdd M] : ContinuousMul (Multiplicative M) where continuous_mul := @continuous_add M _ _ _ section LatticeOps variable {ι' : Sort*} [Mul M] @[to_additive] theorem continuousMul_sInf {ts : Set (TopologicalSpace M)} (h : ∀ t ∈ ts, @ContinuousMul M t _) : @ContinuousMul M (sInf ts) _ := letI := sInf ts { continuous_mul := continuous_sInf_rng.2 fun t ht => continuous_sInf_dom₂ ht ht (@ContinuousMul.continuous_mul M t _ (h t ht)) } #align has_continuous_mul_Inf continuousMul_sInf #align has_continuous_add_Inf continuousAdd_sInf @[to_additive] theorem continuousMul_iInf {ts : ι' → TopologicalSpace M} (h' : ∀ i, @ContinuousMul M (ts i) _) : @ContinuousMul M (⨅ i, ts i) _ := by
rw [← sInf_range]
@[to_additive] theorem continuousMul_iInf {ts : ι' → TopologicalSpace M} (h' : ∀ i, @ContinuousMul M (ts i) _) : @ContinuousMul M (⨅ i, ts i) _ := by
Mathlib.Topology.Algebra.Monoid.857_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousMul_iInf {ts : ι' → TopologicalSpace M} (h' : ∀ i, @ContinuousMul M (ts i) _) : @ContinuousMul M (⨅ i, ts i) _
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝¹ : TopologicalSpace X ι' : Sort u_6 inst✝ : Mul M ts : ι' → TopologicalSpace M h' : ∀ (i : ι'), ContinuousMul M ⊢ ContinuousMul M
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩ rw [hUf.coe_toFinset] exact ⟨y, hi, hy⟩ #align locally_finite.exists_finset_mul_support LocallyFinite.exists_finset_mulSupport #align locally_finite.exists_finset_support LocallyFinite.exists_finset_support @[to_additive] theorem finprod_eventually_eq_prod {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport (f i)) (x : X) : ∃ s : Finset ι, ∀ᶠ y in 𝓝 x, ∏ᶠ i, f i y = ∏ i in s, f i y := let ⟨I, hI⟩ := hf.exists_finset_mulSupport x ⟨I, hI.mono fun _ hy => finprod_eq_prod_of_mulSupport_subset _ fun _ hi => hy hi⟩ #align finprod_eventually_eq_prod finprod_eventually_eq_prod #align finsum_eventually_eq_sum finsum_eventually_eq_sum @[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by refine' continuous_iff_continuousAt.2 fun x => _ rcases finprod_eventually_eq_prod hf x with ⟨s, hs⟩ refine' ContinuousAt.congr _ (EventuallyEq.symm hs) exact tendsto_finset_prod _ fun i _ => (hc i).continuousAt #align continuous_finprod continuous_finprod #align continuous_finsum continuous_finsum @[to_additive] theorem continuous_finprod_cond {f : ι → X → M} {p : ι → Prop} (hc : ∀ i, p i → Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ (i) (_ : p i), f i x := by simp only [← finprod_subtype_eq_finprod_cond] exact continuous_finprod (fun i => hc i i.2) (hf.comp_injective Subtype.coe_injective) #align continuous_finprod_cond continuous_finprod_cond #align continuous_finsum_cond continuous_finsum_cond end instance [TopologicalSpace M] [Mul M] [ContinuousMul M] : ContinuousAdd (Additive M) where continuous_add := @continuous_mul M _ _ _ instance [TopologicalSpace M] [Add M] [ContinuousAdd M] : ContinuousMul (Multiplicative M) where continuous_mul := @continuous_add M _ _ _ section LatticeOps variable {ι' : Sort*} [Mul M] @[to_additive] theorem continuousMul_sInf {ts : Set (TopologicalSpace M)} (h : ∀ t ∈ ts, @ContinuousMul M t _) : @ContinuousMul M (sInf ts) _ := letI := sInf ts { continuous_mul := continuous_sInf_rng.2 fun t ht => continuous_sInf_dom₂ ht ht (@ContinuousMul.continuous_mul M t _ (h t ht)) } #align has_continuous_mul_Inf continuousMul_sInf #align has_continuous_add_Inf continuousAdd_sInf @[to_additive] theorem continuousMul_iInf {ts : ι' → TopologicalSpace M} (h' : ∀ i, @ContinuousMul M (ts i) _) : @ContinuousMul M (⨅ i, ts i) _ := by rw [← sInf_range]
exact continuousMul_sInf (Set.forall_range_iff.mpr h')
@[to_additive] theorem continuousMul_iInf {ts : ι' → TopologicalSpace M} (h' : ∀ i, @ContinuousMul M (ts i) _) : @ContinuousMul M (⨅ i, ts i) _ := by rw [← sInf_range]
Mathlib.Topology.Algebra.Monoid.857_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousMul_iInf {ts : ι' → TopologicalSpace M} (h' : ∀ i, @ContinuousMul M (ts i) _) : @ContinuousMul M (⨅ i, ts i) _
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝¹ : TopologicalSpace X ι' : Sort u_6 inst✝ : Mul M t₁ t₂ : TopologicalSpace M h₁ : ContinuousMul M h₂ : ContinuousMul M ⊢ ContinuousMul M
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩ rw [hUf.coe_toFinset] exact ⟨y, hi, hy⟩ #align locally_finite.exists_finset_mul_support LocallyFinite.exists_finset_mulSupport #align locally_finite.exists_finset_support LocallyFinite.exists_finset_support @[to_additive] theorem finprod_eventually_eq_prod {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport (f i)) (x : X) : ∃ s : Finset ι, ∀ᶠ y in 𝓝 x, ∏ᶠ i, f i y = ∏ i in s, f i y := let ⟨I, hI⟩ := hf.exists_finset_mulSupport x ⟨I, hI.mono fun _ hy => finprod_eq_prod_of_mulSupport_subset _ fun _ hi => hy hi⟩ #align finprod_eventually_eq_prod finprod_eventually_eq_prod #align finsum_eventually_eq_sum finsum_eventually_eq_sum @[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by refine' continuous_iff_continuousAt.2 fun x => _ rcases finprod_eventually_eq_prod hf x with ⟨s, hs⟩ refine' ContinuousAt.congr _ (EventuallyEq.symm hs) exact tendsto_finset_prod _ fun i _ => (hc i).continuousAt #align continuous_finprod continuous_finprod #align continuous_finsum continuous_finsum @[to_additive] theorem continuous_finprod_cond {f : ι → X → M} {p : ι → Prop} (hc : ∀ i, p i → Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ (i) (_ : p i), f i x := by simp only [← finprod_subtype_eq_finprod_cond] exact continuous_finprod (fun i => hc i i.2) (hf.comp_injective Subtype.coe_injective) #align continuous_finprod_cond continuous_finprod_cond #align continuous_finsum_cond continuous_finsum_cond end instance [TopologicalSpace M] [Mul M] [ContinuousMul M] : ContinuousAdd (Additive M) where continuous_add := @continuous_mul M _ _ _ instance [TopologicalSpace M] [Add M] [ContinuousAdd M] : ContinuousMul (Multiplicative M) where continuous_mul := @continuous_add M _ _ _ section LatticeOps variable {ι' : Sort*} [Mul M] @[to_additive] theorem continuousMul_sInf {ts : Set (TopologicalSpace M)} (h : ∀ t ∈ ts, @ContinuousMul M t _) : @ContinuousMul M (sInf ts) _ := letI := sInf ts { continuous_mul := continuous_sInf_rng.2 fun t ht => continuous_sInf_dom₂ ht ht (@ContinuousMul.continuous_mul M t _ (h t ht)) } #align has_continuous_mul_Inf continuousMul_sInf #align has_continuous_add_Inf continuousAdd_sInf @[to_additive] theorem continuousMul_iInf {ts : ι' → TopologicalSpace M} (h' : ∀ i, @ContinuousMul M (ts i) _) : @ContinuousMul M (⨅ i, ts i) _ := by rw [← sInf_range] exact continuousMul_sInf (Set.forall_range_iff.mpr h') #align has_continuous_mul_infi continuousMul_iInf #align has_continuous_add_infi continuousAdd_iInf @[to_additive] theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _) (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _ := by
rw [inf_eq_iInf]
@[to_additive] theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _) (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _ := by
Mathlib.Topology.Algebra.Monoid.865_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _) (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝¹ : TopologicalSpace X ι' : Sort u_6 inst✝ : Mul M t₁ t₂ : TopologicalSpace M h₁ : ContinuousMul M h₂ : ContinuousMul M ⊢ ContinuousMul M
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩ rw [hUf.coe_toFinset] exact ⟨y, hi, hy⟩ #align locally_finite.exists_finset_mul_support LocallyFinite.exists_finset_mulSupport #align locally_finite.exists_finset_support LocallyFinite.exists_finset_support @[to_additive] theorem finprod_eventually_eq_prod {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport (f i)) (x : X) : ∃ s : Finset ι, ∀ᶠ y in 𝓝 x, ∏ᶠ i, f i y = ∏ i in s, f i y := let ⟨I, hI⟩ := hf.exists_finset_mulSupport x ⟨I, hI.mono fun _ hy => finprod_eq_prod_of_mulSupport_subset _ fun _ hi => hy hi⟩ #align finprod_eventually_eq_prod finprod_eventually_eq_prod #align finsum_eventually_eq_sum finsum_eventually_eq_sum @[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by refine' continuous_iff_continuousAt.2 fun x => _ rcases finprod_eventually_eq_prod hf x with ⟨s, hs⟩ refine' ContinuousAt.congr _ (EventuallyEq.symm hs) exact tendsto_finset_prod _ fun i _ => (hc i).continuousAt #align continuous_finprod continuous_finprod #align continuous_finsum continuous_finsum @[to_additive] theorem continuous_finprod_cond {f : ι → X → M} {p : ι → Prop} (hc : ∀ i, p i → Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ (i) (_ : p i), f i x := by simp only [← finprod_subtype_eq_finprod_cond] exact continuous_finprod (fun i => hc i i.2) (hf.comp_injective Subtype.coe_injective) #align continuous_finprod_cond continuous_finprod_cond #align continuous_finsum_cond continuous_finsum_cond end instance [TopologicalSpace M] [Mul M] [ContinuousMul M] : ContinuousAdd (Additive M) where continuous_add := @continuous_mul M _ _ _ instance [TopologicalSpace M] [Add M] [ContinuousAdd M] : ContinuousMul (Multiplicative M) where continuous_mul := @continuous_add M _ _ _ section LatticeOps variable {ι' : Sort*} [Mul M] @[to_additive] theorem continuousMul_sInf {ts : Set (TopologicalSpace M)} (h : ∀ t ∈ ts, @ContinuousMul M t _) : @ContinuousMul M (sInf ts) _ := letI := sInf ts { continuous_mul := continuous_sInf_rng.2 fun t ht => continuous_sInf_dom₂ ht ht (@ContinuousMul.continuous_mul M t _ (h t ht)) } #align has_continuous_mul_Inf continuousMul_sInf #align has_continuous_add_Inf continuousAdd_sInf @[to_additive] theorem continuousMul_iInf {ts : ι' → TopologicalSpace M} (h' : ∀ i, @ContinuousMul M (ts i) _) : @ContinuousMul M (⨅ i, ts i) _ := by rw [← sInf_range] exact continuousMul_sInf (Set.forall_range_iff.mpr h') #align has_continuous_mul_infi continuousMul_iInf #align has_continuous_add_infi continuousAdd_iInf @[to_additive] theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _) (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _ := by rw [inf_eq_iInf]
refine' continuousMul_iInf fun b => _
@[to_additive] theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _) (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _ := by rw [inf_eq_iInf]
Mathlib.Topology.Algebra.Monoid.865_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _) (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _
Mathlib_Topology_Algebra_Monoid
ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝¹ : TopologicalSpace X ι' : Sort u_6 inst✝ : Mul M t₁ t₂ : TopologicalSpace M h₁ : ContinuousMul M h₂ : ContinuousMul M b : Bool ⊢ ContinuousMul M
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩ rw [hUf.coe_toFinset] exact ⟨y, hi, hy⟩ #align locally_finite.exists_finset_mul_support LocallyFinite.exists_finset_mulSupport #align locally_finite.exists_finset_support LocallyFinite.exists_finset_support @[to_additive] theorem finprod_eventually_eq_prod {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport (f i)) (x : X) : ∃ s : Finset ι, ∀ᶠ y in 𝓝 x, ∏ᶠ i, f i y = ∏ i in s, f i y := let ⟨I, hI⟩ := hf.exists_finset_mulSupport x ⟨I, hI.mono fun _ hy => finprod_eq_prod_of_mulSupport_subset _ fun _ hi => hy hi⟩ #align finprod_eventually_eq_prod finprod_eventually_eq_prod #align finsum_eventually_eq_sum finsum_eventually_eq_sum @[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by refine' continuous_iff_continuousAt.2 fun x => _ rcases finprod_eventually_eq_prod hf x with ⟨s, hs⟩ refine' ContinuousAt.congr _ (EventuallyEq.symm hs) exact tendsto_finset_prod _ fun i _ => (hc i).continuousAt #align continuous_finprod continuous_finprod #align continuous_finsum continuous_finsum @[to_additive] theorem continuous_finprod_cond {f : ι → X → M} {p : ι → Prop} (hc : ∀ i, p i → Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ (i) (_ : p i), f i x := by simp only [← finprod_subtype_eq_finprod_cond] exact continuous_finprod (fun i => hc i i.2) (hf.comp_injective Subtype.coe_injective) #align continuous_finprod_cond continuous_finprod_cond #align continuous_finsum_cond continuous_finsum_cond end instance [TopologicalSpace M] [Mul M] [ContinuousMul M] : ContinuousAdd (Additive M) where continuous_add := @continuous_mul M _ _ _ instance [TopologicalSpace M] [Add M] [ContinuousAdd M] : ContinuousMul (Multiplicative M) where continuous_mul := @continuous_add M _ _ _ section LatticeOps variable {ι' : Sort*} [Mul M] @[to_additive] theorem continuousMul_sInf {ts : Set (TopologicalSpace M)} (h : ∀ t ∈ ts, @ContinuousMul M t _) : @ContinuousMul M (sInf ts) _ := letI := sInf ts { continuous_mul := continuous_sInf_rng.2 fun t ht => continuous_sInf_dom₂ ht ht (@ContinuousMul.continuous_mul M t _ (h t ht)) } #align has_continuous_mul_Inf continuousMul_sInf #align has_continuous_add_Inf continuousAdd_sInf @[to_additive] theorem continuousMul_iInf {ts : ι' → TopologicalSpace M} (h' : ∀ i, @ContinuousMul M (ts i) _) : @ContinuousMul M (⨅ i, ts i) _ := by rw [← sInf_range] exact continuousMul_sInf (Set.forall_range_iff.mpr h') #align has_continuous_mul_infi continuousMul_iInf #align has_continuous_add_infi continuousAdd_iInf @[to_additive] theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _) (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _ := by rw [inf_eq_iInf] refine' continuousMul_iInf fun b => _
cases b
@[to_additive] theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _) (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _ := by rw [inf_eq_iInf] refine' continuousMul_iInf fun b => _
Mathlib.Topology.Algebra.Monoid.865_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _) (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _
Mathlib_Topology_Algebra_Monoid
case false ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝¹ : TopologicalSpace X ι' : Sort u_6 inst✝ : Mul M t₁ t₂ : TopologicalSpace M h₁ : ContinuousMul M h₂ : ContinuousMul M ⊢ ContinuousMul M
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩ rw [hUf.coe_toFinset] exact ⟨y, hi, hy⟩ #align locally_finite.exists_finset_mul_support LocallyFinite.exists_finset_mulSupport #align locally_finite.exists_finset_support LocallyFinite.exists_finset_support @[to_additive] theorem finprod_eventually_eq_prod {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport (f i)) (x : X) : ∃ s : Finset ι, ∀ᶠ y in 𝓝 x, ∏ᶠ i, f i y = ∏ i in s, f i y := let ⟨I, hI⟩ := hf.exists_finset_mulSupport x ⟨I, hI.mono fun _ hy => finprod_eq_prod_of_mulSupport_subset _ fun _ hi => hy hi⟩ #align finprod_eventually_eq_prod finprod_eventually_eq_prod #align finsum_eventually_eq_sum finsum_eventually_eq_sum @[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by refine' continuous_iff_continuousAt.2 fun x => _ rcases finprod_eventually_eq_prod hf x with ⟨s, hs⟩ refine' ContinuousAt.congr _ (EventuallyEq.symm hs) exact tendsto_finset_prod _ fun i _ => (hc i).continuousAt #align continuous_finprod continuous_finprod #align continuous_finsum continuous_finsum @[to_additive] theorem continuous_finprod_cond {f : ι → X → M} {p : ι → Prop} (hc : ∀ i, p i → Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ (i) (_ : p i), f i x := by simp only [← finprod_subtype_eq_finprod_cond] exact continuous_finprod (fun i => hc i i.2) (hf.comp_injective Subtype.coe_injective) #align continuous_finprod_cond continuous_finprod_cond #align continuous_finsum_cond continuous_finsum_cond end instance [TopologicalSpace M] [Mul M] [ContinuousMul M] : ContinuousAdd (Additive M) where continuous_add := @continuous_mul M _ _ _ instance [TopologicalSpace M] [Add M] [ContinuousAdd M] : ContinuousMul (Multiplicative M) where continuous_mul := @continuous_add M _ _ _ section LatticeOps variable {ι' : Sort*} [Mul M] @[to_additive] theorem continuousMul_sInf {ts : Set (TopologicalSpace M)} (h : ∀ t ∈ ts, @ContinuousMul M t _) : @ContinuousMul M (sInf ts) _ := letI := sInf ts { continuous_mul := continuous_sInf_rng.2 fun t ht => continuous_sInf_dom₂ ht ht (@ContinuousMul.continuous_mul M t _ (h t ht)) } #align has_continuous_mul_Inf continuousMul_sInf #align has_continuous_add_Inf continuousAdd_sInf @[to_additive] theorem continuousMul_iInf {ts : ι' → TopologicalSpace M} (h' : ∀ i, @ContinuousMul M (ts i) _) : @ContinuousMul M (⨅ i, ts i) _ := by rw [← sInf_range] exact continuousMul_sInf (Set.forall_range_iff.mpr h') #align has_continuous_mul_infi continuousMul_iInf #align has_continuous_add_infi continuousAdd_iInf @[to_additive] theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _) (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _ := by rw [inf_eq_iInf] refine' continuousMul_iInf fun b => _ cases b <;>
assumption
@[to_additive] theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _) (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _ := by rw [inf_eq_iInf] refine' continuousMul_iInf fun b => _ cases b <;>
Mathlib.Topology.Algebra.Monoid.865_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _) (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _
Mathlib_Topology_Algebra_Monoid
case true ι : Type u_1 α : Type u_2 M : Type u_3 N : Type u_4 X : Type u_5 inst✝¹ : TopologicalSpace X ι' : Sort u_6 inst✝ : Mul M t₁ t₂ : TopologicalSpace M h₁ : ContinuousMul M h₂ : ContinuousMul M ⊢ ContinuousMul M
/- Copyright (c) 2017 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Mario Carneiro -/ import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Order.Filter.Pointwise import Mathlib.Topology.Algebra.MulAction import Mathlib.Algebra.BigOperators.Pi import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.algebra.monoid from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" /-! # Theory of topological monoids In this file we define mixin classes `ContinuousMul` and `ContinuousAdd`. While in many applications the underlying type is a monoid (multiplicative or additive), we do not require this in the definitions. -/ universe u v open Classical Set Filter TopologicalSpace open Classical Topology BigOperators Pointwise variable {ι α M N X : Type*} [TopologicalSpace X] @[to_additive (attr := continuity)] theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M) := @continuous_const _ _ _ _ 1 #align continuous_one continuous_one #align continuous_zero continuous_zero /-- Basic hypothesis to talk about a topological additive monoid or a topological additive semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the instances `AddMonoid M` and `ContinuousAdd M`. Continuity in only the left/right argument can be stated using `ContinuousConstVAdd α α`/`ContinuousConstVAdd αᵐᵒᵖ α`. -/ class ContinuousAdd (M : Type u) [TopologicalSpace M] [Add M] : Prop where continuous_add : Continuous fun p : M × M => p.1 + p.2 #align has_continuous_add ContinuousAdd /-- Basic hypothesis to talk about a topological monoid or a topological semigroup. A topological monoid over `M`, for example, is obtained by requiring both the instances `Monoid M` and `ContinuousMul M`. Continuity in only the left/right argument can be stated using `ContinuousConstSMul α α`/`ContinuousConstSMul αᵐᵒᵖ α`. -/ @[to_additive] class ContinuousMul (M : Type u) [TopologicalSpace M] [Mul M] : Prop where continuous_mul : Continuous fun p : M × M => p.1 * p.2 #align has_continuous_mul ContinuousMul section ContinuousMul variable [TopologicalSpace M] [Mul M] [ContinuousMul M] @[to_additive] instance : ContinuousMul Mᵒᵈ := ‹ContinuousMul M› @[to_additive (attr := continuity)] theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2 := ContinuousMul.continuous_mul #align continuous_mul continuous_mul #align continuous_add continuous_add @[to_additive] instance ContinuousMul.to_continuousSMul : ContinuousSMul M M := ⟨continuous_mul⟩ #align has_continuous_mul.to_has_continuous_smul ContinuousMul.to_continuousSMul #align has_continuous_add.to_has_continuous_vadd ContinuousAdd.to_continuousVAdd @[to_additive] instance ContinuousMul.to_continuousSMul_op : ContinuousSMul Mᵐᵒᵖ M := ⟨show Continuous ((fun p : M × M => p.1 * p.2) ∘ Prod.swap ∘ Prod.map MulOpposite.unop id) from continuous_mul.comp <| continuous_swap.comp <| Continuous.prod_map MulOpposite.continuous_unop continuous_id⟩ #align has_continuous_mul.to_has_continuous_smul_op ContinuousMul.to_continuousSMul_op #align has_continuous_add.to_has_continuous_vadd_op ContinuousAdd.to_continuousVAdd_op @[to_additive (attr := continuity)] theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x * g x := continuous_mul.comp (hf.prod_mk hg : _) #align continuous.mul Continuous.mul #align continuous.add Continuous.add @[to_additive (attr := continuity)] theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b := continuous_const.mul continuous_id #align continuous_mul_left continuous_mul_left #align continuous_add_left continuous_add_left @[to_additive (attr := continuity)] theorem continuous_mul_right (a : M) : Continuous fun b : M => b * a := continuous_id.mul continuous_const #align continuous_mul_right continuous_mul_right #align continuous_add_right continuous_add_right @[to_additive] theorem ContinuousOn.mul {f g : X → M} {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) : ContinuousOn (fun x => f x * g x) s := (continuous_mul.comp_continuousOn (hf.prod hg) : _) #align continuous_on.mul ContinuousOn.mul #align continuous_on.add ContinuousOn.add @[to_additive] theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) := continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b) #align tendsto_mul tendsto_mul #align tendsto_add tendsto_add @[to_additive] theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b)) := tendsto_mul.comp (hf.prod_mk_nhds hg) #align filter.tendsto.mul Filter.Tendsto.mul #align filter.tendsto.add Filter.Tendsto.add @[to_additive] theorem Filter.Tendsto.const_mul (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => b * f k) l (𝓝 (b * c)) := tendsto_const_nhds.mul h #align filter.tendsto.const_mul Filter.Tendsto.const_mul #align filter.tendsto.const_add Filter.Tendsto.const_add @[to_additive] theorem Filter.Tendsto.mul_const (b : M) {c : M} {f : α → M} {l : Filter α} (h : Tendsto (fun k : α => f k) l (𝓝 c)) : Tendsto (fun k : α => f k * b) l (𝓝 (c * b)) := h.mul tendsto_const_nhds #align filter.tendsto.mul_const Filter.Tendsto.mul_const #align filter.tendsto.add_const Filter.Tendsto.add_const @[to_additive] theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b) := by rw [← map₂_mul, ← map_uncurry_prod, ← nhds_prod_eq] exact continuous_mul.tendsto _ #align le_nhds_mul le_nhds_mul #align le_nhds_add le_nhds_add @[to_additive (attr := simp)] theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 (1 : M) * 𝓝 a = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (one_mul a)).antisymm <| le_mul_of_one_le_left' <| pure_le_nhds 1 #align nhds_one_mul_nhds nhds_one_mul_nhds #align nhds_zero_add_nhds nhds_zero_add_nhds @[to_additive (attr := simp)] theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) : 𝓝 a * 𝓝 1 = 𝓝 a := ((le_nhds_mul _ _).trans_eq <| congr_arg _ (mul_one a)).antisymm <| le_mul_of_one_le_right' <| pure_le_nhds 1 #align nhds_mul_nhds_one nhds_mul_nhds_one #align nhds_add_nhds_zero nhds_add_nhds_zero section tendsto_nhds variable {𝕜 : Type*} [Preorder 𝕜] [Zero 𝕜] [Mul 𝕜] [TopologicalSpace 𝕜] [ContinuousMul 𝕜] {l : Filter α} {f : α → 𝕜} {b c : 𝕜} (hb : 0 < b) theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Ioi.const_mul Filter.TendstoNhdsWithinIoi.const_mul theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).const_mul b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_left hb).mpr #align filter.tendsto_nhds_within_Iio.const_mul Filter.TendstoNhdsWithinIio.const_mul theorem Filter.TendstoNhdsWithinIoi.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => f a * b) l (𝓝[>] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Ioi.mul_const Filter.TendstoNhdsWithinIoi.mul_const theorem Filter.TendstoNhdsWithinIio.mul_const [MulPosStrictMono 𝕜] [MulPosReflectLT 𝕜] (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => f a * b) l (𝓝[<] (c * b)) := tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ((tendsto_nhds_of_tendsto_nhdsWithin h).mul_const b) <| (tendsto_nhdsWithin_iff.mp h).2.mono fun _ => (mul_lt_mul_right hb).mpr #align filter.tendsto_nhds_within_Iio.mul_const Filter.TendstoNhdsWithinIio.mul_const end tendsto_nhds /-- Construct a unit from limits of units and their inverses. -/ @[to_additive (attr := simps) "Construct an additive unit from limits of additive units and their negatives."] def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N] {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁)) (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ where val := r₁ inv := r₂ val_inv := by symm simpa using h₁.mul h₂ inv_val := by symm simpa using h₂.mul h₁ #align filter.tendsto.units Filter.Tendsto.units #align filter.tendsto.add_units Filter.Tendsto.addUnits @[to_additive] theorem ContinuousAt.mul {f g : X → M} {x : X} (hf : ContinuousAt f x) (hg : ContinuousAt g x) : ContinuousAt (fun x => f x * g x) x := Filter.Tendsto.mul hf hg #align continuous_at.mul ContinuousAt.mul #align continuous_at.add ContinuousAt.add @[to_additive] theorem ContinuousWithinAt.mul {f g : X → M} {s : Set X} {x : X} (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x => f x * g x) s x := Filter.Tendsto.mul hf hg #align continuous_within_at.mul ContinuousWithinAt.mul #align continuous_within_at.add ContinuousWithinAt.add @[to_additive] instance Prod.continuousMul [TopologicalSpace N] [Mul N] [ContinuousMul N] : ContinuousMul (M × N) := ⟨(continuous_fst.fst'.mul continuous_fst.snd').prod_mk (continuous_snd.fst'.mul continuous_snd.snd')⟩ @[to_additive] instance Pi.continuousMul {C : ι → Type*} [∀ i, TopologicalSpace (C i)] [∀ i, Mul (C i)] [∀ i, ContinuousMul (C i)] : ContinuousMul (∀ i, C i) where continuous_mul := continuous_pi fun i => (continuous_apply i).fst'.mul (continuous_apply i).snd' #align pi.has_continuous_mul Pi.continuousMul #align pi.has_continuous_add Pi.continuousAdd /-- A version of `Pi.continuousMul` for non-dependent functions. It is needed because sometimes Lean 3 fails to use `Pi.continuousMul` for non-dependent functions. -/ @[to_additive "A version of `Pi.continuousAdd` for non-dependent functions. It is needed because sometimes Lean fails to use `Pi.continuousAdd` for non-dependent functions."] instance Pi.continuousMul' : ContinuousMul (ι → M) := Pi.continuousMul #align pi.has_continuous_mul' Pi.continuousMul' #align pi.has_continuous_add' Pi.continuousAdd' @[to_additive] instance (priority := 100) continuousMul_of_discreteTopology [TopologicalSpace N] [Mul N] [DiscreteTopology N] : ContinuousMul N := ⟨continuous_of_discreteTopology⟩ #align has_continuous_mul_of_discrete_topology continuousMul_of_discreteTopology #align has_continuous_add_of_discrete_topology continuousAdd_of_discreteTopology open Filter open Function @[to_additive] theorem ContinuousMul.of_nhds_one {M : Type u} [Monoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) <| 𝓝 1) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) (hright : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x * x₀) (𝓝 1)) : ContinuousMul M := ⟨by rw [continuous_iff_continuousAt] rintro ⟨x₀, y₀⟩ have key : (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) = ((fun x => x₀ * x) ∘ fun x => x * y₀) ∘ uncurry (· * ·) := by ext p simp [uncurry, mul_assoc] have key₂ : ((fun x => x₀ * x) ∘ fun x => y₀ * x) = fun x => x₀ * y₀ * x := by ext x simp [mul_assoc] calc map (uncurry (· * ·)) (𝓝 (x₀, y₀)) = map (uncurry (· * ·)) (𝓝 x₀ ×ˢ 𝓝 y₀) := by rw [nhds_prod_eq] _ = map (fun p : M × M => x₀ * p.1 * (p.2 * y₀)) (𝓝 1 ×ˢ 𝓝 1) := by -- Porting note: `rw` was able to prove this -- Now it fails with `failed to rewrite using equation theorems for 'Function.uncurry'` -- and `failed to rewrite using equation theorems for 'Function.comp'`. -- Removing those two lemmas, the `rw` would succeed, but then needs a `rfl`. simp (config := { unfoldPartialApp := true }) only [uncurry] simp_rw [hleft x₀, hright y₀, prod_map_map_eq, Filter.map_map, Function.comp_def] _ = map ((fun x => x₀ * x) ∘ fun x => x * y₀) (map (uncurry (· * ·)) (𝓝 1 ×ˢ 𝓝 1)) := by rw [key, ← Filter.map_map] _ ≤ map ((fun x : M => x₀ * x) ∘ fun x => x * y₀) (𝓝 1) := map_mono hmul _ = 𝓝 (x₀ * y₀) := by rw [← Filter.map_map, ← hright, hleft y₀, Filter.map_map, key₂, ← hleft]⟩ #align has_continuous_mul.of_nhds_one ContinuousMul.of_nhds_one #align has_continuous_add.of_nhds_zero ContinuousAdd.of_nhds_zero @[to_additive] theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M] (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1)) (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M := by apply ContinuousMul.of_nhds_one hmul hleft intro x₀ simp_rw [mul_comm, hleft x₀] #align has_continuous_mul_of_comm_of_nhds_one continuousMul_of_comm_of_nhds_one #align has_continuous_add_of_comm_of_nhds_zero continuousAdd_of_comm_of_nhds_zero end ContinuousMul section PointwiseLimits variable (M₁ M₂ : Type*) [TopologicalSpace M₂] [T2Space M₂] @[to_additive] theorem isClosed_setOf_map_one [One M₁] [One M₂] : IsClosed { f : M₁ → M₂ | f 1 = 1 } := isClosed_eq (continuous_apply 1) continuous_const #align is_closed_set_of_map_one isClosed_setOf_map_one #align is_closed_set_of_map_zero isClosed_setOf_map_zero @[to_additive] theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] : IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y } := by simp only [setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun y => isClosed_eq (continuous_apply _) -- Porting note: proof was: -- `((continuous_apply _).mul (continuous_apply _))` (by continuity) #align is_closed_set_of_map_mul isClosed_setOf_map_mul #align is_closed_set_of_map_add isClosed_setOf_map_add -- porting note: split variables command over two lines, can't change explicitness at the same time -- as declaring new variables. variable {M₁ M₂} variable [MulOneClass M₁] [MulOneClass M₂] [ContinuousMul M₂] {F : Type*} [MonoidHomClass F M₁ M₂] {l : Filter α} /-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/ @[to_additive (attr := simps (config := .asFn)) "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f` and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."] def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂) (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂ where toFun := f map_one' := (isClosed_setOf_map_one M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_one) hf map_mul' := (isClosed_setOf_map_mul M₁ M₂).closure_subset_iff.2 (range_subset_iff.2 map_mul) hf #align monoid_hom_of_mem_closure_range_coe monoidHomOfMemClosureRangeCoe #align add_monoid_hom_of_mem_closure_range_coe addMonoidHomOfMemClosureRangeCoe /-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/ @[to_additive (attr := simps! (config := .asFn)) "Construct a bundled additive monoid homomorphism from a pointwise limit of additive monoid homomorphisms"] def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot] (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂ := monoidHomOfMemClosureRangeCoe f <| mem_closure_of_tendsto h <| eventually_of_forall fun _ => mem_range_self _ #align monoid_hom_of_tendsto monoidHomOfTendsto #align add_monoid_hom_of_tendsto addMonoidHomOfTendsto variable (M₁ M₂) @[to_additive] theorem MonoidHom.isClosed_range_coe : IsClosed (Set.range ((↑) : (M₁ →* M₂) → M₁ → M₂)) := isClosed_of_closure_subset fun f hf => ⟨monoidHomOfMemClosureRangeCoe f hf, rfl⟩ #align monoid_hom.is_closed_range_coe MonoidHom.isClosed_range_coe #align add_monoid_hom.is_closed_range_coe AddMonoidHom.isClosed_range_coe end PointwiseLimits @[to_additive] theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) : ContinuousMul M := ⟨hf.continuous_iff.2 <| by simpa only [(· ∘ ·), map_mul f] using hf.continuous.fst'.mul hf.continuous.snd'⟩ #align inducing.has_continuous_mul Inducing.continuousMul #align inducing.has_continuous_add Inducing.continuousAdd @[to_additive] theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [MulHomClass F M N] [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _ := letI := induced f ‹_› Inducing.continuousMul f ⟨rfl⟩ #align has_continuous_mul_induced continuousMul_induced #align has_continuous_add_induced continuousAdd_induced @[to_additive] instance Subsemigroup.continuousMul [TopologicalSpace M] [Semigroup M] [ContinuousMul M] (S : Subsemigroup M) : ContinuousMul S := Inducing.continuousMul ({ toFun := (↑), map_mul' := fun _ _ => rfl} : MulHom S M) ⟨rfl⟩ #align subsemigroup.has_continuous_mul Subsemigroup.continuousMul #align add_subsemigroup.has_continuous_add AddSubsemigroup.continuousAdd @[to_additive] instance Submonoid.continuousMul [TopologicalSpace M] [Monoid M] [ContinuousMul M] (S : Submonoid M) : ContinuousMul S := S.toSubsemigroup.continuousMul #align submonoid.has_continuous_mul Submonoid.continuousMul #align add_submonoid.has_continuous_add AddSubmonoid.continuousAdd section ContinuousMul variable [TopologicalSpace M] [Monoid M] [ContinuousMul M] @[to_additive] theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s := image2_subset_iff.2 fun _ hx _ hy => map_mem_closure₂ continuous_mul hx hy fun _ ha _ hb => s.mul_mem ha hb #align submonoid.top_closure_mul_self_subset Submonoid.top_closure_mul_self_subset #align add_submonoid.top_closure_add_self_subset AddSubmonoid.top_closure_add_self_subset @[to_additive] theorem Submonoid.top_closure_mul_self_eq (s : Submonoid M) : _root_.closure (s : Set M) * _root_.closure s = _root_.closure s := Subset.antisymm s.top_closure_mul_self_subset fun x hx => ⟨x, 1, hx, _root_.subset_closure s.one_mem, mul_one _⟩ #align submonoid.top_closure_mul_self_eq Submonoid.top_closure_mul_self_eq #align add_submonoid.top_closure_add_self_eq AddSubmonoid.top_closure_add_self_eq /-- The (topological-space) closure of a submonoid of a space `M` with `ContinuousMul` is itself a submonoid. -/ @[to_additive "The (topological-space) closure of an additive submonoid of a space `M` with `ContinuousAdd` is itself an additive submonoid."] def Submonoid.topologicalClosure (s : Submonoid M) : Submonoid M where carrier := _root_.closure (s : Set M) one_mem' := _root_.subset_closure s.one_mem mul_mem' ha hb := s.top_closure_mul_self_subset ⟨_, _, ha, hb, rfl⟩ #align submonoid.topological_closure Submonoid.topologicalClosure #align add_submonoid.topological_closure AddSubmonoid.topologicalClosure -- Porting note: new lemma @[to_additive] theorem Submonoid.coe_topologicalClosure (s : Submonoid M) : (s.topologicalClosure : Set M) = _root_.closure (s : Set M) := rfl @[to_additive] theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure := _root_.subset_closure #align submonoid.le_topological_closure Submonoid.le_topologicalClosure #align add_submonoid.le_topological_closure AddSubmonoid.le_topologicalClosure @[to_additive] theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) : IsClosed (s.topologicalClosure : Set M) := isClosed_closure #align submonoid.is_closed_topological_closure Submonoid.isClosed_topologicalClosure #align add_submonoid.is_closed_topological_closure AddSubmonoid.isClosed_topologicalClosure @[to_additive] theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t) (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t := closure_minimal h ht #align submonoid.topological_closure_minimal Submonoid.topologicalClosure_minimal #align add_submonoid.topological_closure_minimal AddSubmonoid.topologicalClosure_minimal /-- If a submonoid of a topological monoid is commutative, then so is its topological closure. -/ @[to_additive "If a submonoid of an additive topological monoid is commutative, then so is its topological closure."] def Submonoid.commMonoidTopologicalClosure [T2Space M] (s : Submonoid M) (hs : ∀ x y : s, x * y = y * x) : CommMonoid s.topologicalClosure := { s.topologicalClosure.toMonoid with mul_comm := have : ∀ x ∈ s, ∀ y ∈ s, x * y = y * x := fun x hx y hy => congr_arg Subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩) fun ⟨x, hx⟩ ⟨y, hy⟩ => Subtype.ext <| eqOn_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy } #align submonoid.comm_monoid_topological_closure Submonoid.commMonoidTopologicalClosure #align add_submonoid.add_comm_monoid_topological_closure AddSubmonoid.addCommMonoidTopologicalClosure @[to_additive exists_open_nhds_zero_half] theorem exists_open_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := by have : (fun a : M × M => a.1 * a.2) ⁻¹' s ∈ 𝓝 ((1, 1) : M × M) := tendsto_mul (by simpa only [one_mul] using hs) simpa only [prod_subset_iff] using exists_nhds_square this #align exists_open_nhds_one_split exists_open_nhds_one_split #align exists_open_nhds_zero_half exists_open_nhds_zero_half @[to_additive exists_nhds_zero_half] theorem exists_nhds_one_split {s : Set M} (hs : s ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ v ∈ V, ∀ w ∈ V, v * w ∈ s := let ⟨V, Vo, V1, hV⟩ := exists_open_nhds_one_split hs ⟨V, IsOpen.mem_nhds Vo V1, hV⟩ #align exists_nhds_one_split exists_nhds_one_split #align exists_nhds_zero_half exists_nhds_zero_half @[to_additive exists_nhds_zero_quarter] theorem exists_nhds_one_split4 {u : Set M} (hu : u ∈ 𝓝 (1 : M)) : ∃ V ∈ 𝓝 (1 : M), ∀ {v w s t}, v ∈ V → w ∈ V → s ∈ V → t ∈ V → v * w * s * t ∈ u := by rcases exists_nhds_one_split hu with ⟨W, W1, h⟩ rcases exists_nhds_one_split W1 with ⟨V, V1, h'⟩ use V, V1 intro v w s t v_in w_in s_in t_in simpa only [mul_assoc] using h _ (h' v v_in w w_in) _ (h' s s_in t t_in) #align exists_nhds_one_split4 exists_nhds_one_split4 #align exists_nhds_zero_quarter exists_nhds_zero_quarter /-- Given a neighborhood `U` of `1` there is an open neighborhood `V` of `1` such that `VV ⊆ U`. -/ @[to_additive "Given an open neighborhood `U` of `0` there is an open neighborhood `V` of `0` such that `V + V ⊆ U`."] theorem exists_open_nhds_one_mul_subset {U : Set M} (hU : U ∈ 𝓝 (1 : M)) : ∃ V : Set M, IsOpen V ∧ (1 : M) ∈ V ∧ V * V ⊆ U := by rcases exists_open_nhds_one_split hU with ⟨V, Vo, V1, hV⟩ use V, Vo, V1 rintro _ ⟨x, y, hx, hy, rfl⟩ exact hV _ hx _ hy #align exists_open_nhds_one_mul_subset exists_open_nhds_one_mul_subset #align exists_open_nhds_zero_add_subset exists_open_nhds_zero_add_subset @[to_additive] theorem IsCompact.mul {s t : Set M} (hs : IsCompact s) (ht : IsCompact t) : IsCompact (s * t) := by rw [← image_mul_prod] exact (hs.prod ht).image continuous_mul #align is_compact.mul IsCompact.mul #align is_compact.add IsCompact.add @[to_additive] theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} : ∀ l : List ι, (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod) | [], _ => by simp [tendsto_const_nhds] | f::l, h => by simp only [List.map_cons, List.prod_cons] exact (h f (List.mem_cons_self _ _)).mul (tendsto_list_prod l fun c hc => h c (List.mem_cons_of_mem _ hc)) #align tendsto_list_prod tendsto_list_prod #align tendsto_list_sum tendsto_list_sum @[to_additive (attr := continuity)] theorem continuous_list_prod {f : ι → X → M} (l : List ι) (h : ∀ i ∈ l, Continuous (f i)) : Continuous fun a => (l.map fun i => f i a).prod := continuous_iff_continuousAt.2 fun x => tendsto_list_prod l fun c hc => continuous_iff_continuousAt.1 (h c hc) x #align continuous_list_prod continuous_list_prod #align continuous_list_sum continuous_list_sum @[to_additive] theorem continuousOn_list_prod {f : ι → X → M} (l : List ι) {t : Set X} (h : ∀ i ∈ l, ContinuousOn (f i) t) : ContinuousOn (fun a => (l.map fun i => f i a).prod) t := by intro x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] refine' tendsto_list_prod _ fun i hi => _ specialize h i hi x hx rw [continuousWithinAt_iff_continuousAt_restrict _ hx] at h exact h #align continuous_on_list_prod continuousOn_list_prod #align continuous_on_list_sum continuousOn_list_sum @[to_additive (attr := continuity)] theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n | 0 => by simpa using continuous_const | k + 1 => by simp only [pow_succ] exact continuous_id.mul (continuous_pow _) #align continuous_pow continuous_pow #align continuous_nsmul continuous_nsmul instance AddMonoid.continuousConstSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousConstSMul ℕ A := ⟨continuous_nsmul⟩ #align add_monoid.has_continuous_const_smul_nat AddMonoid.continuousConstSMul_nat instance AddMonoid.continuousSMul_nat {A} [AddMonoid A] [TopologicalSpace A] [ContinuousAdd A] : ContinuousSMul ℕ A := ⟨continuous_prod_of_discrete_left.mpr continuous_nsmul⟩ #align add_monoid.has_continuous_smul_nat AddMonoid.continuousSMul_nat -- We register `Continuous.pow` as a `continuity` lemma with low penalty (so -- `continuity` will try it before other `continuity` lemmas). This is a -- workaround for goals of the form `Continuous fun x => x ^ 2`, where -- `continuity` applies `Continuous.mul` since the goal is defeq to -- `Continuous fun x => x * x`. -- -- To properly fix this, we should make sure that `continuity` applies its -- lemmas with reducible transparency, preventing the unfolding of `^`. But this -- is quite an invasive change. @[to_additive (attr := aesop safe -100 (rule_sets [Continuous]))] theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n := (continuous_pow n).comp h #align continuous.pow Continuous.pow #align continuous.nsmul Continuous.nsmul @[to_additive] theorem continuousOn_pow {s : Set M} (n : ℕ) : ContinuousOn (fun (x : M) => x ^ n) s := (continuous_pow n).continuousOn #align continuous_on_pow continuousOn_pow #align continuous_on_nsmul continuousOn_nsmul @[to_additive] theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x := (continuous_pow n).continuousAt #align continuous_at_pow continuousAt_pow #align continuous_at_nsmul continuousAt_nsmul @[to_additive] theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) : Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n)) := (continuousAt_pow _ _).tendsto.comp hf #align filter.tendsto.pow Filter.Tendsto.pow #align filter.tendsto.nsmul Filter.Tendsto.nsmul @[to_additive] theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x) (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x := Filter.Tendsto.pow hf n #align continuous_within_at.pow ContinuousWithinAt.pow #align continuous_within_at.nsmul ContinuousWithinAt.nsmul @[to_additive] theorem ContinuousAt.pow {f : X → M} {x : X} (hf : ContinuousAt f x) (n : ℕ) : ContinuousAt (fun x => f x ^ n) x := Filter.Tendsto.pow hf n #align continuous_at.pow ContinuousAt.pow #align continuous_at.nsmul ContinuousAt.nsmul @[to_additive] theorem ContinuousOn.pow {f : X → M} {s : Set X} (hf : ContinuousOn f s) (n : ℕ) : ContinuousOn (fun x => f x ^ n) s := fun x hx => (hf x hx).pow n #align continuous_on.pow ContinuousOn.pow #align continuous_on.nsmul ContinuousOn.nsmul /-- Left-multiplication by a left-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_left {a b : M} (ha : b * a = 1) : Filter.Tendsto (fun x : M => a * x) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_left b)) simp only [comp_mul_left, ha, one_mul] exact Filter.tendsto_id -- Porting note: changed proof, original proof was: /-refine' Filter.Tendsto.of_tendsto_comp _ (Filter.comap_cocompact_le (continuous_mul_left b)) convert Filter.tendsto_id ext x simp [ha]-/ #align filter.tendsto_cocompact_mul_left Filter.tendsto_cocompact_mul_left /-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e., inverse images of compact sets are compact. -/ theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) : Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M) := by refine Filter.Tendsto.of_tendsto_comp ?_ (Filter.comap_cocompact_le (continuous_mul_right b)) simp only [comp_mul_right, ha, mul_one] exact Filter.tendsto_id -- Porting note: changed proof #align filter.tendsto_cocompact_mul_right Filter.tendsto_cocompact_mul_right /-- If `R` acts on `A` via `A`, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = A`, or when `[Algebra R A]` is available. -/ @[to_additive "If `R` acts on `A` via `A`, then continuous addition implies continuous affine addition by constants."] instance (priority := 100) IsScalarTower.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [IsScalarTower R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← smul_one_mul q (_ : A)] exact continuous_const.mul continuous_id #align is_scalar_tower.has_continuous_const_smul IsScalarTower.continuousConstSMul #align vadd_assoc_class.has_continuous_const_vadd VAddAssocClass.continuousConstVAdd /-- If the action of `R` on `A` commutes with left-multiplication, then continuous multiplication implies continuous scalar multiplication by constants. Notably, this instances applies when `R = Aᵐᵒᵖ`.-/ @[to_additive "If the action of `R` on `A` commutes with left-addition, then continuous addition implies continuous affine addition by constants. Notably, this instances applies when `R = Aᵃᵒᵖ`."] instance (priority := 100) SMulCommClass.continuousConstSMul {R A : Type*} [Monoid A] [SMul R A] [SMulCommClass R A A] [TopologicalSpace A] [ContinuousMul A] : ContinuousConstSMul R A where continuous_const_smul q := by simp (config := { singlePass := true }) only [← mul_smul_one q (_ : A)] exact continuous_id.mul continuous_const #align smul_comm_class.has_continuous_const_smul SMulCommClass.continuousConstSMul #align vadd_comm_class.has_continuous_const_vadd VAddCommClass.continuousConstVAdd end ContinuousMul namespace MulOpposite /-- If multiplication is continuous in `α`, then it also is in `αᵐᵒᵖ`. -/ @[to_additive "If addition is continuous in `α`, then it also is in `αᵃᵒᵖ`."] instance [TopologicalSpace α] [Mul α] [ContinuousMul α] : ContinuousMul αᵐᵒᵖ := ⟨continuous_op.comp (continuous_unop.snd'.mul continuous_unop.fst')⟩ end MulOpposite namespace Units open MulOpposite variable [TopologicalSpace α] [Monoid α] [ContinuousMul α] /-- If multiplication on a monoid is continuous, then multiplication on the units of the monoid, with respect to the induced topology, is continuous. Inversion is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousInv` has not yet been defined. -/ @[to_additive "If addition on an additive monoid is continuous, then addition on the additive units of the monoid, with respect to the induced topology, is continuous. Negation is also continuous, but we register this in a later file, `Topology.Algebra.Group`, because the predicate `ContinuousNeg` has not yet been defined."] instance : ContinuousMul αˣ := inducing_embedProduct.continuousMul (embedProduct α) end Units @[to_additive] theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N] (f : M →* N) (hf : Continuous f) : Continuous (Units.map f) := Units.continuous_iff.2 ⟨hf.comp Units.continuous_val, hf.comp Units.continuous_coe_inv⟩ #align continuous.units_map Continuous.units_map #align continuous.add_units_map Continuous.addUnits_map section variable [TopologicalSpace M] [CommMonoid M] @[to_additive] theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) : (S : Set M) ∈ 𝓝 (1 : M) := IsOpen.mem_nhds oS S.one_mem #align submonoid.mem_nhds_one Submonoid.mem_nhds_one #align add_submonoid.mem_nhds_zero AddSubmonoid.mem_nhds_zero variable [ContinuousMul M] @[to_additive] theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod) := by rcases s with ⟨l⟩ simpa using tendsto_list_prod l #align tendsto_multiset_prod tendsto_multiset_prod #align tendsto_multiset_sum tendsto_multiset_sum @[to_additive] theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) : (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) → Tendsto (fun b => ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) := tendsto_multiset_prod _ #align tendsto_finset_prod tendsto_finset_prod #align tendsto_finset_sum tendsto_finset_sum @[to_additive (attr := continuity)] theorem continuous_multiset_prod {f : ι → X → M} (s : Multiset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => (s.map fun i => f i a).prod := by rcases s with ⟨l⟩ simpa using continuous_list_prod l #align continuous_multiset_prod continuous_multiset_prod #align continuous_multiset_sum continuous_multiset_sum @[to_additive] theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t := by rcases s with ⟨l⟩ simpa using continuousOn_list_prod l #align continuous_on_multiset_prod continuousOn_multiset_prod #align continuous_on_multiset_sum continuousOn_multiset_sum @[to_additive (attr := continuity)] theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) : (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i in s, f i a := continuous_multiset_prod _ #align continuous_finset_prod continuous_finset_prod #align continuous_finset_sum continuous_finset_sum @[to_additive] theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} : (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i in s, f i a) t := continuousOn_multiset_prod _ #align continuous_on_finset_prod continuousOn_finset_prod #align continuous_on_finset_sum continuousOn_finset_sum @[to_additive] theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X} {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i in s, f i =ᶠ[l] ∏ i in s, g i := by replace hs : ∀ᶠ x in l, ∀ i ∈ s, f i x = g i x · rwa [eventually_all_finset] filter_upwards [hs] with x hx simp only [Finset.prod_apply, Finset.prod_congr rfl hx] #align eventually_eq_prod eventuallyEq_prod #align eventually_eq_sum eventuallyEq_sum open Function @[to_additive] theorem LocallyFinite.exists_finset_mulSupport {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport <| f i) (x₀ : X) : ∃ I : Finset ι, ∀ᶠ x in 𝓝 x₀, (mulSupport fun i => f i x) ⊆ I := by rcases hf x₀ with ⟨U, hxU, hUf⟩ refine' ⟨hUf.toFinset, mem_of_superset hxU fun y hy i hi => _⟩ rw [hUf.coe_toFinset] exact ⟨y, hi, hy⟩ #align locally_finite.exists_finset_mul_support LocallyFinite.exists_finset_mulSupport #align locally_finite.exists_finset_support LocallyFinite.exists_finset_support @[to_additive] theorem finprod_eventually_eq_prod {M : Type*} [CommMonoid M] {f : ι → X → M} (hf : LocallyFinite fun i => mulSupport (f i)) (x : X) : ∃ s : Finset ι, ∀ᶠ y in 𝓝 x, ∏ᶠ i, f i y = ∏ i in s, f i y := let ⟨I, hI⟩ := hf.exists_finset_mulSupport x ⟨I, hI.mono fun _ hy => finprod_eq_prod_of_mulSupport_subset _ fun _ hi => hy hi⟩ #align finprod_eventually_eq_prod finprod_eventually_eq_prod #align finsum_eventually_eq_sum finsum_eventually_eq_sum @[to_additive] theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x := by refine' continuous_iff_continuousAt.2 fun x => _ rcases finprod_eventually_eq_prod hf x with ⟨s, hs⟩ refine' ContinuousAt.congr _ (EventuallyEq.symm hs) exact tendsto_finset_prod _ fun i _ => (hc i).continuousAt #align continuous_finprod continuous_finprod #align continuous_finsum continuous_finsum @[to_additive] theorem continuous_finprod_cond {f : ι → X → M} {p : ι → Prop} (hc : ∀ i, p i → Continuous (f i)) (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ (i) (_ : p i), f i x := by simp only [← finprod_subtype_eq_finprod_cond] exact continuous_finprod (fun i => hc i i.2) (hf.comp_injective Subtype.coe_injective) #align continuous_finprod_cond continuous_finprod_cond #align continuous_finsum_cond continuous_finsum_cond end instance [TopologicalSpace M] [Mul M] [ContinuousMul M] : ContinuousAdd (Additive M) where continuous_add := @continuous_mul M _ _ _ instance [TopologicalSpace M] [Add M] [ContinuousAdd M] : ContinuousMul (Multiplicative M) where continuous_mul := @continuous_add M _ _ _ section LatticeOps variable {ι' : Sort*} [Mul M] @[to_additive] theorem continuousMul_sInf {ts : Set (TopologicalSpace M)} (h : ∀ t ∈ ts, @ContinuousMul M t _) : @ContinuousMul M (sInf ts) _ := letI := sInf ts { continuous_mul := continuous_sInf_rng.2 fun t ht => continuous_sInf_dom₂ ht ht (@ContinuousMul.continuous_mul M t _ (h t ht)) } #align has_continuous_mul_Inf continuousMul_sInf #align has_continuous_add_Inf continuousAdd_sInf @[to_additive] theorem continuousMul_iInf {ts : ι' → TopologicalSpace M} (h' : ∀ i, @ContinuousMul M (ts i) _) : @ContinuousMul M (⨅ i, ts i) _ := by rw [← sInf_range] exact continuousMul_sInf (Set.forall_range_iff.mpr h') #align has_continuous_mul_infi continuousMul_iInf #align has_continuous_add_infi continuousAdd_iInf @[to_additive] theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _) (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _ := by rw [inf_eq_iInf] refine' continuousMul_iInf fun b => _ cases b <;>
assumption
@[to_additive] theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _) (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _ := by rw [inf_eq_iInf] refine' continuousMul_iInf fun b => _ cases b <;>
Mathlib.Topology.Algebra.Monoid.865_0.3p9EZf9ZWFxWOAq
@[to_additive] theorem continuousMul_inf {t₁ t₂ : TopologicalSpace M} (h₁ : @ContinuousMul M t₁ _) (h₂ : @ContinuousMul M t₂ _) : @ContinuousMul M (t₁ ⊓ t₂) _
Mathlib_Topology_Algebra_Monoid
C : Type u_1 ι : Type u_2 J : Type u_3 inst✝² : Category.{?u.152, u_1} C inst✝¹ : Category.{?u.156, u_3} J c : ComplexShape ι inst✝ : HasZeroMorphisms C F : J ⥤ HomologicalComplex C c s : Cone F hs : (i : ι) → IsLimit ((eval C c i).mapCone s) t : Cone F i i' : ι x✝ : ComplexShape.Rel c i i' ⊢ (fun i => IsLimit.lift (hs i) ((eval C c i).mapCone t)) i ≫ d s.pt i i' = d t.pt i i' ≫ (fun i => IsLimit.lift (hs i) ((eval C c i).mapCone t)) i'
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomologicalComplex import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of homological complexes In this file, it is shown that if a category `C` has (co)limits of shape `J`, then it is also the case of the categories `HomologicalComplex C c`, and the evaluation functors `eval C c i : HomologicalComplex C c ⥤ C` commute to these. -/ open CategoryTheory Category Limits namespace HomologicalComplex variable {C ι J : Type*} [Category C] [Category J] {c : ComplexShape ι} [HasZeroMorphisms C] section variable (F : J ⥤ HomologicalComplex C c) /-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by
apply IsLimit.hom_ext (hs i')
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by
Mathlib.Algebra.Homology.HomologicalComplexLimits.30_0.gJN7GlsIU4rmUTz
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t
Mathlib_Algebra_Homology_HomologicalComplexLimits
C : Type u_1 ι : Type u_2 J : Type u_3 inst✝² : Category.{?u.152, u_1} C inst✝¹ : Category.{?u.156, u_3} J c : ComplexShape ι inst✝ : HasZeroMorphisms C F : J ⥤ HomologicalComplex C c s : Cone F hs : (i : ι) → IsLimit ((eval C c i).mapCone s) t : Cone F i i' : ι x✝ : ComplexShape.Rel c i i' ⊢ ∀ (j : J), ((fun i => IsLimit.lift (hs i) ((eval C c i).mapCone t)) i ≫ d s.pt i i') ≫ ((eval C c i').mapCone s).π.app j = (d t.pt i i' ≫ (fun i => IsLimit.lift (hs i) ((eval C c i).mapCone t)) i') ≫ ((eval C c i').mapCone s).π.app j
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomologicalComplex import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of homological complexes In this file, it is shown that if a category `C` has (co)limits of shape `J`, then it is also the case of the categories `HomologicalComplex C c`, and the evaluation functors `eval C c i : HomologicalComplex C c ⥤ C` commute to these. -/ open CategoryTheory Category Limits namespace HomologicalComplex variable {C ι J : Type*} [Category C] [Category J] {c : ComplexShape ι} [HasZeroMorphisms C] section variable (F : J ⥤ HomologicalComplex C c) /-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i')
intro j
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i')
Mathlib.Algebra.Homology.HomologicalComplexLimits.30_0.gJN7GlsIU4rmUTz
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t
Mathlib_Algebra_Homology_HomologicalComplexLimits
C : Type u_1 ι : Type u_2 J : Type u_3 inst✝² : Category.{?u.152, u_1} C inst✝¹ : Category.{?u.156, u_3} J c : ComplexShape ι inst✝ : HasZeroMorphisms C F : J ⥤ HomologicalComplex C c s : Cone F hs : (i : ι) → IsLimit ((eval C c i).mapCone s) t : Cone F i i' : ι x✝ : ComplexShape.Rel c i i' j : J ⊢ ((fun i => IsLimit.lift (hs i) ((eval C c i).mapCone t)) i ≫ d s.pt i i') ≫ ((eval C c i').mapCone s).π.app j = (d t.pt i i' ≫ (fun i => IsLimit.lift (hs i) ((eval C c i).mapCone t)) i') ≫ ((eval C c i').mapCone s).π.app j
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomologicalComplex import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of homological complexes In this file, it is shown that if a category `C` has (co)limits of shape `J`, then it is also the case of the categories `HomologicalComplex C c`, and the evaluation functors `eval C c i : HomologicalComplex C c ⥤ C` commute to these. -/ open CategoryTheory Category Limits namespace HomologicalComplex variable {C ι J : Type*} [Category C] [Category J] {c : ComplexShape ι} [HasZeroMorphisms C] section variable (F : J ⥤ HomologicalComplex C c) /-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j
have eq := fun k => (hs k).fac ((eval C c k).mapCone t)
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j
Mathlib.Algebra.Homology.HomologicalComplexLimits.30_0.gJN7GlsIU4rmUTz
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t
Mathlib_Algebra_Homology_HomologicalComplexLimits
C : Type u_1 ι : Type u_2 J : Type u_3 inst✝² : Category.{?u.152, u_1} C inst✝¹ : Category.{?u.156, u_3} J c : ComplexShape ι inst✝ : HasZeroMorphisms C F : J ⥤ HomologicalComplex C c s : Cone F hs : (i : ι) → IsLimit ((eval C c i).mapCone s) t : Cone F i i' : ι x✝ : ComplexShape.Rel c i i' j : J eq : ∀ (k : ι) (j : J), IsLimit.lift (hs k) ((eval C c k).mapCone t) ≫ ((eval C c k).mapCone s).π.app j = ((eval C c k).mapCone t).π.app j ⊢ ((fun i => IsLimit.lift (hs i) ((eval C c i).mapCone t)) i ≫ d s.pt i i') ≫ ((eval C c i').mapCone s).π.app j = (d t.pt i i' ≫ (fun i => IsLimit.lift (hs i) ((eval C c i).mapCone t)) i') ≫ ((eval C c i').mapCone s).π.app j
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomologicalComplex import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of homological complexes In this file, it is shown that if a category `C` has (co)limits of shape `J`, then it is also the case of the categories `HomologicalComplex C c`, and the evaluation functors `eval C c i : HomologicalComplex C c ⥤ C` commute to these. -/ open CategoryTheory Category Limits namespace HomologicalComplex variable {C ι J : Type*} [Category C] [Category J] {c : ComplexShape ι} [HasZeroMorphisms C] section variable (F : J ⥤ HomologicalComplex C c) /-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t)
simp only [Functor.mapCone_π_app, eval_map] at eq
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t)
Mathlib.Algebra.Homology.HomologicalComplexLimits.30_0.gJN7GlsIU4rmUTz
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t
Mathlib_Algebra_Homology_HomologicalComplexLimits
C : Type u_1 ι : Type u_2 J : Type u_3 inst✝² : Category.{?u.152, u_1} C inst✝¹ : Category.{?u.156, u_3} J c : ComplexShape ι inst✝ : HasZeroMorphisms C F : J ⥤ HomologicalComplex C c s : Cone F hs : (i : ι) → IsLimit ((eval C c i).mapCone s) t : Cone F i i' : ι x✝ : ComplexShape.Rel c i i' j : J eq : ∀ (k : ι) (j : J), IsLimit.lift (hs k) ((eval C c k).mapCone t) ≫ Hom.f (s.π.app j) k = Hom.f (t.π.app j) k ⊢ ((fun i => IsLimit.lift (hs i) ((eval C c i).mapCone t)) i ≫ d s.pt i i') ≫ ((eval C c i').mapCone s).π.app j = (d t.pt i i' ≫ (fun i => IsLimit.lift (hs i) ((eval C c i).mapCone t)) i') ≫ ((eval C c i').mapCone s).π.app j
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomologicalComplex import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of homological complexes In this file, it is shown that if a category `C` has (co)limits of shape `J`, then it is also the case of the categories `HomologicalComplex C c`, and the evaluation functors `eval C c i : HomologicalComplex C c ⥤ C` commute to these. -/ open CategoryTheory Category Limits namespace HomologicalComplex variable {C ι J : Type*} [Category C] [Category J] {c : ComplexShape ι} [HasZeroMorphisms C] section variable (F : J ⥤ HomologicalComplex C c) /-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq
simp only [Functor.mapCone_π_app, eval_map, assoc]
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq
Mathlib.Algebra.Homology.HomologicalComplexLimits.30_0.gJN7GlsIU4rmUTz
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t
Mathlib_Algebra_Homology_HomologicalComplexLimits
C : Type u_1 ι : Type u_2 J : Type u_3 inst✝² : Category.{?u.152, u_1} C inst✝¹ : Category.{?u.156, u_3} J c : ComplexShape ι inst✝ : HasZeroMorphisms C F : J ⥤ HomologicalComplex C c s : Cone F hs : (i : ι) → IsLimit ((eval C c i).mapCone s) t : Cone F i i' : ι x✝ : ComplexShape.Rel c i i' j : J eq : ∀ (k : ι) (j : J), IsLimit.lift (hs k) ((eval C c k).mapCone t) ≫ Hom.f (s.π.app j) k = Hom.f (t.π.app j) k ⊢ IsLimit.lift (hs i) ((eval C c i).mapCone t) ≫ d s.pt i i' ≫ Hom.f (s.π.app j) i' = d t.pt i i' ≫ IsLimit.lift (hs i') ((eval C c i').mapCone t) ≫ Hom.f (s.π.app j) i'
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomologicalComplex import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of homological complexes In this file, it is shown that if a category `C` has (co)limits of shape `J`, then it is also the case of the categories `HomologicalComplex C c`, and the evaluation functors `eval C c i : HomologicalComplex C c ⥤ C` commute to these. -/ open CategoryTheory Category Limits namespace HomologicalComplex variable {C ι J : Type*} [Category C] [Category J] {c : ComplexShape ι} [HasZeroMorphisms C] section variable (F : J ⥤ HomologicalComplex C c) /-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc]
rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm]
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc]
Mathlib.Algebra.Homology.HomologicalComplexLimits.30_0.gJN7GlsIU4rmUTz
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t
Mathlib_Algebra_Homology_HomologicalComplexLimits
C : Type u_1 ι : Type u_2 J : Type u_3 inst✝² : Category.{?u.152, u_1} C inst✝¹ : Category.{?u.156, u_3} J c : ComplexShape ι inst✝ : HasZeroMorphisms C F : J ⥤ HomologicalComplex C c s : Cone F hs : (i : ι) → IsLimit ((eval C c i).mapCone s) t : Cone F j : J ⊢ (fun t => Hom.mk fun i => IsLimit.lift (hs i) ((eval C c i).mapCone t)) t ≫ s.π.app j = t.π.app j
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomologicalComplex import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of homological complexes In this file, it is shown that if a category `C` has (co)limits of shape `J`, then it is also the case of the categories `HomologicalComplex C c`, and the evaluation functors `eval C c i : HomologicalComplex C c ⥤ C` commute to these. -/ open CategoryTheory Category Limits namespace HomologicalComplex variable {C ι J : Type*} [Category C] [Category J] {c : ComplexShape ι} [HasZeroMorphisms C] section variable (F : J ⥤ HomologicalComplex C c) /-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by
ext i
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by
Mathlib.Algebra.Homology.HomologicalComplexLimits.30_0.gJN7GlsIU4rmUTz
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t
Mathlib_Algebra_Homology_HomologicalComplexLimits
case h C : Type u_1 ι : Type u_2 J : Type u_3 inst✝² : Category.{?u.152, u_1} C inst✝¹ : Category.{?u.156, u_3} J c : ComplexShape ι inst✝ : HasZeroMorphisms C F : J ⥤ HomologicalComplex C c s : Cone F hs : (i : ι) → IsLimit ((eval C c i).mapCone s) t : Cone F j : J i : ι ⊢ Hom.f ((fun t => Hom.mk fun i => IsLimit.lift (hs i) ((eval C c i).mapCone t)) t ≫ s.π.app j) i = Hom.f (t.π.app j) i
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomologicalComplex import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of homological complexes In this file, it is shown that if a category `C` has (co)limits of shape `J`, then it is also the case of the categories `HomologicalComplex C c`, and the evaluation functors `eval C c i : HomologicalComplex C c ⥤ C` commute to these. -/ open CategoryTheory Category Limits namespace HomologicalComplex variable {C ι J : Type*} [Category C] [Category J] {c : ComplexShape ι} [HasZeroMorphisms C] section variable (F : J ⥤ HomologicalComplex C c) /-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by ext i
apply (hs i).fac
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by ext i
Mathlib.Algebra.Homology.HomologicalComplexLimits.30_0.gJN7GlsIU4rmUTz
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t
Mathlib_Algebra_Homology_HomologicalComplexLimits
C : Type u_1 ι : Type u_2 J : Type u_3 inst✝² : Category.{?u.152, u_1} C inst✝¹ : Category.{?u.156, u_3} J c : ComplexShape ι inst✝ : HasZeroMorphisms C F : J ⥤ HomologicalComplex C c s : Cone F hs : (i : ι) → IsLimit ((eval C c i).mapCone s) t : Cone F m : t.pt ⟶ s.pt hm : ∀ (j : J), m ≫ s.π.app j = t.π.app j ⊢ m = (fun t => Hom.mk fun i => IsLimit.lift (hs i) ((eval C c i).mapCone t)) t
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomologicalComplex import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of homological complexes In this file, it is shown that if a category `C` has (co)limits of shape `J`, then it is also the case of the categories `HomologicalComplex C c`, and the evaluation functors `eval C c i : HomologicalComplex C c ⥤ C` commute to these. -/ open CategoryTheory Category Limits namespace HomologicalComplex variable {C ι J : Type*} [Category C] [Category J] {c : ComplexShape ι} [HasZeroMorphisms C] section variable (F : J ⥤ HomologicalComplex C c) /-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by ext i apply (hs i).fac uniq t m hm := by
ext i
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by ext i apply (hs i).fac uniq t m hm := by
Mathlib.Algebra.Homology.HomologicalComplexLimits.30_0.gJN7GlsIU4rmUTz
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t
Mathlib_Algebra_Homology_HomologicalComplexLimits
case h C : Type u_1 ι : Type u_2 J : Type u_3 inst✝² : Category.{?u.152, u_1} C inst✝¹ : Category.{?u.156, u_3} J c : ComplexShape ι inst✝ : HasZeroMorphisms C F : J ⥤ HomologicalComplex C c s : Cone F hs : (i : ι) → IsLimit ((eval C c i).mapCone s) t : Cone F m : t.pt ⟶ s.pt hm : ∀ (j : J), m ≫ s.π.app j = t.π.app j i : ι ⊢ Hom.f m i = Hom.f ((fun t => Hom.mk fun i => IsLimit.lift (hs i) ((eval C c i).mapCone t)) t) i
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomologicalComplex import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of homological complexes In this file, it is shown that if a category `C` has (co)limits of shape `J`, then it is also the case of the categories `HomologicalComplex C c`, and the evaluation functors `eval C c i : HomologicalComplex C c ⥤ C` commute to these. -/ open CategoryTheory Category Limits namespace HomologicalComplex variable {C ι J : Type*} [Category C] [Category J] {c : ComplexShape ι} [HasZeroMorphisms C] section variable (F : J ⥤ HomologicalComplex C c) /-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by ext i apply (hs i).fac uniq t m hm := by ext i
apply (hs i).uniq ((eval C c i).mapCone t)
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by ext i apply (hs i).fac uniq t m hm := by ext i
Mathlib.Algebra.Homology.HomologicalComplexLimits.30_0.gJN7GlsIU4rmUTz
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t
Mathlib_Algebra_Homology_HomologicalComplexLimits
case h.x C : Type u_1 ι : Type u_2 J : Type u_3 inst✝² : Category.{?u.152, u_1} C inst✝¹ : Category.{?u.156, u_3} J c : ComplexShape ι inst✝ : HasZeroMorphisms C F : J ⥤ HomologicalComplex C c s : Cone F hs : (i : ι) → IsLimit ((eval C c i).mapCone s) t : Cone F m : t.pt ⟶ s.pt hm : ∀ (j : J), m ≫ s.π.app j = t.π.app j i : ι ⊢ ∀ (j : J), Hom.f m i ≫ ((eval C c i).mapCone s).π.app j = ((eval C c i).mapCone t).π.app j
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomologicalComplex import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of homological complexes In this file, it is shown that if a category `C` has (co)limits of shape `J`, then it is also the case of the categories `HomologicalComplex C c`, and the evaluation functors `eval C c i : HomologicalComplex C c ⥤ C` commute to these. -/ open CategoryTheory Category Limits namespace HomologicalComplex variable {C ι J : Type*} [Category C] [Category J] {c : ComplexShape ι} [HasZeroMorphisms C] section variable (F : J ⥤ HomologicalComplex C c) /-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by ext i apply (hs i).fac uniq t m hm := by ext i apply (hs i).uniq ((eval C c i).mapCone t)
intro j
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by ext i apply (hs i).fac uniq t m hm := by ext i apply (hs i).uniq ((eval C c i).mapCone t)
Mathlib.Algebra.Homology.HomologicalComplexLimits.30_0.gJN7GlsIU4rmUTz
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t
Mathlib_Algebra_Homology_HomologicalComplexLimits
case h.x C : Type u_1 ι : Type u_2 J : Type u_3 inst✝² : Category.{?u.152, u_1} C inst✝¹ : Category.{?u.156, u_3} J c : ComplexShape ι inst✝ : HasZeroMorphisms C F : J ⥤ HomologicalComplex C c s : Cone F hs : (i : ι) → IsLimit ((eval C c i).mapCone s) t : Cone F m : t.pt ⟶ s.pt hm : ∀ (j : J), m ≫ s.π.app j = t.π.app j i : ι j : J ⊢ Hom.f m i ≫ ((eval C c i).mapCone s).π.app j = ((eval C c i).mapCone t).π.app j
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomologicalComplex import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of homological complexes In this file, it is shown that if a category `C` has (co)limits of shape `J`, then it is also the case of the categories `HomologicalComplex C c`, and the evaluation functors `eval C c i : HomologicalComplex C c ⥤ C` commute to these. -/ open CategoryTheory Category Limits namespace HomologicalComplex variable {C ι J : Type*} [Category C] [Category J] {c : ComplexShape ι} [HasZeroMorphisms C] section variable (F : J ⥤ HomologicalComplex C c) /-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by ext i apply (hs i).fac uniq t m hm := by ext i apply (hs i).uniq ((eval C c i).mapCone t) intro j
dsimp
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by ext i apply (hs i).fac uniq t m hm := by ext i apply (hs i).uniq ((eval C c i).mapCone t) intro j
Mathlib.Algebra.Homology.HomologicalComplexLimits.30_0.gJN7GlsIU4rmUTz
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t
Mathlib_Algebra_Homology_HomologicalComplexLimits
case h.x C : Type u_1 ι : Type u_2 J : Type u_3 inst✝² : Category.{?u.152, u_1} C inst✝¹ : Category.{?u.156, u_3} J c : ComplexShape ι inst✝ : HasZeroMorphisms C F : J ⥤ HomologicalComplex C c s : Cone F hs : (i : ι) → IsLimit ((eval C c i).mapCone s) t : Cone F m : t.pt ⟶ s.pt hm : ∀ (j : J), m ≫ s.π.app j = t.π.app j i : ι j : J ⊢ Hom.f m i ≫ Hom.f (s.π.app j) i = Hom.f (t.π.app j) i
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomologicalComplex import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of homological complexes In this file, it is shown that if a category `C` has (co)limits of shape `J`, then it is also the case of the categories `HomologicalComplex C c`, and the evaluation functors `eval C c i : HomologicalComplex C c ⥤ C` commute to these. -/ open CategoryTheory Category Limits namespace HomologicalComplex variable {C ι J : Type*} [Category C] [Category J] {c : ComplexShape ι} [HasZeroMorphisms C] section variable (F : J ⥤ HomologicalComplex C c) /-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by ext i apply (hs i).fac uniq t m hm := by ext i apply (hs i).uniq ((eval C c i).mapCone t) intro j dsimp
simp only [← comp_f, hm]
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by ext i apply (hs i).fac uniq t m hm := by ext i apply (hs i).uniq ((eval C c i).mapCone t) intro j dsimp
Mathlib.Algebra.Homology.HomologicalComplexLimits.30_0.gJN7GlsIU4rmUTz
/-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t
Mathlib_Algebra_Homology_HomologicalComplexLimits
C : Type u_1 ι : Type u_2 J : Type u_3 inst✝³ : Category.{?u.5993, u_1} C inst✝² : Category.{?u.5997, u_3} J c : ComplexShape ι inst✝¹ : HasZeroMorphisms C F : J ⥤ HomologicalComplex C c inst✝ : ∀ (n : ι), HasLimit (F ⋙ eval C c n) n m : ι h : ¬ComplexShape.Rel c n m ⊢ (fun n m => limMap (NatTrans.mk fun j => d (F.obj j) n m)) n m = 0
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomologicalComplex import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of homological complexes In this file, it is shown that if a category `C` has (co)limits of shape `J`, then it is also the case of the categories `HomologicalComplex C c`, and the evaluation functors `eval C c i : HomologicalComplex C c ⥤ C` commute to these. -/ open CategoryTheory Category Limits namespace HomologicalComplex variable {C ι J : Type*} [Category C] [Category J] {c : ComplexShape ι} [HasZeroMorphisms C] section variable (F : J ⥤ HomologicalComplex C c) /-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by ext i apply (hs i).fac uniq t m hm := by ext i apply (hs i).uniq ((eval C c i).mapCone t) intro j dsimp simp only [← comp_f, hm] variable [∀ (n : ι), HasLimit (F ⋙ eval C c n)] /-- A cone for a functor `F : J ⥤ HomologicalComplex C c` which is given in degree `n` by the limit `F ⋙ eval C c n`. -/ @[simps] noncomputable def coneOfHasLimitEval : Cone F where pt := { X := fun n => limit (F ⋙ eval C c n) d := fun n m => limMap { app := fun j => (F.obj j).d n m } shape := fun {n m} h => by
ext j
/-- A cone for a functor `F : J ⥤ HomologicalComplex C c` which is given in degree `n` by the limit `F ⋙ eval C c n`. -/ @[simps] noncomputable def coneOfHasLimitEval : Cone F where pt := { X := fun n => limit (F ⋙ eval C c n) d := fun n m => limMap { app := fun j => (F.obj j).d n m } shape := fun {n m} h => by
Mathlib.Algebra.Homology.HomologicalComplexLimits.55_0.gJN7GlsIU4rmUTz
/-- A cone for a functor `F : J ⥤ HomologicalComplex C c` which is given in degree `n` by the limit `F ⋙ eval C c n`. -/ @[simps] noncomputable def coneOfHasLimitEval : Cone F where pt
Mathlib_Algebra_Homology_HomologicalComplexLimits
case w C : Type u_1 ι : Type u_2 J : Type u_3 inst✝³ : Category.{?u.5993, u_1} C inst✝² : Category.{?u.5997, u_3} J c : ComplexShape ι inst✝¹ : HasZeroMorphisms C F : J ⥤ HomologicalComplex C c inst✝ : ∀ (n : ι), HasLimit (F ⋙ eval C c n) n m : ι h : ¬ComplexShape.Rel c n m j : J ⊢ (fun n m => limMap (NatTrans.mk fun j => d (F.obj j) n m)) n m ≫ limit.π (F ⋙ eval C c m) j = 0 ≫ limit.π (F ⋙ eval C c m) j
/- Copyright (c) 2023 Joël Riou. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joël Riou -/ import Mathlib.Algebra.Homology.HomologicalComplex import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits import Mathlib.CategoryTheory.Limits.Preserves.Finite /-! # Limits and colimits in the category of homological complexes In this file, it is shown that if a category `C` has (co)limits of shape `J`, then it is also the case of the categories `HomologicalComplex C c`, and the evaluation functors `eval C c i : HomologicalComplex C c ⥤ C` commute to these. -/ open CategoryTheory Category Limits namespace HomologicalComplex variable {C ι J : Type*} [Category C] [Category J] {c : ComplexShape ι} [HasZeroMorphisms C] section variable (F : J ⥤ HomologicalComplex C c) /-- A cone in `HomologicalComplex C c` is limit if the induced cones obtained by applying `eval C c i : HomologicalComplex C c ⥤ C` for all `i` are limit. -/ def isLimitOfEval (s : Cone F) (hs : ∀ (i : ι), IsLimit ((eval C c i).mapCone s)) : IsLimit s where lift t := { f := fun i => (hs i).lift ((eval C c i).mapCone t) comm' := fun i i' _ => by apply IsLimit.hom_ext (hs i') intro j have eq := fun k => (hs k).fac ((eval C c k).mapCone t) simp only [Functor.mapCone_π_app, eval_map] at eq simp only [Functor.mapCone_π_app, eval_map, assoc] rw [eq i', ← Hom.comm, reassoc_of% (eq i), Hom.comm] } fac t j := by ext i apply (hs i).fac uniq t m hm := by ext i apply (hs i).uniq ((eval C c i).mapCone t) intro j dsimp simp only [← comp_f, hm] variable [∀ (n : ι), HasLimit (F ⋙ eval C c n)] /-- A cone for a functor `F : J ⥤ HomologicalComplex C c` which is given in degree `n` by the limit `F ⋙ eval C c n`. -/ @[simps] noncomputable def coneOfHasLimitEval : Cone F where pt := { X := fun n => limit (F ⋙ eval C c n) d := fun n m => limMap { app := fun j => (F.obj j).d n m } shape := fun {n m} h => by ext j
rw [limMap_π]
/-- A cone for a functor `F : J ⥤ HomologicalComplex C c` which is given in degree `n` by the limit `F ⋙ eval C c n`. -/ @[simps] noncomputable def coneOfHasLimitEval : Cone F where pt := { X := fun n => limit (F ⋙ eval C c n) d := fun n m => limMap { app := fun j => (F.obj j).d n m } shape := fun {n m} h => by ext j
Mathlib.Algebra.Homology.HomologicalComplexLimits.55_0.gJN7GlsIU4rmUTz
/-- A cone for a functor `F : J ⥤ HomologicalComplex C c` which is given in degree `n` by the limit `F ⋙ eval C c n`. -/ @[simps] noncomputable def coneOfHasLimitEval : Cone F where pt
Mathlib_Algebra_Homology_HomologicalComplexLimits