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

Commit 834fd30

Browse files
committed
feat(topology/continuous_function/algebra): generalize algebra instances (#12055)
This adds: * some missing instances in the algebra hierarchy (`comm_semigroup`, `mul_one_class`, `mul_zero_class`, `monoid_with_zero`, `comm_monoid_with_zero`, `comm_semiring`). * finer-grained scalar action instances, notably none of which require `topological_space R` any more, as they only need `has_continuous_const_smul R M` instead of `has_continuous_smul R M`. * continuity lemmas about `zpow` on groups and `zsmul` on additive groups (copied directly from the lemmas about `pow` on monoids), which are used to avoid diamonds in the int-action. In order to make room for these, the lemmas about `zpow` on groups with zero have been renamed to `zpow₀`, which is consistent with how the similar clash with `inv` is solved. * a few lemmas about `mk_of_compact` since an existing proof was broken by `refl` closing the goal earlier than before.
1 parent 27df8a0 commit 834fd30

File tree

13 files changed

+236
-139
lines changed

13 files changed

+236
-139
lines changed

src/analysis/fourier.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ section monomials
8585
continuous maps from `circle` to `ℂ`. -/
8686
@[simps] def fourier (n : ℤ) : C(circle, ℂ) :=
8787
{ to_fun := λ z, z ^ n,
88-
continuous_to_fun := continuous_subtype_coe.zpow n $ λ z, or.inl (ne_zero_of_mem_circle z) }
88+
continuous_to_fun := continuous_subtype_coe.zpow n $ λ z, or.inl (ne_zero_of_mem_circle z) }
8989

9090
@[simp] lemma fourier_zero {z : circle} : fourier 0 z = 1 := rfl
9191

src/analysis/special_functions/integrals.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ lemma interval_integrable_pow : interval_integrable (λ x, x^n) μ a b :=
4646

4747
lemma interval_integrable_zpow {n : ℤ} (h : 0 ≤ n ∨ (0 : ℝ) ∉ [a, b]) :
4848
interval_integrable (λ x, x ^ n) μ a b :=
49-
(continuous_on_id.zpow n $ λ x hx, h.symm.imp (ne_of_mem_of_not_mem hx) id).interval_integrable
49+
(continuous_on_id.zpow n $ λ x hx, h.symm.imp (ne_of_mem_of_not_mem hx) id).interval_integrable
5050

5151
lemma interval_integrable_rpow {r : ℝ} (h : 0 ≤ r ∨ (0 : ℝ) ∉ [a, b]) :
5252
interval_integrable (λ x, x ^ r) μ a b :=

src/analysis/specific_limits.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ end
101101
@[simp] lemma continuous_at_zpow {𝕜 : Type*} [nondiscrete_normed_field 𝕜] {m : ℤ} {x : 𝕜} :
102102
continuous_at (λ x, x ^ m) x ↔ x ≠ 00 ≤ m :=
103103
begin
104-
refine ⟨_, continuous_at_zpow _ _⟩,
104+
refine ⟨_, continuous_at_zpow _ _⟩,
105105
contrapose!, rintro ⟨rfl, hm⟩ hc,
106106
exact not_tendsto_at_top_of_tendsto_nhds (hc.tendsto.mono_left nhds_within_le_nhds).norm
107107
(tendsto_norm_zpow_nhds_within_0_at_top hm)

