Skip to content

Commit

Permalink
feat(Analysis/SpecificLimits/Normed): generalize to division rings (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-wieser committed Apr 19, 2024
1 parent 5fdef41 commit 4e7ba67
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 18 deletions.
31 changes: 19 additions & 12 deletions Mathlib/Analysis/SpecificLimits/Normed.lean
Expand Up @@ -53,12 +53,13 @@ theorem tendsto_norm_zero' {𝕜 : Type*} [NormedAddCommGroup 𝕜] :

namespace NormedField

theorem tendsto_norm_inverse_nhdsWithin_0_atTop {𝕜 : Type*} [NormedField 𝕜] :
theorem tendsto_norm_inverse_nhdsWithin_0_atTop {𝕜 : Type*} [NormedDivisionRing 𝕜] :
Tendsto (fun x : 𝕜 ↦ ‖x⁻¹‖) (𝓝[≠] 0) atTop :=
(tendsto_inv_zero_atTop.comp tendsto_norm_zero').congr fun x ↦ (norm_inv x).symm
#align normed_field.tendsto_norm_inverse_nhds_within_0_at_top NormedField.tendsto_norm_inverse_nhdsWithin_0_atTop

theorem tendsto_norm_zpow_nhdsWithin_0_atTop {𝕜 : Type*} [NormedField 𝕜] {m : ℤ} (hm : m < 0) :
theorem tendsto_norm_zpow_nhdsWithin_0_atTop {𝕜 : Type*} [NormedDivisionRing 𝕜] {m : ℤ}
(hm : m < 0) :
Tendsto (fun x : 𝕜 ↦ ‖x ^ m‖) (𝓝[≠] 0) atTop := by
rcases neg_surjective m with ⟨m, rfl⟩
rw [neg_lt_zero] at hm; lift m to ℕ using hm.le; rw [Int.natCast_pos] at hm
Expand All @@ -67,8 +68,8 @@ theorem tendsto_norm_zpow_nhdsWithin_0_atTop {𝕜 : Type*} [NormedField 𝕜] {
#align normed_field.tendsto_norm_zpow_nhds_within_0_at_top NormedField.tendsto_norm_zpow_nhdsWithin_0_atTop

/-- The (scalar) product of a sequence that tends to zero with a bounded one also tends to zero. -/
theorem tendsto_zero_smul_of_tendsto_zero_of_bounded {ι 𝕜 𝔸 : Type*} [NormedField 𝕜]
[NormedAddCommGroup 𝔸] [NormedSpace 𝕜 𝔸] {l : Filter ι} {ε : ι → 𝕜} {f : ι → 𝔸}
theorem tendsto_zero_smul_of_tendsto_zero_of_bounded {ι 𝕜 𝔸 : Type*} [NormedDivisionRing 𝕜]
[NormedAddCommGroup 𝔸] [Module 𝕜 𝔸] [BoundedSMul 𝕜 𝔸] {l : Filter ι} {ε : ι → 𝕜} {f : ι → 𝔸}
(hε : Tendsto ε l (𝓝 0)) (hf : Filter.IsBoundedUnder (· ≤ ·) l (norm ∘ f)) :
Tendsto (ε • f) l (𝓝 0) := by
rw [← isLittleO_one_iff 𝕜] at hε ⊢
Expand Down Expand Up @@ -286,7 +287,7 @@ theorem tendsto_pow_atTop_nhds_zero_of_abs_lt_one {r : ℝ} (h : |r| < 1) :

section Geometric

variable {K : Type*} [NormedField K] {ξ : K}
variable {K : Type*} [NormedDivisionRing K] {ξ : K}

theorem hasSum_geometric_of_norm_lt_one (h : ‖ξ‖ < 1) : HasSum (fun n : ℕ ↦ ξ ^ n) (1 - ξ)⁻¹ := by
have xi_ne_one : ξ ≠ 1 := by
Expand Down Expand Up @@ -360,7 +361,7 @@ theorem summable_pow_mul_geometric_of_norm_lt_one {R : Type*} [NormedRing R] [Co
summable_pow_mul_geometric_of_norm_lt_one

/-- If `‖r‖ < 1`, then `∑' n : ℕ, n * r ^ n = r / (1 - r) ^ 2`, `HasSum` version. -/
theorem hasSum_coe_mul_geometric_of_norm_lt_one {𝕜 : Type*} [NormedField 𝕜] [CompleteSpace 𝕜]
theorem hasSum_coe_mul_geometric_of_norm_lt_one {𝕜 : Type*} [NormedDivisionRing 𝕜] [CompleteSpace 𝕜]
{r : 𝕜} (hr : ‖r‖ < 1) : HasSum (fun n ↦ n * r ^ n : ℕ → 𝕜) (r / (1 - r) ^ 2) := by
have A : Summable (fun n ↦ (n : 𝕜) * r ^ n : ℕ → 𝕜) := by
simpa only [pow_one] using summable_pow_mul_geometric_of_norm_lt_one 1 hr
Expand All @@ -370,22 +371,28 @@ theorem hasSum_coe_mul_geometric_of_norm_lt_one {𝕜 : Type*} [NormedField 𝕜
rintro rfl
simp [lt_irrefl] at hr
set s : 𝕜 := ∑' n : ℕ, n * r ^ n
have : Commute (1 - r) s :=
.tsum_right _ fun _ =>
.sub_left (.one_left _) (.mul_right (Nat.commute_cast _ _) (.pow_right (.refl _) _))
calc
s = (1 - r) * s / (1 - r) := (mul_div_cancel_left₀ _ (sub_ne_zero.2 hr'.symm)).symm
s = s * (1 - r) / (1 - r) := (mul_div_cancel_right₀ _ (sub_ne_zero.2 hr'.symm)).symm
_ = (1 - r) * s / (1 - r) := by rw [this.eq]
_ = (s - r * s) / (1 - r) := by rw [_root_.sub_mul, one_mul]
_ = (((0 : ℕ) * r ^ 0 + ∑' n : ℕ, (n + 1 : ℕ) * r ^ (n + 1)) - r * s) / (1 - r) := by
rw [← tsum_eq_zero_add A]
_ = ((r * ∑' n : ℕ, (n + 1) * r ^ n) - r * s) / (1 - r) := by
simp [_root_.pow_succ', mul_left_comm _ r, _root_.tsum_mul_left]
_ = ((r * ∑' n : ℕ, ↑(n + 1) * r ^ n) - r * s) / (1 - r) := by
simp only [cast_zero, pow_zero, mul_one, _root_.pow_succ', (Nat.cast_commute _ r).left_comm,
_root_.tsum_mul_left, zero_add]
_ = r / (1 - r) ^ 2 := by
simp [add_mul, tsum_add A B.summable, mul_add, B.tsum_eq, ← div_eq_mul_inv, sq, div_div]
simp [add_mul, tsum_add A B.summable, mul_add, B.tsum_eq, ← div_eq_mul_inv, sq,
div_mul_eq_div_div_swap]
#align has_sum_coe_mul_geometric_of_norm_lt_1 hasSum_coe_mul_geometric_of_norm_lt_one
@[deprecated] alias hasSum_coe_mul_geometric_of_norm_lt_1 :=
hasSum_coe_mul_geometric_of_norm_lt_one

/-- If `‖r‖ < 1`, then `∑' n : ℕ, n * r ^ n = r / (1 - r) ^ 2`. -/
theorem tsum_coe_mul_geometric_of_norm_lt_one {𝕜 : Type*} [NormedField 𝕜] [CompleteSpace 𝕜] {r : 𝕜}
(hr : ‖r‖ < 1) : (∑' n : ℕ, n * r ^ n : 𝕜) = r / (1 - r) ^ 2 :=
theorem tsum_coe_mul_geometric_of_norm_lt_one {𝕜 : Type*} [NormedDivisionRing 𝕜] [CompleteSpace 𝕜]
{r : 𝕜} (hr : ‖r‖ < 1) : (∑' n : ℕ, n * r ^ n : 𝕜) = r / (1 - r) ^ 2 :=
(hasSum_coe_mul_geometric_of_norm_lt_one hr).tsum_eq
#align tsum_coe_mul_geometric_of_norm_lt_1 tsum_coe_mul_geometric_of_norm_lt_one
@[deprecated] alias tsum_coe_mul_geometric_of_norm_lt_1 := tsum_coe_mul_geometric_of_norm_lt_one
Expand Down
18 changes: 12 additions & 6 deletions Mathlib/Topology/ContinuousFunction/Units.lean
Expand Up @@ -103,17 +103,23 @@ end NormedRing

section NormedField

variable [NormedField 𝕜] [CompleteSpace 𝕜]
variable [NormedField 𝕜] [NormedDivisionRing R] [Algebra 𝕜 R] [CompleteSpace R]

theorem isUnit_iff_forall_ne_zero (f : C(X, 𝕜)) : IsUnit f ↔ ∀ x, f x ≠ 0 := by
theorem isUnit_iff_forall_ne_zero (f : C(X, R)) : IsUnit f ↔ ∀ x, f x ≠ 0 := by
simp_rw [f.isUnit_iff_forall_isUnit, isUnit_iff_ne_zero]
#align continuous_map.is_unit_iff_forall_ne_zero ContinuousMap.isUnit_iff_forall_ne_zero

theorem spectrum_eq_range (f : C(X, 𝕜)) : spectrum 𝕜 f = Set.range f := by
theorem spectrum_eq_preimage_range (f : C(X, R)) :
spectrum 𝕜 f = algebraMap _ _ ⁻¹' Set.range f := by
ext x
simp only [spectrum.mem_iff, isUnit_iff_forall_ne_zero, not_forall, coe_sub, Pi.sub_apply,
algebraMap_apply, Algebra.id.smul_eq_mul, mul_one, Classical.not_not, Set.mem_range,
sub_eq_zero, @eq_comm _ x _]
simp only [spectrum.mem_iff, isUnit_iff_forall_ne_zero, not_forall, sub_apply,
algebraMap_apply, mul_one, Classical.not_not, Set.mem_range,
sub_eq_zero, @eq_comm _ (x • 1 : R) _, Set.mem_preimage, Algebra.algebraMap_eq_smul_one,
smul_apply, one_apply]

theorem spectrum_eq_range [CompleteSpace 𝕜] (f : C(X, 𝕜)) : spectrum 𝕜 f = Set.range f := by
rw [spectrum_eq_preimage_range, Algebra.id.map_eq_id]
exact Set.preimage_id
#align continuous_map.spectrum_eq_range ContinuousMap.spectrum_eq_range

end NormedField
Expand Down

0 comments on commit 4e7ba67

Please sign in to comment.