Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - chore(Analysis/InnerProductSpace): weaken assumptions to SeminormedAddCommGroup #17007

Closed
wants to merge 9 commits into from
196 changes: 93 additions & 103 deletions Mathlib/Analysis/InnerProductSpace/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1003,27 +1003,12 @@ theorem coe_basisOfOrthonormalOfCardEqFinrank [Fintype ΞΉ] [Nonempty ΞΉ] {v : ΞΉ
(basisOfOrthonormalOfCardEqFinrank hv card_eq : ΞΉ β†’ E) = v :=
coe_basisOfLinearIndependentOfCardEqFinrank _ _

end OrthonormalSets_Seminormed

section OrthonormalSets

variable [NormedAddCommGroup E] [InnerProductSpace π•œ E]
variable [NormedAddCommGroup F] [InnerProductSpace ℝ F]
variable {ΞΉ : Type*}

local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y

local notation "IK" => @RCLike.I π•œ _

local postfix:90 "†" => starRingEnd _

theorem Orthonormal.ne_zero {v : ΞΉ β†’ E} (hv : Orthonormal π•œ v) (i : ΞΉ) : v i β‰  0 := by
have : β€–v iβ€– β‰  0 := by
rw [hv.1 i]
norm_num
simpa using this
refine ne_of_apply_ne norm ?_
rw [hv.1 i, norm_zero]
norm_num

end OrthonormalSets
end OrthonormalSets_Seminormed

section Norm_Seminormed

Expand Down Expand Up @@ -1198,9 +1183,9 @@ instance (priority := 100) InnerProductSpace.toUniformConvexSpace : UniformConve
ring_nf
exact sub_le_sub_left (pow_le_pow_left hΡ.le hxy _) 4⟩

section Complex
section Complex_Seminormed

variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace β„‚ V]
variable {V : Type*} [SeminormedAddCommGroup V] [InnerProductSpace β„‚ V]

/-- A complex polarization identity, with a linear map
-/
Expand All @@ -1226,6 +1211,12 @@ theorem inner_map_polarization' (T : V β†’β‚—[β„‚] V) (x y : V) :
mul_add, ← mul_assoc, mul_neg, neg_neg, sub_neg_eq_add, one_mul, neg_one_mul, mul_sub, sub_sub]
ring

end Complex_Seminormed

section Complex

variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace β„‚ V]

/-- A linear map `T` is zero, if and only if the identity `βŸͺT x, x⟫_β„‚ = 0` holds for all `x`.
-/
theorem inner_map_self_eq_zero (T : V β†’β‚—[β„‚] V) : (βˆ€ x : V, βŸͺT x, x⟫_β„‚ = 0) ↔ T = 0 := by
Expand Down Expand Up @@ -1551,7 +1542,7 @@ variable {π•œ}

namespace ContinuousLinearMap