src/measure_theory/integral/circle_integral.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ begin
260260
refine (zpow_strict_anti this.1 this.2).le_iff_le.2 (int.lt_add_one_iff.1 _), exact hn },
261261
{ rintro (rfl|H),
262262
exacts [circle_integrable_zero_radius,
263-
((continuous_on_id.sub continuous_on_const).zpow _ $ λ z hz, H.symm.imp_left $
263+
((continuous_on_id.sub continuous_on_const).zpow _ $ λ z hz, H.symm.imp_left $
264264
λ hw, sub_ne_zero.2 $ ne_of_mem_of_not_mem hz hw).circle_integrable'] },
265265
end
266266

src/topology/algebra/group.lean

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,48 @@ hf.inv
250250
lemma is_compact.inv {s : set G} (hs : is_compact s) : is_compact (s⁻¹) :=
251251
by { rw [← image_inv], exact hs.image continuous_inv }
252252

253+
section zpow
254+
255+
@[continuity, to_additive]
256+
lemma continuous_zpow : ∀ z : ℤ, continuous (λ a : G, a ^ z)
257+
| (int.of_nat n) := by simpa using continuous_pow n
258+
| -[1+n] := by simpa using (continuous_pow (n + 1)).inv
259+
260+
@[continuity, to_additive]
261+
lemma continuous.zpow {f : α → G} (h : continuous f) (z : ℤ) :
262+
continuous (λ b, (f b) ^ z) :=
263+
(continuous_zpow z).comp h
264+
265+
@[to_additive]
266+
lemma continuous_on_zpow {s : set G} (z : ℤ) : continuous_on (λ x, x ^ z) s :=
267+
(continuous_zpow z).continuous_on
268+
269+
@[to_additive]
270+
lemma continuous_at_zpow (x : G) (z : ℤ) : continuous_at (λ x, x ^ z) x :=
271+
(continuous_zpow z).continuous_at
272+
273+
@[to_additive]
274+
lemma filter.tendsto.zpow {α} {l : filter α} {f : α → G} {x : G} (hf : tendsto f l (𝓝 x)) (z : ℤ) :
275+
tendsto (λ x, f x ^ z) l (𝓝 (x ^ z)) :=
276+
(continuous_at_zpow _ _).tendsto.comp hf
277+
278+
@[to_additive]
279+
lemma continuous_within_at.zpow {f : α → G} {x : α} {s : set α} (hf : continuous_within_at f s x)
280+
(z : ℤ) : continuous_within_at (λ x, f x ^ z) s x :=
281+
hf.zpow z
282+
283+
@[to_additive]
284+
lemma continuous_at.zpow {f : α → G} {x : α} (hf : continuous_at f x) (z : ℤ) :
285+
continuous_at (λ x, f x ^ z) x :=
286+
hf.zpow z
287+
288+
@[to_additive continuous_on.zsmul]
289+
lemma continuous_on.zpow {f : α → G} {s : set α} (hf : continuous_on f s) (z : ℤ) :
290+
continuous_on (λ x, f x ^ z) s :=
291+
λ x hx, (hf x hx).zpow z
292+
293+
end zpow
294+
253295
section ordered_comm_group
254296

255297
variables [topological_space H] [ordered_comm_group H] [topological_group H]

src/topology/algebra/group_with_zero.lean

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ section zpow
235235
variables [group_with_zero G₀] [topological_space G₀] [has_continuous_inv₀ G₀]
236236
[has_continuous_mul G₀]
237237

238-
lemma continuous_at_zpow (x : G₀) (m : ℤ) (h : x ≠ 00 ≤ m) : continuous_at (λ x, x ^ m) x :=
238+
lemma continuous_at_zpow (x : G₀) (m : ℤ) (h : x ≠ 00 ≤ m) : continuous_at (λ x, x ^ m) x :=
239239
begin
240240
cases m,
241241
{ simpa only [zpow_of_nat] using continuous_at_pow x m },
@@ -244,30 +244,30 @@ begin
244244
exact (continuous_at_pow x (m + 1)).inv₀ (pow_ne_zero _ hx) }
245245
end
246246

247-
lemma continuous_on_zpow (m : ℤ) : continuous_on (λ x : G₀, x ^ m) {0}ᶜ :=
248-
λ x hx, (continuous_at_zpow _ _ (or.inl hx)).continuous_within_at
247+
lemma continuous_on_zpow (m : ℤ) : continuous_on (λ x : G₀, x ^ m) {0}ᶜ :=
248+
λ x hx, (continuous_at_zpow _ _ (or.inl hx)).continuous_within_at
249249

250-
lemma filter.tendsto.zpow {f : α → G₀} {l : filter α} {a : G₀} (hf : tendsto f l (𝓝 a)) (m : ℤ)
250+
lemma filter.tendsto.zpow {f : α → G₀} {l : filter α} {a : G₀} (hf : tendsto f l (𝓝 a)) (m : ℤ)
251251
(h : a ≠ 00 ≤ m) :
252252
tendsto (λ x, (f x) ^ m) l (𝓝 (a ^ m)) :=
253-
(continuous_at_zpow _ m h).tendsto.comp hf
253+
(continuous_at_zpow _ m h).tendsto.comp hf
254254

255255
variables {X : Type*} [topological_space X] {a : X} {s : set X} {f : X → G₀}
256256

257-
lemma continuous_at.zpow (hf : continuous_at f a) (m : ℤ) (h : f a ≠ 00 ≤ m) :
257+
lemma continuous_at.zpow (hf : continuous_at f a) (m : ℤ) (h : f a ≠ 00 ≤ m) :
258258
continuous_at (λ x, (f x) ^ m) a :=
259-
hf.zpow m h
259+
hf.zpow m h
260260

261-
lemma continuous_within_at.zpow (hf : continuous_within_at f s a) (m : ℤ) (h : f a ≠ 00 ≤ m) :
261+
lemma continuous_within_at.zpow (hf : continuous_within_at f s a) (m : ℤ) (h : f a ≠ 00 ≤ m) :
262262
continuous_within_at (λ x, f x ^ m) s a :=
263-
hf.zpow m h
263+
hf.zpow m h
264264

265-
lemma continuous_on.zpow (hf : continuous_on f s) (m : ℤ) (h : ∀ a ∈ s, f a ≠ 00 ≤ m) :
265+
lemma continuous_on.zpow (hf : continuous_on f s) (m : ℤ) (h : ∀ a ∈ s, f a ≠ 00 ≤ m) :
266266
continuous_on (λ x, f x ^ m) s :=
267-
λ a ha, (hf a ha).zpow m (h a ha)
267+
λ a ha, (hf a ha).zpow m (h a ha)
268268

269-
@[continuity] lemma continuous.zpow (hf : continuous f) (m : ℤ) (h0 : ∀ a, f a ≠ 00 ≤ m) :
269+
@[continuity] lemma continuous.zpow (hf : continuous f) (m : ℤ) (h0 : ∀ a, f a ≠ 00 ≤ m) :
270270
continuous (λ x, (f x) ^ m) :=
271-
continuous_iff_continuous_at.2 $ λ x, (hf.tendsto x).zpow m (h0 x)
271+
continuous_iff_continuous_at.2 $ λ x, (hf.tendsto x).zpow m (h0 x)
272272

273273
end zpow

src/topology/category/Top/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def Top : Type (u+1) := bundled topological_space
2626
namespace Top
2727

2828
instance bundled_hom : bundled_hom @continuous_map :=
29-
⟨@continuous_map.to_fun, @continuous_map.id, @continuous_map.comp, @continuous_map.coe_inj
29+
⟨@continuous_map.to_fun, @continuous_map.id, @continuous_map.comp, @continuous_map.coe_injective
3030

3131
attribute [derive [large_category, concrete_category]] Top
3232

src/topology/category/Top/limits.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def limit_cone_infi (F : J ⥤ Top.{u}) : cone F :=
5656
π :=
5757
{ app := λ j, ⟨(types.limit_cone (F ⋙ forget)).π.app j,
5858
continuous_iff_le_induced.mpr (infi_le _ _)⟩,
59-
naturality' := λ j j' f,
60-
continuous_map.coe_inj ((types.limit_cone (F ⋙ forget)).π.naturality f) } }
59+
naturality' := λ j j' f, continuous_map.coe_injective
60+
((types.limit_cone (F ⋙ forget)).π.naturality f) } }
6161

6262
/--
6363
The chosen cone `Top.limit_cone F` for a functor `F : J ⥤ Top` is a limit cone.
@@ -100,8 +100,8 @@ def colimit_cocone (F : J ⥤ Top.{u}) : cocone F :=
100100
ι :=
101101
{ app := λ j, ⟨(types.colimit_cocone (F ⋙ forget)).ι.app j,
102102
continuous_iff_coinduced_le.mpr (le_supr _ j)⟩,
103-
naturality' := λ j j' f,
104-
continuous_map.coe_inj ((types.colimit_cocone (F ⋙ forget)).ι.naturality f) } }
103+
naturality' := λ j j' f, continuous_map.coe_injective
104+
((types.colimit_cocone (F ⋙ forget)).ι.naturality f) } }
105105

106106
/--
107107
The chosen cocone `Top.colimit_cocone F` for a functor `F : J ⥤ Top` is a colimit cocone.

0 commit comments

Comments
 (0)