fact stringlengths 6 3.84k | type stringclasses 11 values | library stringclasses 32 values | imports listlengths 1 14 | filename stringlengths 20 95 | symbolic_name stringlengths 1 90 | docstring stringlengths 7 20k ⌀ |
|---|---|---|---|---|---|---|
norm_map_eq (A : Matrix m n α) (f : α → β) (hf : ∀ a, ‖f a‖ = ‖a‖) : ‖A.map f‖ = ‖A‖ :=
(congr_arg ((↑) : ℝ≥0 → ℝ) <| nnnorm_map_eq A f fun a => Subtype.ext <| hf a :)
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | norm_map_eq | null |
nnnorm_transpose (A : Matrix m n α) : ‖Aᵀ‖₊ = ‖A‖₊ :=
Finset.sup_comm _ _ _
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | nnnorm_transpose | null |
norm_transpose (A : Matrix m n α) : ‖Aᵀ‖ = ‖A‖ :=
congr_arg ((↑) : ℝ≥0 → ℝ) <| nnnorm_transpose A
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | norm_transpose | null |
nnnorm_conjTranspose [StarAddMonoid α] [NormedStarGroup α] (A : Matrix m n α) :
‖Aᴴ‖₊ = ‖A‖₊ :=
(nnnorm_map_eq _ _ nnnorm_star).trans A.nnnorm_transpose
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | nnnorm_conjTranspose | null |
norm_conjTranspose [StarAddMonoid α] [NormedStarGroup α] (A : Matrix m n α) : ‖Aᴴ‖ = ‖A‖ :=
congr_arg ((↑) : ℝ≥0 → ℝ) <| nnnorm_conjTranspose A | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | norm_conjTranspose | null |
@[simp]
nnnorm_replicateCol (v : m → α) : ‖replicateCol ι v‖₊ = ‖v‖₊ := by
simp [nnnorm_def, Pi.nnnorm_def]
@[deprecated (since := "2025-03-20")] alias nnnorm_col := nnnorm_replicateCol
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | nnnorm_replicateCol | null |
norm_replicateCol (v : m → α) : ‖replicateCol ι v‖ = ‖v‖ :=
congr_arg ((↑) : ℝ≥0 → ℝ) <| nnnorm_replicateCol v
@[deprecated (since := "2025-03-20")] alias norm_col := norm_replicateCol
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | norm_replicateCol | null |
nnnorm_replicateRow (v : n → α) : ‖replicateRow ι v‖₊ = ‖v‖₊ := by
simp [nnnorm_def, Pi.nnnorm_def]
@[deprecated (since := "2025-03-20")] alias nnnorm_row := nnnorm_replicateRow
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | nnnorm_replicateRow | null |
norm_replicateRow (v : n → α) : ‖replicateRow ι v‖ = ‖v‖ :=
congr_arg ((↑) : ℝ≥0 → ℝ) <| nnnorm_replicateRow v
@[deprecated (since := "2025-03-20")] alias norm_row := norm_replicateRow
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | norm_replicateRow | null |
nnnorm_diagonal [DecidableEq n] (v : n → α) : ‖diagonal v‖₊ = ‖v‖₊ := by
simp_rw [nnnorm_def, Pi.nnnorm_def]
congr 1 with i : 1
refine le_antisymm (Finset.sup_le fun j hj => ?_) ?_
· obtain rfl | hij := eq_or_ne i j
· rw [diagonal_apply_eq]
· rw [diagonal_apply_ne _ hij, nnnorm_zero]
exact zero_le _
· refine Eq.trans_le ?_ (Finset.le_sup (Finset.mem_univ i))
rw [diagonal_apply_eq]
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | nnnorm_diagonal | null |
norm_diagonal [DecidableEq n] (v : n → α) : ‖diagonal v‖ = ‖v‖ :=
congr_arg ((↑) : ℝ≥0 → ℝ) <| nnnorm_diagonal v | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | norm_diagonal | null |
protected normedAddCommGroup [NormedAddCommGroup α] : NormedAddCommGroup (Matrix m n α) :=
Pi.normedAddCommGroup | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | normedAddCommGroup | Note this is safe as an instance as it carries no data. -/
instance [Nonempty n] [DecidableEq n] [One α] [NormOneClass α] : NormOneClass (Matrix n n α) :=
⟨(norm_diagonal _).trans <| norm_one⟩
end SeminormedAddCommGroup
/-- Normed group instance (using sup norm of sup norm) for matrices over a normed group. Not
declared as an instance because there are several natural choices for defining the norm of a
matrix. |
protected isBoundedSMul [SeminormedRing R] [SeminormedAddCommGroup α] [Module R α]
[IsBoundedSMul R α] : IsBoundedSMul R (Matrix m n α) :=
Pi.instIsBoundedSMul
@[deprecated (since := "2025-03-10")] protected alias boundedSMul := Matrix.isBoundedSMul | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | isBoundedSMul | This applies to the sup norm of sup norm. |
protected normSMulClass [SeminormedRing R] [SeminormedAddCommGroup α] [Module R α]
[NormSMulClass R α] : NormSMulClass R (Matrix m n α) :=
Pi.instNormSMulClass
variable [NormedField R] [SeminormedAddCommGroup α] [NormedSpace R α] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | normSMulClass | This applies to the sup norm of sup norm. |
protected normedSpace : NormedSpace R (Matrix m n α) :=
Pi.normedSpace | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | normedSpace | Normed space instance (using sup norm of sup norm) for matrices over a normed space. Not
declared as an instance because there are several natural choices for defining the norm of a
matrix. |
@[local instance]
protected linftyOpSeminormedAddCommGroup [SeminormedAddCommGroup α] :
SeminormedAddCommGroup (Matrix m n α) :=
(by infer_instance : SeminormedAddCommGroup (m → PiLp 1 fun j : n => α)) | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linftyOpSeminormedAddCommGroup | Seminormed group instance (using sup norm of L1 norm) for matrices over a seminormed group. Not
declared as an instance because there are several natural choices for defining the norm of a
matrix. |
@[local instance]
protected linftyOpNormedAddCommGroup [NormedAddCommGroup α] :
NormedAddCommGroup (Matrix m n α) :=
(by infer_instance : NormedAddCommGroup (m → PiLp 1 fun j : n => α)) | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linftyOpNormedAddCommGroup | Normed group instance (using sup norm of L1 norm) for matrices over a normed ring. Not
declared as an instance because there are several natural choices for defining the norm of a
matrix. |
@[local instance]
protected linftyOpIsBoundedSMul
[SeminormedRing R] [SeminormedAddCommGroup α] [Module R α] [IsBoundedSMul R α] :
IsBoundedSMul R (Matrix m n α) :=
(by infer_instance : IsBoundedSMul R (m → PiLp 1 fun j : n => α)) | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linftyOpIsBoundedSMul | This applies to the sup norm of L1 norm. |
@[local instance]
protected linftyOpNormSMulClass
[SeminormedRing R] [SeminormedAddCommGroup α] [Module R α] [NormSMulClass R α] :
NormSMulClass R (Matrix m n α) :=
(by infer_instance : NormSMulClass R (m → PiLp 1 fun j : n => α)) | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linftyOpNormSMulClass | This applies to the sup norm of L1 norm. |
@[local instance]
protected linftyOpNormedSpace [NormedField R] [SeminormedAddCommGroup α] [NormedSpace R α] :
NormedSpace R (Matrix m n α) :=
(by infer_instance : NormedSpace R (m → PiLp 1 fun j : n => α)) | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linftyOpNormedSpace | Normed space instance (using sup norm of L1 norm) for matrices over a normed space. Not
declared as an instance because there are several natural choices for defining the norm of a
matrix. |
linfty_opNorm_def (A : Matrix m n α) :
‖A‖ = ((Finset.univ : Finset m).sup fun i : m => ∑ j : n, ‖A i j‖₊ : ℝ≥0) := by
change ‖fun i => toLp 1 (A i)‖ = _
simp [Pi.norm_def, PiLp.nnnorm_eq_of_L1] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linfty_opNorm_def | null |
linfty_opNNNorm_def (A : Matrix m n α) :
‖A‖₊ = (Finset.univ : Finset m).sup fun i : m => ∑ j : n, ‖A i j‖₊ :=
Subtype.ext <| linfty_opNorm_def A
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linfty_opNNNorm_def | null |
linfty_opNNNorm_replicateCol (v : m → α) : ‖replicateCol ι v‖₊ = ‖v‖₊ := by
rw [linfty_opNNNorm_def, Pi.nnnorm_def]
simp
@[deprecated (since := "2025-03-20")] alias linfty_opNNNorm_col := linfty_opNNNorm_replicateCol
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linfty_opNNNorm_replicateCol | null |
linfty_opNorm_replicateCol (v : m → α) : ‖replicateCol ι v‖ = ‖v‖ :=
congr_arg ((↑) : ℝ≥0 → ℝ) <| linfty_opNNNorm_replicateCol v
@[deprecated (since := "2025-03-20")] alias linfty_opNorm_col := linfty_opNorm_replicateCol
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linfty_opNorm_replicateCol | null |
linfty_opNNNorm_replicateRow (v : n → α) : ‖replicateRow ι v‖₊ = ∑ i, ‖v i‖₊ := by
simp [linfty_opNNNorm_def]
@[deprecated (since := "2025-03-20")] alias linfty_opNNNorm_row := linfty_opNNNorm_replicateRow
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linfty_opNNNorm_replicateRow | null |
linfty_opNorm_replicateRow (v : n → α) : ‖replicateRow ι v‖ = ∑ i, ‖v i‖ :=
(congr_arg ((↑) : ℝ≥0 → ℝ) <| linfty_opNNNorm_replicateRow v).trans <| by simp [NNReal.coe_sum]
@[deprecated (since := "2025-03-20")] alias linfty_opNorm_row := linfty_opNNNorm_replicateRow
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linfty_opNorm_replicateRow | null |
linfty_opNNNorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖₊ = ‖v‖₊ := by
rw [linfty_opNNNorm_def, Pi.nnnorm_def]
congr 1 with i : 1
refine (Finset.sum_eq_single_of_mem _ (Finset.mem_univ i) fun j _hj hij => ?_).trans ?_
· rw [diagonal_apply_ne' _ hij, nnnorm_zero]
· rw [diagonal_apply_eq]
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linfty_opNNNorm_diagonal | null |
linfty_opNorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖ = ‖v‖ :=
congr_arg ((↑) : ℝ≥0 → ℝ) <| linfty_opNNNorm_diagonal v | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linfty_opNorm_diagonal | null |
linfty_opNNNorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊ := by
simp_rw [linfty_opNNNorm_def, Matrix.mul_apply]
calc
(Finset.univ.sup fun i => ∑ k, ‖∑ j, A i j * B j k‖₊) ≤
Finset.univ.sup fun i => ∑ k, ∑ j, ‖A i j‖₊ * ‖B j k‖₊ :=
Finset.sup_mono_fun fun i _hi =>
Finset.sum_le_sum fun k _hk => nnnorm_sum_le_of_le _ fun j _hj => nnnorm_mul_le _ _
_ = Finset.univ.sup fun i => ∑ j, ‖A i j‖₊ * ∑ k, ‖B j k‖₊ := by
simp_rw [@Finset.sum_comm m, Finset.mul_sum]
_ ≤ Finset.univ.sup fun i => ∑ j, ‖A i j‖₊ * Finset.univ.sup fun i => ∑ j, ‖B i j‖₊ := by
refine Finset.sup_mono_fun fun i _hi => ?_
gcongr with j hj
exact Finset.le_sup (f := fun i ↦ ∑ k : n, ‖B i k‖₊) hj
_ ≤ (Finset.univ.sup fun i => ∑ j, ‖A i j‖₊) * Finset.univ.sup fun i => ∑ j, ‖B i j‖₊ := by
simp_rw [← Finset.sum_mul, ← NNReal.finset_sup_mul]
rfl | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linfty_opNNNorm_mul | null |
linfty_opNorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖ ≤ ‖A‖ * ‖B‖ :=
linfty_opNNNorm_mul _ _ | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linfty_opNorm_mul | null |
linfty_opNNNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A *ᵥ v‖₊ ≤ ‖A‖₊ * ‖v‖₊ := by
rw [← linfty_opNNNorm_replicateCol (ι := Fin 1) (A *ᵥ v),
← linfty_opNNNorm_replicateCol v (ι := Fin 1)]
exact linfty_opNNNorm_mul A (replicateCol (Fin 1) v) | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linfty_opNNNorm_mulVec | null |
linfty_opNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A *ᵥ v‖ ≤ ‖A‖ * ‖v‖ :=
linfty_opNNNorm_mulVec _ _ | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linfty_opNorm_mulVec | null |
@[local instance]
protected linftyOpNonUnitalSemiNormedRing [NonUnitalSeminormedRing α] :
NonUnitalSeminormedRing (Matrix n n α) :=
{ Matrix.linftyOpSeminormedAddCommGroup, Matrix.instNonUnitalRing with
norm_mul_le := linfty_opNorm_mul } | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linftyOpNonUnitalSemiNormedRing | Seminormed non-unital ring instance (using sup norm of L1 norm) for matrices over a semi normed
non-unital ring. Not declared as an instance because there are several natural choices for defining
the norm of a matrix. |
linfty_opNormOneClass [SeminormedRing α] [NormOneClass α] [DecidableEq n] [Nonempty n] :
NormOneClass (Matrix n n α) where norm_one := (linfty_opNorm_diagonal _).trans norm_one | instance | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linfty_opNormOneClass | The `L₁-L∞` norm preserves one on non-empty matrices. Note this is safe as an instance, as it
carries no data. |
@[local instance]
protected linftyOpSemiNormedRing [SeminormedRing α] [DecidableEq n] :
SeminormedRing (Matrix n n α) :=
{ Matrix.linftyOpNonUnitalSemiNormedRing, Matrix.instRing with } | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linftyOpSemiNormedRing | Seminormed ring instance (using sup norm of L1 norm) for matrices over a semi normed ring. Not
declared as an instance because there are several natural choices for defining the norm of a
matrix. |
@[local instance]
protected linftyOpNonUnitalNormedRing [NonUnitalNormedRing α] :
NonUnitalNormedRing (Matrix n n α) :=
{ Matrix.linftyOpNonUnitalSemiNormedRing with
eq_of_dist_eq_zero := eq_of_dist_eq_zero } | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linftyOpNonUnitalNormedRing | Normed non-unital ring instance (using sup norm of L1 norm) for matrices over a normed
non-unital ring. Not declared as an instance because there are several natural choices for defining
the norm of a matrix. |
@[local instance]
protected linftyOpNormedRing [NormedRing α] [DecidableEq n] : NormedRing (Matrix n n α) :=
{ Matrix.linftyOpSemiNormedRing with
eq_of_dist_eq_zero := eq_of_dist_eq_zero } | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linftyOpNormedRing | Normed ring instance (using sup norm of L1 norm) for matrices over a normed ring. Not
declared as an instance because there are several natural choices for defining the norm of a
matrix. |
@[local instance]
protected linftyOpNormedAlgebra [NormedField R] [SeminormedRing α] [NormedAlgebra R α]
[DecidableEq n] : NormedAlgebra R (Matrix n n α) :=
{ Matrix.linftyOpNormedSpace, Matrix.instAlgebra with } | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linftyOpNormedAlgebra | Normed algebra instance (using sup norm of L1 norm) for matrices over a normed algebra. Not
declared as an instance because there are several natural choices for defining the norm of a
matrix. |
private unitOf (a : α) : α := by classical exact if a = 0 then 1 else ‖a‖ • a⁻¹ | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | unitOf | Auxiliary construction; an element of norm 1 such that `a * unitOf a = ‖a‖`. |
private norm_unitOf (a : α) : ‖unitOf a‖₊ = 1 := by
rw [unitOf]
split_ifs with h
· simp
· rw [← nnnorm_eq_zero] at h
rw [nnnorm_smul, nnnorm_inv, nnnorm_norm, mul_inv_cancel₀ h] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | norm_unitOf | null |
private mul_unitOf (a : α) : a * unitOf a = algebraMap _ _ (‖a‖₊ : ℝ) := by
simp only [unitOf, coe_nnnorm]
split_ifs with h
· simp [h]
· rw [mul_smul_comm, mul_inv_cancel₀ h, Algebra.algebraMap_eq_smul_one] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | mul_unitOf | null |
linfty_opNNNorm_eq_opNNNorm (A : Matrix m n α) :
‖A‖₊ = ‖ContinuousLinearMap.mk (Matrix.mulVecLin A)‖₊ := by
rw [ContinuousLinearMap.opNNNorm_eq_of_bounds _ (linfty_opNNNorm_mulVec _) fun N hN => ?_]
rw [linfty_opNNNorm_def]
refine Finset.sup_le fun i _ => ?_
cases isEmpty_or_nonempty n
· simp
classical
let x : n → α := fun j => unitOf (A i j)
have hxn : ‖x‖₊ = 1 := by
simp_rw [x, Pi.nnnorm_def, norm_unitOf, Finset.sup_const Finset.univ_nonempty]
specialize hN x
rw [hxn, mul_one, Pi.nnnorm_def, Finset.sup_le_iff] at hN
replace hN := hN i (Finset.mem_univ _)
dsimp [mulVec, dotProduct] at hN
simp_rw [x, mul_unitOf, ← map_sum, nnnorm_algebraMap, ← NNReal.coe_sum, NNReal.nnnorm_eq,
nnnorm_one, mul_one] at hN
exact hN | lemma | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linfty_opNNNorm_eq_opNNNorm | null |
linfty_opNorm_eq_opNorm (A : Matrix m n α) :
‖A‖ = ‖ContinuousLinearMap.mk (Matrix.mulVecLin A)‖ :=
congr_arg NNReal.toReal (linfty_opNNNorm_eq_opNNNorm A)
variable [DecidableEq n]
@[simp] lemma linfty_opNNNorm_toMatrix (f : (n → α) →L[α] (m → α)) :
‖LinearMap.toMatrix' (↑f : (n → α) →ₗ[α] (m → α))‖₊ = ‖f‖₊ := by
rw [linfty_opNNNorm_eq_opNNNorm]
simp only [← toLin'_apply', toLin'_toMatrix']
@[simp] lemma linfty_opNorm_toMatrix (f : (n → α) →L[α] (m → α)) :
‖LinearMap.toMatrix' (↑f : (n → α) →ₗ[α] (m → α))‖ = ‖f‖ :=
congr_arg NNReal.toReal (linfty_opNNNorm_toMatrix f) | lemma | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | linfty_opNorm_eq_opNorm | null |
@[local instance]
frobeniusSeminormedAddCommGroup [SeminormedAddCommGroup α] :
SeminormedAddCommGroup (Matrix m n α) :=
inferInstanceAs (SeminormedAddCommGroup (PiLp 2 fun _i : m => PiLp 2 fun _j : n => α)) | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobeniusSeminormedAddCommGroup | Seminormed group instance (using the Frobenius norm) for matrices over a seminormed group. Not
declared as an instance because there are several natural choices for defining the norm of a
matrix. |
@[local instance]
frobeniusNormedAddCommGroup [NormedAddCommGroup α] : NormedAddCommGroup (Matrix m n α) :=
(by infer_instance : NormedAddCommGroup (PiLp 2 fun i : m => PiLp 2 fun j : n => α)) | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobeniusNormedAddCommGroup | Normed group instance (using the Frobenius norm) for matrices over a normed group. Not
declared as an instance because there are several natural choices for defining the norm of a
matrix. |
@[local instance]
frobeniusIsBoundedSMul [SeminormedRing R] [SeminormedAddCommGroup α] [Module R α]
[IsBoundedSMul R α] :
IsBoundedSMul R (Matrix m n α) :=
(by infer_instance : IsBoundedSMul R (PiLp 2 fun i : m => PiLp 2 fun j : n => α)) | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobeniusIsBoundedSMul | This applies to the Frobenius norm. |
@[local instance]
frobeniusNormSMulClass [SeminormedRing R] [SeminormedAddCommGroup α] [Module R α]
[NormSMulClass R α] :
NormSMulClass R (Matrix m n α) :=
(by infer_instance : NormSMulClass R (PiLp 2 fun i : m => PiLp 2 fun j : n => α))
@[deprecated (since := "2025-03-10")] alias frobeniusBoundedSMul := frobeniusIsBoundedSMul | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobeniusNormSMulClass | This applies to the Frobenius norm. |
@[local instance]
frobeniusNormedSpace [NormedField R] [SeminormedAddCommGroup α] [NormedSpace R α] :
NormedSpace R (Matrix m n α) :=
(by infer_instance : NormedSpace R (PiLp 2 fun i : m => PiLp 2 fun j : n => α)) | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobeniusNormedSpace | Normed space instance (using the Frobenius norm) for matrices over a normed space. Not
declared as an instance because there are several natural choices for defining the norm of a
matrix. |
frobenius_nnnorm_def (A : Matrix m n α) :
‖A‖₊ = (∑ i, ∑ j, ‖A i j‖₊ ^ (2 : ℝ)) ^ (1 / 2 : ℝ) := by
change ‖toLp 2 fun i => toLp 2 fun j => A i j‖₊ = _
simp_rw [PiLp.nnnorm_eq_of_L2, NNReal.sq_sqrt, NNReal.sqrt_eq_rpow, NNReal.rpow_two,
PiLp.toLp_apply] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_nnnorm_def | null |
frobenius_norm_def (A : Matrix m n α) :
‖A‖ = (∑ i, ∑ j, ‖A i j‖ ^ (2 : ℝ)) ^ (1 / 2 : ℝ) :=
(congr_arg ((↑) : ℝ≥0 → ℝ) (frobenius_nnnorm_def A)).trans <| by simp [NNReal.coe_sum]
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_norm_def | null |
frobenius_nnnorm_map_eq (A : Matrix m n α) (f : α → β) (hf : ∀ a, ‖f a‖₊ = ‖a‖₊) :
‖A.map f‖₊ = ‖A‖₊ := by simp_rw [frobenius_nnnorm_def, Matrix.map_apply, hf]
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_nnnorm_map_eq | null |
frobenius_norm_map_eq (A : Matrix m n α) (f : α → β) (hf : ∀ a, ‖f a‖ = ‖a‖) :
‖A.map f‖ = ‖A‖ :=
(congr_arg ((↑) : ℝ≥0 → ℝ) <| frobenius_nnnorm_map_eq A f fun a => Subtype.ext <| hf a :)
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_norm_map_eq | null |
frobenius_nnnorm_transpose (A : Matrix m n α) : ‖Aᵀ‖₊ = ‖A‖₊ := by
rw [frobenius_nnnorm_def, frobenius_nnnorm_def, Finset.sum_comm]
simp_rw [Matrix.transpose_apply]
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_nnnorm_transpose | null |
frobenius_norm_transpose (A : Matrix m n α) : ‖Aᵀ‖ = ‖A‖ :=
congr_arg ((↑) : ℝ≥0 → ℝ) <| frobenius_nnnorm_transpose A
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_norm_transpose | null |
frobenius_nnnorm_conjTranspose [StarAddMonoid α] [NormedStarGroup α] (A : Matrix m n α) :
‖Aᴴ‖₊ = ‖A‖₊ :=
(frobenius_nnnorm_map_eq _ _ nnnorm_star).trans A.frobenius_nnnorm_transpose
@[simp] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_nnnorm_conjTranspose | null |
frobenius_norm_conjTranspose [StarAddMonoid α] [NormedStarGroup α] (A : Matrix m n α) :
‖Aᴴ‖ = ‖A‖ :=
congr_arg ((↑) : ℝ≥0 → ℝ) <| frobenius_nnnorm_conjTranspose A | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_norm_conjTranspose | null |
frobenius_normedStarGroup [StarAddMonoid α] [NormedStarGroup α] :
NormedStarGroup (Matrix m m α) :=
⟨(le_of_eq <| frobenius_norm_conjTranspose ·)⟩
@[simp] | instance | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_normedStarGroup | null |
frobenius_norm_replicateRow (v : m → α) : ‖replicateRow ι v‖ = ‖toLp 2 v‖ := by
rw [frobenius_norm_def, Fintype.sum_unique, PiLp.norm_eq_of_L2, Real.sqrt_eq_rpow]
simp only [replicateRow_apply, Real.rpow_two, PiLp.toLp_apply]
@[deprecated (since := "2025-03-20")] alias frobenius_norm_row := frobenius_norm_replicateRow
@[simp] | lemma | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_norm_replicateRow | null |
frobenius_nnnorm_replicateRow (v : m → α) : ‖replicateRow ι v‖₊ = ‖toLp 2 v‖₊ :=
Subtype.ext <| frobenius_norm_replicateRow v
@[deprecated (since := "2025-03-20")] alias frobenius_nnnorm_row := frobenius_nnnorm_replicateRow
@[simp] | lemma | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_nnnorm_replicateRow | null |
frobenius_norm_replicateCol (v : n → α) : ‖replicateCol ι v‖ = ‖toLp 2 v‖ := by
simp [frobenius_norm_def, PiLp.norm_eq_of_L2, Real.sqrt_eq_rpow]
@[deprecated (since := "2025-03-20")] alias frobenius_norm_col := frobenius_norm_replicateCol
@[simp] | lemma | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_norm_replicateCol | null |
frobenius_nnnorm_replicateCol (v : n → α) : ‖replicateCol ι v‖₊ = ‖toLp 2 v‖₊ :=
Subtype.ext <| frobenius_norm_replicateCol v
@[deprecated (since := "2025-03-20")] alias frobenius_nnnorm_col := frobenius_nnnorm_replicateCol
@[simp] | lemma | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_nnnorm_replicateCol | null |
frobenius_nnnorm_diagonal [DecidableEq n] (v : n → α) : ‖diagonal v‖₊ = ‖toLp 2 v‖₊ := by
simp_rw [frobenius_nnnorm_def, ← Finset.sum_product', Finset.univ_product_univ,
PiLp.nnnorm_eq_of_L2]
let s := (Finset.univ : Finset n).map ⟨fun i : n => (i, i), fun i j h => congr_arg Prod.fst h⟩
rw [← Finset.sum_subset (Finset.subset_univ s) fun i _hi his => ?_]
· rw [Finset.sum_map, NNReal.sqrt_eq_rpow]
dsimp
simp_rw [diagonal_apply_eq, NNReal.rpow_two]
· suffices i.1 ≠ i.2 by rw [diagonal_apply_ne _ this, nnnorm_zero, NNReal.zero_rpow two_ne_zero]
intro h
exact Finset.mem_map.not.mp his ⟨i.1, Finset.mem_univ _, Prod.ext rfl h⟩
@[simp] | lemma | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_nnnorm_diagonal | null |
frobenius_norm_diagonal [DecidableEq n] (v : n → α) : ‖diagonal v‖ = ‖toLp 2 v‖ :=
(congr_arg ((↑) : ℝ≥0 → ℝ) <| frobenius_nnnorm_diagonal v :).trans rfl | lemma | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_norm_diagonal | null |
frobenius_nnnorm_one [DecidableEq n] [SeminormedAddCommGroup α] [One α] :
‖(1 : Matrix n n α)‖₊ = .sqrt (Fintype.card n) * ‖(1 : α)‖₊ := by
calc
‖(diagonal 1 : Matrix n n α)‖₊
_ = ‖toLp 2 (Function.const _ 1)‖₊ := frobenius_nnnorm_diagonal _
_ = .sqrt (Fintype.card n) * ‖(1 : α)‖₊ := by
rw [PiLp.nnnorm_toLp_const (ENNReal.ofNat_ne_top (n := 2))]
simp [NNReal.sqrt_eq_rpow] | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_nnnorm_one | null |
frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊ := by
simp_rw [frobenius_nnnorm_def, Matrix.mul_apply]
rw [← NNReal.mul_rpow, @Finset.sum_comm _ _ m, Finset.sum_mul_sum]
gcongr with i _ j
rw [← NNReal.rpow_le_rpow_iff one_half_pos, ← NNReal.rpow_mul,
mul_div_cancel₀ (1 : ℝ) two_ne_zero, NNReal.rpow_one, NNReal.mul_rpow]
simpa only [PiLp.toLp_apply, PiLp.inner_apply, RCLike.inner_apply', starRingEnd_apply,
Pi.nnnorm_def, PiLp.nnnorm_eq_of_L2, star_star, nnnorm_star, NNReal.sqrt_eq_rpow,
NNReal.rpow_two] using nnnorm_inner_le_nnnorm (𝕜 := α) (toLp 2 (star <| A i ·)) (toLp 2 (B · j)) | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_nnnorm_mul | null |
frobenius_norm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖ ≤ ‖A‖ * ‖B‖ :=
frobenius_nnnorm_mul A B | theorem | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobenius_norm_mul | null |
@[local instance]
frobeniusNormedRing [DecidableEq m] : NormedRing (Matrix m m α) :=
{ Matrix.frobeniusSeminormedAddCommGroup, Matrix.instRing with
norm := Norm.norm
norm_mul_le := frobenius_norm_mul
eq_of_dist_eq_zero := eq_of_dist_eq_zero } | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobeniusNormedRing | Normed ring instance (using the Frobenius norm) for matrices over `ℝ` or `ℂ`. Not
declared as an instance because there are several natural choices for defining the norm of a
matrix. |
@[local instance]
frobeniusNormedAlgebra [DecidableEq m] [NormedField R] [NormedAlgebra R α] :
NormedAlgebra R (Matrix m m α) :=
{ Matrix.frobeniusNormedSpace, Matrix.instAlgebra with } | def | Analysis | [
"Mathlib.Analysis.InnerProductSpace.PiL2"
] | Mathlib/Analysis/Matrix.lean | frobeniusNormedAlgebra | Normed algebra instance (using the Frobenius norm) for matrices over `ℝ` or `ℂ`. Not
declared as an instance because there are several natural choices for defining the norm of a
matrix. |
geom_mean_le_arith_mean_weighted (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i)
(hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 ≤ z i) :
∏ i ∈ s, z i ^ w i ≤ ∑ i ∈ s, w i * z i := by
by_cases A : ∃ i ∈ s, z i = 0 ∧ w i ≠ 0
· rcases A with ⟨i, his, hzi, hwi⟩
rw [prod_eq_zero his]
· exact sum_nonneg fun j hj => mul_nonneg (hw j hj) (hz j hj)
· rw [hzi]
exact zero_rpow hwi
· simp only [not_exists, not_and, Ne, Classical.not_not] at A
have := convexOn_exp.map_sum_le hw hw' fun i _ => Set.mem_univ <| log (z i)
simp only [exp_sum, smul_eq_mul, mul_comm (w _) (log _)] at this
convert this using 1 <;> [apply prod_congr rfl;apply sum_congr rfl] <;> intro i hi
· rcases eq_or_lt_of_le (hz i hi) with hz | hz
· simp [A i hi hz.symm]
· exact rpow_def_of_pos hz _
· rcases eq_or_lt_of_le (hz i hi) with hz | hz
· simp [A i hi hz.symm]
· rw [exp_log hz] | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | geom_mean_le_arith_mean_weighted | **AM-GM inequality**: The geometric mean is less than or equal to the arithmetic mean, weighted
version for real-valued nonnegative functions. |
geom_mean_le_arith_mean {ι : Type*} (s : Finset ι) (w : ι → ℝ) (z : ι → ℝ)
(hw : ∀ i ∈ s, 0 ≤ w i) (hw' : 0 < ∑ i ∈ s, w i) (hz : ∀ i ∈ s, 0 ≤ z i) :
(∏ i ∈ s, z i ^ w i) ^ (∑ i ∈ s, w i)⁻¹ ≤ (∑ i ∈ s, w i * z i) / (∑ i ∈ s, w i) := by
convert geom_mean_le_arith_mean_weighted s (fun i => (w i) / ∑ i ∈ s, w i) z ?_ ?_ hz using 2
· rw [← finset_prod_rpow _ _ (fun i hi => rpow_nonneg (hz _ hi) _) _]
refine Finset.prod_congr rfl (fun _ ih => ?_)
rw [div_eq_mul_inv, rpow_mul (hz _ ih)]
· simp_rw [div_eq_mul_inv, mul_assoc, mul_comm, ← mul_assoc, ← Finset.sum_mul, mul_comm]
· exact fun _ hi => div_nonneg (hw _ hi) (le_of_lt hw')
· simp_rw [div_eq_mul_inv, ← Finset.sum_mul]
exact mul_inv_cancel₀ (by linarith) | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | geom_mean_le_arith_mean | **AM-GM inequality**: The **geometric mean is less than or equal to the arithmetic mean. |
geom_mean_weighted_of_constant (w z : ι → ℝ) (x : ℝ) (hw : ∀ i ∈ s, 0 ≤ w i)
(hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 ≤ z i) (hx : ∀ i ∈ s, w i ≠ 0 → z i = x) :
∏ i ∈ s, z i ^ w i = x :=
calc
∏ i ∈ s, z i ^ w i = ∏ i ∈ s, x ^ w i := by
refine prod_congr rfl fun i hi => ?_
rcases eq_or_ne (w i) 0 with h₀ | h₀
· rw [h₀, rpow_zero, rpow_zero]
· rw [hx i hi h₀]
_ = x := by
rw [← rpow_sum_of_nonneg _ hw, hw', rpow_one]
have : (∑ i ∈ s, w i) ≠ 0 := by
rw [hw']
exact one_ne_zero
obtain ⟨i, his, hi⟩ := exists_ne_zero_of_sum_ne_zero this
rw [← hx i his hi]
exact hz i his | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | geom_mean_weighted_of_constant | null |
arith_mean_weighted_of_constant (w z : ι → ℝ) (x : ℝ) (hw' : ∑ i ∈ s, w i = 1)
(hx : ∀ i ∈ s, w i ≠ 0 → z i = x) : ∑ i ∈ s, w i * z i = x :=
calc
∑ i ∈ s, w i * z i = ∑ i ∈ s, w i * x := by
refine sum_congr rfl fun i hi => ?_
rcases eq_or_ne (w i) 0 with hwi | hwi
· rw [hwi, zero_mul, zero_mul]
· rw [hx i hi hwi]
_ = x := by rw [← sum_mul, hw', one_mul] | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | arith_mean_weighted_of_constant | null |
geom_mean_eq_arith_mean_weighted_of_constant (w z : ι → ℝ) (x : ℝ) (hw : ∀ i ∈ s, 0 ≤ w i)
(hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 ≤ z i) (hx : ∀ i ∈ s, w i ≠ 0 → z i = x) :
∏ i ∈ s, z i ^ w i = ∑ i ∈ s, w i * z i := by
rw [geom_mean_weighted_of_constant, arith_mean_weighted_of_constant] <;> assumption | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | geom_mean_eq_arith_mean_weighted_of_constant | null |
geom_mean_eq_arith_mean_weighted_iff' (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 < w i)
(hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 ≤ z i) :
∏ i ∈ s, z i ^ w i = ∑ i ∈ s, w i * z i ↔ ∀ j ∈ s, z j = ∑ i ∈ s, w i * z i := by
by_cases A : ∃ i ∈ s, z i = 0 ∧ w i ≠ 0
· rcases A with ⟨i, his, hzi, hwi⟩
rw [prod_eq_zero his]
· constructor
· intro h
rw [← h]
intro j hj
apply eq_zero_of_ne_zero_of_mul_left_eq_zero (ne_of_lt (hw j hj)).symm
apply (sum_eq_zero_iff_of_nonneg ?_).mp h.symm j hj
exact fun i hi => (mul_nonneg_iff_of_pos_left (hw i hi)).mpr (hz i hi)
· intro h
convert h i his
exact hzi.symm
· rw [hzi]
exact zero_rpow hwi
· simp only [not_exists, not_and] at A
have hz' := fun i h => lt_of_le_of_ne (hz i h) (fun a => (A i h a.symm) (ne_of_gt (hw i h)))
have := strictConvexOn_exp.map_sum_eq_iff hw hw' fun i _ => Set.mem_univ <| log (z i)
simp only [exp_sum, smul_eq_mul, mul_comm (w _) (log _)] at this
convert this using 1
· apply Eq.congr <;>
[apply prod_congr rfl; apply sum_congr rfl] <;>
intro i hi <;>
simp only [exp_mul, exp_log (hz' i hi)]
· constructor <;> intro h j hj
· rw [← arith_mean_weighted_of_constant s w _ (log (z j)) hw' fun i _ => congrFun rfl]
apply sum_congr rfl
intro x hx
simp only [mul_comm, h j hj, h x hx]
· rw [← arith_mean_weighted_of_constant s w _ (z j) hw' fun i _ => congrFun rfl]
apply sum_congr rfl
intro x hx
simp only [log_injOn_pos (hz' j hj) (hz' x hx), h j hj, h x hx] | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | geom_mean_eq_arith_mean_weighted_iff' | **AM-GM inequality - equality condition**: This theorem provides the equality condition for the
*positive* weighted version of the AM-GM inequality for real-valued nonnegative functions. |
geom_mean_eq_arith_mean_weighted_iff (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i)
(hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 ≤ z i) :
∏ i ∈ s, z i ^ w i = ∑ i ∈ s, w i * z i ↔ ∀ j ∈ s, w j ≠ 0 → z j = ∑ i ∈ s, w i * z i := by
have h (i) (_ : i ∈ s) : w i * z i ≠ 0 → w i ≠ 0 := by apply left_ne_zero_of_mul
have h' (i) (_ : i ∈ s) : z i ^ w i ≠ 1 → w i ≠ 0 := by
by_contra!
obtain ⟨h1, h2⟩ := this
simp only [h2, rpow_zero, ne_self_iff_false] at h1
rw [← sum_filter_of_ne h, ← prod_filter_of_ne h', geom_mean_eq_arith_mean_weighted_iff']
· simp
· simp +contextual [(hw _ _).lt_iff_ne']
· rwa [sum_filter_ne_zero]
· simp_all only [ne_eq, mul_eq_zero, not_or, not_false_eq_true, implies_true, mem_filter] | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | geom_mean_eq_arith_mean_weighted_iff | **AM-GM inequality - equality condition**: This theorem provides the equality condition for the
weighted version of the AM-GM inequality for real-valued nonnegative functions. |
geom_mean_lt_arith_mean_weighted_iff_of_pos (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 < w i)
(hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 ≤ z i) :
∏ i ∈ s, z i ^ w i < ∑ i ∈ s, w i * z i ↔ ∃ j ∈ s, ∃ k ∈ s, z j ≠ z k:= by
constructor
· intro h
by_contra! h_contra
rw [(geom_mean_eq_arith_mean_weighted_iff' s w z hw hw' hz).mpr ?_] at h
· exact (lt_self_iff_false _).mp h
· intro j hjs
rw [← arith_mean_weighted_of_constant s w (fun _ => z j) (z j) hw' fun _ _ => congrFun rfl]
apply sum_congr rfl (fun x a => congrArg (HMul.hMul (w x)) (h_contra j hjs x a))
· rintro ⟨j, hjs, k, hks, hzjk⟩
have := geom_mean_le_arith_mean_weighted s w z (fun i a => le_of_lt (hw i a)) hw' hz
by_contra! h
apply le_antisymm this at h
apply (geom_mean_eq_arith_mean_weighted_iff' s w z hw hw' hz).mp at h
simp only [h j hjs, h k hks, ne_eq, not_true_eq_false] at hzjk | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | geom_mean_lt_arith_mean_weighted_iff_of_pos | **AM-GM inequality - strict inequality condition**: This theorem provides the strict inequality
condition for the *positive* weighted version of the AM-GM inequality for real-valued nonnegative
functions. |
geom_mean_le_arith_mean_weighted (w z : ι → ℝ≥0) (hw' : ∑ i ∈ s, w i = 1) :
(∏ i ∈ s, z i ^ (w i : ℝ)) ≤ ∑ i ∈ s, w i * z i :=
mod_cast
Real.geom_mean_le_arith_mean_weighted _ _ _ (fun i _ => (w i).coe_nonneg)
(by assumption_mod_cast) fun i _ => (z i).coe_nonneg | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | geom_mean_le_arith_mean_weighted | **AM-GM inequality**: The geometric mean is less than or equal to the arithmetic mean, weighted
version for `NNReal`-valued functions. |
geom_mean_le_arith_mean2_weighted (w₁ w₂ p₁ p₂ : ℝ≥0) :
w₁ + w₂ = 1 → p₁ ^ (w₁ : ℝ) * p₂ ^ (w₂ : ℝ) ≤ w₁ * p₁ + w₂ * p₂ := by
simpa only [Fin.prod_univ_succ, Fin.sum_univ_succ, Finset.prod_empty, Finset.sum_empty,
Finset.univ_eq_empty, Fin.cons_succ, Fin.cons_zero, add_zero, mul_one] using
geom_mean_le_arith_mean_weighted univ ![w₁, w₂] ![p₁, p₂] | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | geom_mean_le_arith_mean2_weighted | **AM-GM inequality**: The geometric mean is less than or equal to the arithmetic mean, weighted
version for two `NNReal` numbers. |
geom_mean_le_arith_mean3_weighted (w₁ w₂ w₃ p₁ p₂ p₃ : ℝ≥0) :
w₁ + w₂ + w₃ = 1 →
p₁ ^ (w₁ : ℝ) * p₂ ^ (w₂ : ℝ) * p₃ ^ (w₃ : ℝ) ≤ w₁ * p₁ + w₂ * p₂ + w₃ * p₃ := by
simpa only [Fin.prod_univ_succ, Fin.sum_univ_succ, Finset.prod_empty, Finset.sum_empty,
Finset.univ_eq_empty, Fin.cons_succ, Fin.cons_zero, add_zero, mul_one, ← add_assoc,
mul_assoc] using geom_mean_le_arith_mean_weighted univ ![w₁, w₂, w₃] ![p₁, p₂, p₃] | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | geom_mean_le_arith_mean3_weighted | null |
geom_mean_le_arith_mean4_weighted (w₁ w₂ w₃ w₄ p₁ p₂ p₃ p₄ : ℝ≥0) :
w₁ + w₂ + w₃ + w₄ = 1 →
p₁ ^ (w₁ : ℝ) * p₂ ^ (w₂ : ℝ) * p₃ ^ (w₃ : ℝ) * p₄ ^ (w₄ : ℝ) ≤
w₁ * p₁ + w₂ * p₂ + w₃ * p₃ + w₄ * p₄ := by
simpa only [Fin.prod_univ_succ, Fin.sum_univ_succ, Finset.prod_empty, Finset.sum_empty,
Finset.univ_eq_empty, Fin.cons_succ, Fin.cons_zero, add_zero, mul_one, ← add_assoc,
mul_assoc] using geom_mean_le_arith_mean_weighted univ ![w₁, w₂, w₃, w₄] ![p₁, p₂, p₃, p₄] | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | geom_mean_le_arith_mean4_weighted | null |
geom_mean_le_arith_mean2_weighted {w₁ w₂ p₁ p₂ : ℝ} (hw₁ : 0 ≤ w₁) (hw₂ : 0 ≤ w₂)
(hp₁ : 0 ≤ p₁) (hp₂ : 0 ≤ p₂) (hw : w₁ + w₂ = 1) : p₁ ^ w₁ * p₂ ^ w₂ ≤ w₁ * p₁ + w₂ * p₂ :=
NNReal.geom_mean_le_arith_mean2_weighted ⟨w₁, hw₁⟩ ⟨w₂, hw₂⟩ ⟨p₁, hp₁⟩ ⟨p₂, hp₂⟩ <|
NNReal.coe_inj.1 <| by assumption | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | geom_mean_le_arith_mean2_weighted | null |
geom_mean_le_arith_mean3_weighted {w₁ w₂ w₃ p₁ p₂ p₃ : ℝ} (hw₁ : 0 ≤ w₁) (hw₂ : 0 ≤ w₂)
(hw₃ : 0 ≤ w₃) (hp₁ : 0 ≤ p₁) (hp₂ : 0 ≤ p₂) (hp₃ : 0 ≤ p₃) (hw : w₁ + w₂ + w₃ = 1) :
p₁ ^ w₁ * p₂ ^ w₂ * p₃ ^ w₃ ≤ w₁ * p₁ + w₂ * p₂ + w₃ * p₃ :=
NNReal.geom_mean_le_arith_mean3_weighted ⟨w₁, hw₁⟩ ⟨w₂, hw₂⟩ ⟨w₃, hw₃⟩ ⟨p₁, hp₁⟩ ⟨p₂, hp₂⟩
⟨p₃, hp₃⟩ <|
NNReal.coe_inj.1 hw | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | geom_mean_le_arith_mean3_weighted | null |
geom_mean_le_arith_mean4_weighted {w₁ w₂ w₃ w₄ p₁ p₂ p₃ p₄ : ℝ} (hw₁ : 0 ≤ w₁)
(hw₂ : 0 ≤ w₂) (hw₃ : 0 ≤ w₃) (hw₄ : 0 ≤ w₄) (hp₁ : 0 ≤ p₁) (hp₂ : 0 ≤ p₂) (hp₃ : 0 ≤ p₃)
(hp₄ : 0 ≤ p₄) (hw : w₁ + w₂ + w₃ + w₄ = 1) :
p₁ ^ w₁ * p₂ ^ w₂ * p₃ ^ w₃ * p₄ ^ w₄ ≤ w₁ * p₁ + w₂ * p₂ + w₃ * p₃ + w₄ * p₄ :=
NNReal.geom_mean_le_arith_mean4_weighted ⟨w₁, hw₁⟩ ⟨w₂, hw₂⟩ ⟨w₃, hw₃⟩ ⟨w₄, hw₄⟩ ⟨p₁, hp₁⟩
⟨p₂, hp₂⟩ ⟨p₃, hp₃⟩ ⟨p₄, hp₄⟩ <|
NNReal.coe_inj.1 <| by assumption | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | geom_mean_le_arith_mean4_weighted | null |
harm_mean_le_geom_mean_weighted (w z : ι → ℝ) (hs : s.Nonempty) (hw : ∀ i ∈ s, 0 < w i)
(hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 < z i) :
(∑ i ∈ s, w i / z i)⁻¹ ≤ ∏ i ∈ s, z i ^ w i := by
have : ∏ i ∈ s, (1 / z) i ^ w i ≤ ∑ i ∈ s, w i * (1 / z) i :=
geom_mean_le_arith_mean_weighted s w (1/z) (fun i hi ↦ le_of_lt (hw i hi)) hw'
(fun i hi ↦ one_div_nonneg.2 (le_of_lt (hz i hi)))
have p_pos : 0 < ∏ i ∈ s, (z i)⁻¹ ^ w i :=
prod_pos fun i hi => rpow_pos_of_pos (inv_pos.2 (hz i hi)) _
have s_pos : 0 < ∑ i ∈ s, w i * (z i)⁻¹ :=
sum_pos (fun i hi => mul_pos (hw i hi) (inv_pos.2 (hz i hi))) hs
norm_num at this
rw [← inv_le_inv₀ s_pos p_pos] at this
apply le_trans this
have p_pos₂ : 0 < (∏ i ∈ s, (z i) ^ w i)⁻¹ :=
inv_pos.2 (prod_pos fun i hi => rpow_pos_of_pos ((hz i hi)) _ )
rw [← inv_inv (∏ i ∈ s, z i ^ w i), inv_le_inv₀ p_pos p_pos₂, ← Finset.prod_inv_distrib]
gcongr
· exact fun i hi ↦ inv_nonneg.mpr (Real.rpow_nonneg (le_of_lt (hz i hi)) _)
· rw [Real.inv_rpow]; apply fun i hi ↦ le_of_lt (hz i hi); assumption | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | harm_mean_le_geom_mean_weighted | **HM-GM inequality**: The harmonic mean is less than or equal to the geometric mean, weighted
version for real-valued nonnegative functions. |
harm_mean_le_geom_mean {ι : Type*} (s : Finset ι) (hs : s.Nonempty) (w : ι → ℝ)
(z : ι → ℝ) (hw : ∀ i ∈ s, 0 < w i) (hw' : 0 < ∑ i ∈ s, w i) (hz : ∀ i ∈ s, 0 < z i) :
(∑ i ∈ s, w i) / (∑ i ∈ s, w i / z i) ≤ (∏ i ∈ s, z i ^ w i) ^ (∑ i ∈ s, w i)⁻¹ := by
have := harm_mean_le_geom_mean_weighted s (fun i => (w i) / ∑ i ∈ s, w i) z hs ?_ ?_ hz
· simp only at this
set n := ∑ i ∈ s, w i
nth_rw 1 [div_eq_mul_inv, (show n = (n⁻¹)⁻¹ by simp), ← mul_inv, Finset.mul_sum _ _ n⁻¹]
simp_rw [inv_mul_eq_div n ((w _)/(z _)), div_right_comm _ _ n]
convert this
rw [← Real.finset_prod_rpow s _ (fun i hi ↦ Real.rpow_nonneg (le_of_lt <| hz i hi) _)]
refine Finset.prod_congr rfl (fun i hi => ?_)
rw [← Real.rpow_mul (le_of_lt <| hz i hi) (w _) n⁻¹, div_eq_mul_inv (w _) n]
· exact fun i hi ↦ div_pos (hw i hi) hw'
· simp_rw [div_eq_mul_inv (w _) (∑ i ∈ s, w i), ← Finset.sum_mul _ _ (∑ i ∈ s, w i)⁻¹]
exact mul_inv_cancel₀ hw'.ne' | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | harm_mean_le_geom_mean | **HM-GM inequality**: The **harmonic mean is less than or equal to the geometric mean. |
young_inequality_of_nonneg {a b p q : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b)
(hpq : p.HolderConjugate q) : a * b ≤ a ^ p / p + b ^ q / q := by
simpa [← rpow_mul, ha, hb, hpq.ne_zero, hpq.symm.ne_zero, _root_.div_eq_inv_mul] using
geom_mean_le_arith_mean2_weighted hpq.inv_nonneg hpq.symm.inv_nonneg
(rpow_nonneg ha p) (rpow_nonneg hb q) hpq.inv_add_inv_eq_one | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | young_inequality_of_nonneg | **Young's inequality**, a version for nonnegative real numbers. |
young_inequality (a b : ℝ) {p q : ℝ} (hpq : p.HolderConjugate q) :
a * b ≤ |a| ^ p / p + |b| ^ q / q :=
calc
a * b ≤ |a * b| := le_abs_self (a * b)
_ = |a| * |b| := abs_mul a b
_ ≤ |a| ^ p / p + |b| ^ q / q :=
Real.young_inequality_of_nonneg (abs_nonneg a) (abs_nonneg b) hpq | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | young_inequality | **Young's inequality**, a version for arbitrary real numbers. |
young_inequality (a b : ℝ≥0) {p q : ℝ≥0} (hpq : p.HolderConjugate q) :
a * b ≤ a ^ (p : ℝ) / p + b ^ (q : ℝ) / q :=
Real.young_inequality_of_nonneg a.coe_nonneg b.coe_nonneg hpq.coe | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | young_inequality | **Young's inequality**, `ℝ≥0` version. We use `{p q : ℝ≥0}` in order to avoid constructing
witnesses of `0 ≤ p` and `0 ≤ q` for the denominators. |
young_inequality_real (a b : ℝ≥0) {p q : ℝ} (hpq : p.HolderConjugate q) :
a * b ≤ a ^ p / Real.toNNReal p + b ^ q / Real.toNNReal q := by
simpa [Real.coe_toNNReal, hpq.nonneg, hpq.symm.nonneg] using young_inequality a b hpq.toNNReal | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | young_inequality_real | **Young's inequality**, `ℝ≥0` version with real conjugate exponents. |
young_inequality (a b : ℝ≥0∞) {p q : ℝ} (hpq : p.HolderConjugate q) :
a * b ≤ a ^ p / ENNReal.ofReal p + b ^ q / ENNReal.ofReal q := by
by_cases h : a = ⊤ ∨ b = ⊤
· refine le_trans le_top (le_of_eq ?_)
repeat rw [div_eq_mul_inv]
rcases h with h | h <;> rw [h] <;> simp [hpq.pos, hpq.symm.pos]
push_neg at h
rw [← coe_toNNReal h.left, ← coe_toNNReal h.right, ← coe_mul, ← coe_rpow_of_nonneg _ hpq.nonneg,
← coe_rpow_of_nonneg _ hpq.symm.nonneg, ENNReal.ofReal, ENNReal.ofReal, ←
@coe_div (Real.toNNReal p) _ (by simp [hpq.pos]), ←
@coe_div (Real.toNNReal q) _ (by simp [hpq.symm.pos]), ← coe_add, coe_le_coe]
exact NNReal.young_inequality_real a.toNNReal b.toNNReal hpq | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | young_inequality | **Young's inequality**, `ℝ≥0∞` version with real conjugate exponents. |
private inner_le_Lp_mul_Lp_of_norm_le_one (f g : ι → ℝ≥0) {p q : ℝ}
(hpq : p.HolderConjugate q) (hf : ∑ i ∈ s, f i ^ p ≤ 1) (hg : ∑ i ∈ s, g i ^ q ≤ 1) :
∑ i ∈ s, f i * g i ≤ 1 := by
have hp : 0 < p.toNNReal := zero_lt_one.trans hpq.toNNReal.lt
have hq : 0 < q.toNNReal := zero_lt_one.trans hpq.toNNReal.symm.lt
calc
∑ i ∈ s, f i * g i ≤ ∑ i ∈ s, (f i ^ p / Real.toNNReal p + g i ^ q / Real.toNNReal q) :=
Finset.sum_le_sum fun i _ => young_inequality_real (f i) (g i) hpq
_ = (∑ i ∈ s, f i ^ p) / Real.toNNReal p + (∑ i ∈ s, g i ^ q) / Real.toNNReal q := by
rw [sum_add_distrib, sum_div, sum_div]
_ ≤ 1 / Real.toNNReal p + 1 / Real.toNNReal q := by
refine add_le_add ?_ ?_ <;> rwa [div_le_iff₀, div_mul_cancel₀] <;> positivity
_ = 1 := by simp_rw [one_div, hpq.toNNReal.inv_add_inv_eq_one] | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | inner_le_Lp_mul_Lp_of_norm_le_one | null |
private inner_le_Lp_mul_Lp_of_norm_eq_zero (f g : ι → ℝ≥0) {p q : ℝ}
(hpq : p.HolderConjugate q) (hf : ∑ i ∈ s, f i ^ p = 0) :
∑ i ∈ s, f i * g i ≤ (∑ i ∈ s, f i ^ p) ^ (1 / p) * (∑ i ∈ s, g i ^ q) ^ (1 / q) := by
simp only [hf, hpq.ne_zero, one_div, sum_eq_zero_iff, zero_rpow, zero_mul,
inv_eq_zero, Ne, not_false_iff, le_zero_iff, mul_eq_zero]
intro i his
left
rw [sum_eq_zero_iff] at hf
exact (rpow_eq_zero_iff.mp (hf i his)).left | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | inner_le_Lp_mul_Lp_of_norm_eq_zero | null |
inner_le_Lp_mul_Lq (f g : ι → ℝ≥0) {p q : ℝ} (hpq : p.HolderConjugate q) :
∑ i ∈ s, f i * g i ≤ (∑ i ∈ s, f i ^ p) ^ (1 / p) * (∑ i ∈ s, g i ^ q) ^ (1 / q) := by
obtain hf | hf := eq_zero_or_pos (∑ i ∈ s, f i ^ p)
· exact inner_le_Lp_mul_Lp_of_norm_eq_zero s f g hpq hf
obtain hg | hg := eq_zero_or_pos (∑ i ∈ s, g i ^ q)
· calc
∑ i ∈ s, f i * g i = ∑ i ∈ s, g i * f i := by
congr with i
rw [mul_comm]
_ ≤ (∑ i ∈ s, g i ^ q) ^ (1 / q) * (∑ i ∈ s, f i ^ p) ^ (1 / p) :=
(inner_le_Lp_mul_Lp_of_norm_eq_zero s g f hpq.symm hg)
_ = (∑ i ∈ s, f i ^ p) ^ (1 / p) * (∑ i ∈ s, g i ^ q) ^ (1 / q) := mul_comm _ _
let f' i := f i / (∑ i ∈ s, f i ^ p) ^ (1 / p)
let g' i := g i / (∑ i ∈ s, g i ^ q) ^ (1 / q)
suffices (∑ i ∈ s, f' i * g' i) ≤ 1 by
simp_rw [f', g', div_mul_div_comm, ← sum_div] at this
rwa [div_le_iff₀, one_mul] at this
exact mul_pos (rpow_pos hf) (rpow_pos hg)
refine inner_le_Lp_mul_Lp_of_norm_le_one s f' g' hpq (le_of_eq ?_) (le_of_eq ?_)
· simp_rw [f', div_rpow, ← sum_div, ← rpow_mul, one_div, inv_mul_cancel₀ hpq.ne_zero, rpow_one,
div_self hf.ne']
· simp_rw [g', div_rpow, ← sum_div, ← rpow_mul, one_div, inv_mul_cancel₀ hpq.symm.ne_zero,
rpow_one, div_self hg.ne'] | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | inner_le_Lp_mul_Lq | **Hölder inequality**: The scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. Version for sums over finite sets,
with `ℝ≥0`-valued functions. |
inner_le_weight_mul_Lp (s : Finset ι) {p : ℝ} (hp : 1 ≤ p) (w f : ι → ℝ≥0) :
∑ i ∈ s, w i * f i ≤ (∑ i ∈ s, w i) ^ (1 - p⁻¹) * (∑ i ∈ s, w i * f i ^ p) ^ p⁻¹ := by
obtain rfl | hp := hp.eq_or_lt
· simp
calc
_ = ∑ i ∈ s, w i ^ (1 - p⁻¹) * (w i ^ p⁻¹ * f i) := ?_
_ ≤ (∑ i ∈ s, (w i ^ (1 - p⁻¹)) ^ (1 - p⁻¹)⁻¹) ^ (1 / (1 - p⁻¹)⁻¹) *
(∑ i ∈ s, (w i ^ p⁻¹ * f i) ^ p) ^ (1 / p) :=
inner_le_Lp_mul_Lq _ _ _ (.symm <| Real.holderConjugate_iff.mpr ⟨hp, by simp⟩)
_ = _ := ?_
· congr with i
rw [← mul_assoc, ← rpow_of_add_eq _ one_ne_zero, rpow_one]
simp
· have hp₀ : p ≠ 0 := by positivity
have hp₁ : 1 - p⁻¹ ≠ 0 := by simp [sub_eq_zero, hp.ne']
simp [mul_rpow, div_inv_eq_mul, one_mul, one_div, hp₀, hp₁] | lemma | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | inner_le_weight_mul_Lp | **Weighted Hölder inequality**. |
inner_le_Lp_mul_Lq_tsum {f g : ι → ℝ≥0} {p q : ℝ} (hpq : p.HolderConjugate q)
(hf : Summable fun i => f i ^ p) (hg : Summable fun i => g i ^ q) :
(Summable fun i => f i * g i) ∧
∑' i, f i * g i ≤ (∑' i, f i ^ p) ^ (1 / p) * (∑' i, g i ^ q) ^ (1 / q) := by
have H₁ : ∀ s : Finset ι,
∑ i ∈ s, f i * g i ≤ (∑' i, f i ^ p) ^ (1 / p) * (∑' i, g i ^ q) ^ (1 / q) := by
intro s
refine le_trans (inner_le_Lp_mul_Lq s f g hpq) (mul_le_mul ?_ ?_ bot_le bot_le)
· rw [NNReal.rpow_le_rpow_iff (one_div_pos.mpr hpq.pos)]
exact hf.sum_le_tsum _ (fun _ _ => zero_le _)
· rw [NNReal.rpow_le_rpow_iff (one_div_pos.mpr hpq.symm.pos)]
exact hg.sum_le_tsum _ (fun _ _ => zero_le _)
have bdd : BddAbove (Set.range fun s => ∑ i ∈ s, f i * g i) := by
refine ⟨(∑' i, f i ^ p) ^ (1 / p) * (∑' i, g i ^ q) ^ (1 / q), ?_⟩
rintro a ⟨s, rfl⟩
exact H₁ s
have H₂ : Summable _ := (hasSum_of_isLUB _ (isLUB_ciSup bdd)).summable
exact ⟨H₂, H₂.tsum_le_of_sum_le H₁⟩ | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | inner_le_Lp_mul_Lq_tsum | **Hölder inequality**: the scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. A version for `NNReal`-valued
functions. For an alternative version, convenient if the infinite sums are already expressed as
`p`-th powers, see `inner_le_Lp_mul_Lq_hasSum`. |
summable_mul_of_Lp_Lq {f g : ι → ℝ≥0} {p q : ℝ} (hpq : p.HolderConjugate q)
(hf : Summable fun i => f i ^ p) (hg : Summable fun i => g i ^ q) :
Summable fun i => f i * g i :=
(inner_le_Lp_mul_Lq_tsum hpq hf hg).1 | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | summable_mul_of_Lp_Lq | null |
inner_le_Lp_mul_Lq_tsum' {f g : ι → ℝ≥0} {p q : ℝ} (hpq : p.HolderConjugate q)
(hf : Summable fun i => f i ^ p) (hg : Summable fun i => g i ^ q) :
∑' i, f i * g i ≤ (∑' i, f i ^ p) ^ (1 / p) * (∑' i, g i ^ q) ^ (1 / q) :=
(inner_le_Lp_mul_Lq_tsum hpq hf hg).2 | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | inner_le_Lp_mul_Lq_tsum' | null |
inner_le_Lp_mul_Lq_hasSum {f g : ι → ℝ≥0} {A B : ℝ≥0} {p q : ℝ}
(hpq : p.HolderConjugate q) (hf : HasSum (fun i => f i ^ p) (A ^ p))
(hg : HasSum (fun i => g i ^ q) (B ^ q)) : ∃ C, C ≤ A * B ∧ HasSum (fun i => f i * g i) C := by
obtain ⟨H₁, H₂⟩ := inner_le_Lp_mul_Lq_tsum hpq hf.summable hg.summable
have hA : A = (∑' i : ι, f i ^ p) ^ (1 / p) := by rw [hf.tsum_eq, rpow_inv_rpow_self hpq.ne_zero]
have hB : B = (∑' i : ι, g i ^ q) ^ (1 / q) := by
rw [hg.tsum_eq, rpow_inv_rpow_self hpq.symm.ne_zero]
refine ⟨∑' i, f i * g i, ?_, ?_⟩
· simpa [hA, hB] using H₂
· simpa only [rpow_self_rpow_inv hpq.ne_zero] using H₁.hasSum | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | inner_le_Lp_mul_Lq_hasSum | **Hölder inequality**: the scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. A version for `NNReal`-valued
functions. For an alternative version, convenient if the infinite sums are not already expressed as
`p`-th powers, see `inner_le_Lp_mul_Lq_tsum`. |
rpow_sum_le_const_mul_sum_rpow (f : ι → ℝ≥0) {p : ℝ} (hp : 1 ≤ p) :
(∑ i ∈ s, f i) ^ p ≤ (#s : ℝ≥0) ^ (p - 1) * ∑ i ∈ s, f i ^ p := by
rcases eq_or_lt_of_le hp with hp | hp
· simp [← hp]
let q : ℝ := p / (p - 1)
have hpq : p.HolderConjugate q := .conjExponent hp
have hp₁ : 1 / p * p = 1 := one_div_mul_cancel hpq.ne_zero
have hq : 1 / q * p = p - 1 := by
rw [← hpq.div_conj_eq_sub_one]
ring
simpa only [NNReal.mul_rpow, ← NNReal.rpow_mul, hp₁, hq, one_mul, one_rpow, rpow_one,
Pi.one_apply, sum_const, Nat.smul_one_eq_cast] using
NNReal.rpow_le_rpow (inner_le_Lp_mul_Lq s 1 f hpq.symm) hpq.nonneg | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | rpow_sum_le_const_mul_sum_rpow | For `1 ≤ p`, the `p`-th power of the sum of `f i` is bounded above by a constant times the
sum of the `p`-th powers of `f i`. Version for sums over finite sets, with `ℝ≥0`-valued functions. |
isGreatest_Lp (f : ι → ℝ≥0) {p q : ℝ} (hpq : p.HolderConjugate q) :
IsGreatest ((fun g : ι → ℝ≥0 => ∑ i ∈ s, f i * g i) '' { g | ∑ i ∈ s, g i ^ q ≤ 1 })
((∑ i ∈ s, f i ^ p) ^ (1 / p)) := by
constructor
· use fun i => f i ^ p / f i / (∑ i ∈ s, f i ^ p) ^ (1 / q)
obtain hf | hf := eq_zero_or_pos (∑ i ∈ s, f i ^ p)
· simp [hf, hpq.ne_zero, hpq.symm.ne_zero]
· have A : p + q - q ≠ 0 := by simp [hpq.ne_zero]
have B : ∀ y : ℝ≥0, y * y ^ p / y = y ^ p := by
refine fun y => mul_div_cancel_left_of_imp fun h => ?_
simp [h, hpq.ne_zero]
simp only [Set.mem_setOf_eq, div_rpow, ← sum_div, ← rpow_mul,
div_mul_cancel₀ _ hpq.symm.ne_zero, rpow_one, div_le_iff₀ hf, one_mul, hpq.mul_eq_add, ←
rpow_sub' A, add_sub_cancel_right, le_refl, true_and, ← mul_div_assoc, B]
rw [div_eq_iff, ← rpow_add hf.ne', one_div, one_div, hpq.inv_add_inv_eq_one, rpow_one]
simpa [hpq.symm.ne_zero] using hf.ne'
· rintro _ ⟨g, hg, rfl⟩
apply le_trans (inner_le_Lp_mul_Lq s f g hpq)
simpa only [mul_one] using
mul_le_mul_left' (NNReal.rpow_le_one hg (le_of_lt hpq.symm.one_div_pos)) _ | theorem | Analysis | [
"Mathlib.Algebra.BigOperators.Expect",
"Mathlib.Algebra.BigOperators.Field",
"Mathlib.Analysis.Convex.Jensen",
"Mathlib.Analysis.Convex.SpecificFunctions.Basic",
"Mathlib.Analysis.SpecialFunctions.Pow.NNReal",
"Mathlib.Data.Real.ConjExponents"
] | Mathlib/Analysis/MeanInequalities.lean | isGreatest_Lp | The `L_p` seminorm of a vector `f` is the greatest value of the inner product
`∑ i ∈ s, f i * g i` over functions `g` of `L_q` seminorm less than or equal to one. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.