variable {E' : Type*} [NormedAddCommGroup E'] [InnerProductSpace π•œ E']
variable {E' : Type*} [SeminormedAddCommGroup E'] [InnerProductSpace π•œ E']

-- Note: odd and expensive build behavior is explicitly turned off using `noncomputable`
/-- Given `f : E β†’L[π•œ] E'`, construct the continuous sesquilinear form `fun x y ↦ βŸͺx, A y⟫`, given
Expand All @@ -1576,6 +1567,81 @@ theorem toSesqForm_apply_norm_le {f : E β†’L[π•œ] E'} {v : E'} : β€–toSesqForm

end ContinuousLinearMap

section

variable {ΞΉ : Type*} {ΞΉ' : Type*} {ΞΉ'' : Type*}
variable {E' : Type*} [SeminormedAddCommGroup E'] [InnerProductSpace π•œ E']
variable {E'' : Type*} [SeminormedAddCommGroup E''] [InnerProductSpace π•œ E'']

@[simp]
theorem Orthonormal.equiv_refl {v : Basis ΞΉ π•œ E} (hv : Orthonormal π•œ v) :
hv.equiv hv (Equiv.refl ΞΉ) = LinearIsometryEquiv.refl π•œ E :=
v.ext_linearIsometryEquiv fun i => by
simp only [Orthonormal.equiv_apply, Equiv.coe_refl, id, LinearIsometryEquiv.coe_refl]

@[simp]
theorem Orthonormal.equiv_symm {v : Basis ΞΉ π•œ E} (hv : Orthonormal π•œ v) {v' : Basis ΞΉ' π•œ E'}
(hv' : Orthonormal π•œ v') (e : ΞΉ ≃ ΞΉ') : (hv.equiv hv' e).symm = hv'.equiv hv e.symm :=
v'.ext_linearIsometryEquiv fun i =>
(hv.equiv hv' e).injective <| by
simp only [LinearIsometryEquiv.apply_symm_apply, Orthonormal.equiv_apply, e.apply_symm_apply]

end

variable (π•œ)

/-- `innerSL` is an isometry. Note that the associated `LinearIsometry` is defined in
`InnerProductSpace.Dual` as `toDualMap`. -/
@[simp]
theorem innerSL_apply_norm (x : E) : β€–innerSL π•œ xβ€– = β€–xβ€– := by
refine
le_antisymm ((innerSL π•œ x).opNorm_le_bound (norm_nonneg _) fun y => norm_inner_le_norm _ _) ?_
rcases (norm_nonneg x).eq_or_gt with (h | h)
Β· simp [h]
Β· refine (mul_le_mul_right h).mp ?_
calc
β€–xβ€– * β€–xβ€– = β€–(βŸͺx, x⟫ : π•œ)β€– := by
rw [← sq, inner_self_eq_norm_sq_to_K, norm_pow, norm_ofReal, abs_norm]
_ ≀ β€–innerSL π•œ xβ€– * β€–xβ€– := (innerSL π•œ x).le_opNorm _

lemma norm_innerSL_le : β€–innerSL π•œ (E := E)β€– ≀ 1 :=
ContinuousLinearMap.opNorm_le_bound _ zero_le_one (by simp)

/-- When an inner product space `E` over `π•œ` is considered as a real normed space, its inner
product satisfies `IsBoundedBilinearMap`.

In order to state these results, we need a `NormedSpace ℝ E` instance. We will later establish
such an instance by restriction-of-scalars, `InnerProductSpace.rclikeToReal π•œ E`, but this
instance may be not definitionally equal to some other β€œnatural” instance. So, we assume
`[NormedSpace ℝ E]`.
-/
theorem _root_.isBoundedBilinearMap_inner [NormedSpace ℝ E] [IsScalarTower ℝ π•œ E] :
IsBoundedBilinearMap ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ :=
{ add_left := inner_add_left
smul_left := fun r x y => by
simp only [← algebraMap_smul π•œ r x, algebraMap_eq_ofReal, inner_smul_real_left]
add_right := inner_add_right
smul_right := fun r x y => by
simp only [← algebraMap_smul π•œ r y, algebraMap_eq_ofReal, inner_smul_real_right]
bound :=
⟨1, zero_lt_one, fun x y => by
rw [one_mul]
exact norm_inner_le_norm x y⟩ }

/-- The inner product of two weighted sums, where the weights in each
sum add to 0, in terms of the norms of pairwise differences. -/
theorem inner_sum_smul_sum_smul_of_sum_eq_zero {ι₁ : Type*} {s₁ : Finset ι₁} {w₁ : ι₁ β†’ ℝ}
(v₁ : ι₁ β†’ F) (h₁ : βˆ‘ i ∈ s₁, w₁ i = 0) {ΞΉβ‚‚ : Type*} {sβ‚‚ : Finset ΞΉβ‚‚} {wβ‚‚ : ΞΉβ‚‚ β†’ ℝ}
(vβ‚‚ : ΞΉβ‚‚ β†’ F) (hβ‚‚ : βˆ‘ i ∈ sβ‚‚, wβ‚‚ i = 0) :
βŸͺβˆ‘ i₁ ∈ s₁, w₁ i₁ β€’ v₁ i₁, βˆ‘ iβ‚‚ ∈ sβ‚‚, wβ‚‚ iβ‚‚ β€’ vβ‚‚ iβ‚‚βŸ«_ℝ =
(-βˆ‘ i₁ ∈ s₁, βˆ‘ iβ‚‚ ∈ sβ‚‚, w₁ i₁ * wβ‚‚ iβ‚‚ * (β€–v₁ i₁ - vβ‚‚ iβ‚‚β€– * β€–v₁ i₁ - vβ‚‚ iβ‚‚β€–)) / 2 := by
simp_rw [sum_inner, inner_sum, real_inner_smul_left, real_inner_smul_right,
real_inner_eq_norm_mul_self_add_norm_mul_self_sub_norm_sub_mul_self_div_two, ← div_sub_div_same,
← div_add_div_same, mul_sub_left_distrib, left_distrib, Finset.sum_sub_distrib,
Finset.sum_add_distrib, ← Finset.mul_sum, ← Finset.sum_mul, h₁, hβ‚‚, zero_mul,
mul_zero, Finset.sum_const_zero, zero_add, zero_sub, Finset.mul_sum, neg_div,
Finset.sum_div, mul_div_assoc, mul_assoc]

end Norm_Seminormed

section Norm
Expand Down Expand Up @@ -1611,27 +1677,6 @@ theorem dist_div_norm_sq_smul {x y : F} (hx : x β‰  0) (hy : y β‰  0) (R : ℝ)
_ = R ^ 2 / (β€–xβ€– * β€–yβ€–) * dist x y := by
rw [sqrt_mul, sqrt_sq, sqrt_sq, dist_eq_norm] <;> positivity

section

variable {ΞΉ : Type*} {ΞΉ' : Type*} {ΞΉ'' : Type*}
variable {E' : Type*} [NormedAddCommGroup E'] [InnerProductSpace π•œ E']
variable {E'' : Type*} [NormedAddCommGroup E''] [InnerProductSpace π•œ E'']

@[simp]
theorem Orthonormal.equiv_refl {v : Basis ΞΉ π•œ E} (hv : Orthonormal π•œ v) :
hv.equiv hv (Equiv.refl ΞΉ) = LinearIsometryEquiv.refl π•œ E :=
v.ext_linearIsometryEquiv fun i => by
simp only [Orthonormal.equiv_apply, Equiv.coe_refl, id, LinearIsometryEquiv.coe_refl]

@[simp]
theorem Orthonormal.equiv_symm {v : Basis ΞΉ π•œ E} (hv : Orthonormal π•œ v) {v' : Basis ΞΉ' π•œ E'}
(hv' : Orthonormal π•œ v') (e : ΞΉ ≃ ΞΉ') : (hv.equiv hv' e).symm = hv'.equiv hv e.symm :=
v'.ext_linearIsometryEquiv fun i =>
(hv.equiv hv' e).injective <| by
simp only [LinearIsometryEquiv.apply_symm_apply, Orthonormal.equiv_apply, e.apply_symm_apply]

end

/-- The inner product of a nonzero vector with a nonzero multiple of
itself, divided by the product of their norms, has absolute value
1. -/
Expand Down Expand Up @@ -1805,62 +1850,6 @@ theorem eq_of_norm_le_re_inner_eq_norm_sq {x y : E} (hle : β€–xβ€– ≀ β€–yβ€–)
have Hβ‚‚ : re βŸͺy, x⟫ = β€–yβ€– ^ 2 := by rwa [← inner_conj_symm, conj_re]
simpa [inner_sub_left, inner_sub_right, ← norm_sq_eq_inner, h, Hβ‚‚] using H₁

/-- The inner product of two weighted sums, where the weights in each
sum add to 0, in terms of the norms of pairwise differences. -/
theorem inner_sum_smul_sum_smul_of_sum_eq_zero {ι₁ : Type*} {s₁ : Finset ι₁} {w₁ : ι₁ β†’ ℝ}
(v₁ : ι₁ β†’ F) (h₁ : βˆ‘ i ∈ s₁, w₁ i = 0) {ΞΉβ‚‚ : Type*} {sβ‚‚ : Finset ΞΉβ‚‚} {wβ‚‚ : ΞΉβ‚‚ β†’ ℝ}
(vβ‚‚ : ΞΉβ‚‚ β†’ F) (hβ‚‚ : βˆ‘ i ∈ sβ‚‚, wβ‚‚ i = 0) :
βŸͺβˆ‘ i₁ ∈ s₁, w₁ i₁ β€’ v₁ i₁, βˆ‘ iβ‚‚ ∈ sβ‚‚, wβ‚‚ iβ‚‚ β€’ vβ‚‚ iβ‚‚βŸ«_ℝ =
(-βˆ‘ i₁ ∈ s₁, βˆ‘ iβ‚‚ ∈ sβ‚‚, w₁ i₁ * wβ‚‚ iβ‚‚ * (β€–v₁ i₁ - vβ‚‚ iβ‚‚β€– * β€–v₁ i₁ - vβ‚‚ iβ‚‚β€–)) / 2 := by
simp_rw [sum_inner, inner_sum, real_inner_smul_left, real_inner_smul_right,
real_inner_eq_norm_mul_self_add_norm_mul_self_sub_norm_sub_mul_self_div_two, ← div_sub_div_same,
← div_add_div_same, mul_sub_left_distrib, left_distrib, Finset.sum_sub_distrib,
Finset.sum_add_distrib, ← Finset.mul_sum, ← Finset.sum_mul, h₁, hβ‚‚, zero_mul,
mul_zero, Finset.sum_const_zero, zero_add, zero_sub, Finset.mul_sum, neg_div,
Finset.sum_div, mul_div_assoc, mul_assoc]

variable (π•œ)

/-- `innerSL` is an isometry. Note that the associated `LinearIsometry` is defined in
`InnerProductSpace.Dual` as `toDualMap`. -/
@[simp]
theorem innerSL_apply_norm (x : E) : β€–innerSL π•œ xβ€– = β€–xβ€– := by
refine
le_antisymm ((innerSL π•œ x).opNorm_le_bound (norm_nonneg _) fun y => norm_inner_le_norm _ _) ?_
rcases eq_or_ne x 0 with (rfl | h)
Β· simp
Β· refine (mul_le_mul_right (norm_pos_iff.2 h)).mp ?_
calc
β€–xβ€– * β€–xβ€– = β€–(βŸͺx, x⟫ : π•œ)β€– := by
rw [← sq, inner_self_eq_norm_sq_to_K, norm_pow, norm_ofReal, abs_norm]
_ ≀ β€–innerSL π•œ xβ€– * β€–xβ€– := (innerSL π•œ x).le_opNorm _

lemma norm_innerSL_le : β€–innerSL π•œ (E := E)β€– ≀ 1 :=
ContinuousLinearMap.opNorm_le_bound _ zero_le_one (by simp)

variable {π•œ}

/-- When an inner product space `E` over `π•œ` is considered as a real normed space, its inner
product satisfies `IsBoundedBilinearMap`.

In order to state these results, we need a `NormedSpace ℝ E` instance. We will later establish
such an instance by restriction-of-scalars, `InnerProductSpace.rclikeToReal π•œ E`, but this
instance may be not definitionally equal to some other β€œnatural” instance. So, we assume
`[NormedSpace ℝ E]`.
-/
theorem _root_.isBoundedBilinearMap_inner [NormedSpace ℝ E] :
IsBoundedBilinearMap ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ :=
{ add_left := inner_add_left
smul_left := fun r x y => by
simp only [← algebraMap_smul π•œ r x, algebraMap_eq_ofReal, inner_smul_real_left]
add_right := inner_add_right
smul_right := fun r x y => by
simp only [← algebraMap_smul π•œ r y, algebraMap_eq_ofReal, inner_smul_real_right]
bound :=
⟨1, zero_lt_one, fun x y => by
rw [one_mul]
exact norm_inner_le_norm x y⟩ }

end Norm

section BesselsInequality
Expand Down Expand Up @@ -2269,7 +2258,7 @@ end RCLikeToReal

section Continuous

variable [NormedAddCommGroup E] [InnerProductSpace π•œ E]
variable [SeminormedAddCommGroup E] [InnerProductSpace π•œ E]

local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y

Expand All @@ -2284,7 +2273,8 @@ local postfix:90 "†" => starRingEnd _

theorem continuous_inner : Continuous fun p : E Γ— E => βŸͺp.1, p.2⟫ :=
letI : InnerProductSpace ℝ E := InnerProductSpace.rclikeToReal π•œ E
isBoundedBilinearMap_inner.continuous
letI : IsScalarTower ℝ π•œ E := RestrictScalars.isScalarTower _ _ _
(isBoundedBilinearMap_inner π•œ).continuous

variable {Ξ± : Type*}

Expand Down Expand Up @@ -2334,7 +2324,7 @@ end ReApplyInnerSelf

section ReApplyInnerSelf_Seminormed

variable [NormedAddCommGroup E] [InnerProductSpace π•œ E]
variable [SeminormedAddCommGroup E] [InnerProductSpace π•œ E]

local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y

Expand All @@ -2356,7 +2346,7 @@ end ReApplyInnerSelf_Seminormed

section UniformSpace.Completion

variable [NormedAddCommGroup E] [InnerProductSpace π•œ E]
variable [SeminormedAddCommGroup E] [InnerProductSpace π•œ E]

local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y

Expand Down
Loading
Loading