Skip to content

Commit

Permalink
feat: ‖a * b * c‖ ≤ ‖a‖ * ‖b‖ * ‖c‖ (#18005)
Browse files Browse the repository at this point in the history
and prime the existing lemmas for a norm on a multiplicative group to make space for the ring ones.

From GrowthInGroups
  • Loading branch information
YaelDillies committed Oct 21, 2024
1 parent 0cb54c9 commit e3e46c3
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Mathlib/Analysis/Analytic/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ theorem HasFPowerSeriesWithinOnBall.tendsto_partialSum_prod {y : E}
simp only [FormalMultilinearSeries.partialSum]
abel
_ ≤ ‖p.partialSum k z - p.partialSum k y‖ + ‖∑ i ∈ Ico k n, p i (fun _ ↦ z)‖
+ ‖- ∑ i ∈ Ico k n, p i (fun _ ↦ y)‖ := norm_add₃_le _ _ _
+ ‖- ∑ i ∈ Ico k n, p i (fun _ ↦ y)‖ := norm_add₃_le
_ ≤ ε / 4 + ε / 4 + ε / 4 := by
gcongr
· exact I _ h'z
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/CStarAlgebra/Module/Defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ protected lemma norm_triangle [CompleteSpace A] (x y : E) : ‖x + y‖ ≤ ‖x
calc _ ≤ ‖⟪x, x⟫ + ⟪y, x⟫‖ + ‖⟪x, y⟫‖ + ‖⟪y, y⟫‖ := by
simp only [norm_eq_sqrt_norm_inner_self, inner_add_right, inner_add_left, ← add_assoc,
norm_nonneg, Real.sq_sqrt]
exact norm_add₃_le _ _ _
exact norm_add₃_le
_ ≤ ‖⟪x, x⟫‖ + ‖⟪y, x⟫‖ + ‖⟪x, y⟫‖ + ‖⟪y, y⟫‖ := by gcongr; exact norm_add_le _ _
_ ≤ ‖⟪x, x⟫‖ + ‖y‖ * ‖x‖ + ‖x‖ * ‖y‖ + ‖⟪y, y⟫‖ := by gcongr <;> exact norm_inner_le E
_ = ‖x‖ ^ 2 + ‖y‖ * ‖x‖ + ‖x‖ * ‖y‖ + ‖y‖ ^ 2 := by
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Analysis/Calculus/FDeriv/Measurable.lean
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ theorem D_subset_differentiable_set {K : Set (E →L[𝕜] F)} (hK : IsComplete
‖L e p q - L e p r + (L e p r - L e' p' r) + (L e' p' r - L e' p' q')‖ := by
congr 1; abel
_ ≤ ‖L e p q - L e p r‖ + ‖L e p r - L e' p' r‖ + ‖L e' p' r - L e' p' q'‖ :=
norm_add₃_le _ _ _
norm_add₃_le
_ ≤ 4 * ‖c‖ * (1 / 2) ^ e + 4 * ‖c‖ * (1 / 2) ^ e + 4 * ‖c‖ * (1 / 2) ^ e := by gcongr
_ = 12 * ‖c‖ * (1 / 2) ^ e := by ring
/- For definiteness, use `L0 e = L e (n e) (n e)`, to have a single sequence. We claim that this
Expand Down Expand Up @@ -843,7 +843,7 @@ lemma isOpen_A_with_param {r s : ℝ} (hf : Continuous f.uncurry) (L : E →L[
calc
‖f a' z - f a' y - (L z - L y)‖ =
‖(f a' z - f a z) + (f a y - f a' y) + (f a z - f a y - (L z - L y))‖ := by congr; abel
_ ≤ ‖f a' z - f a z‖ + ‖f a y - f a' y‖ + ‖f a z - f a y - (L z - L y)‖ := norm_add₃_le _ _ _
_ ≤ ‖f a' z - f a z‖ + ‖f a y - f a' y‖ + ‖f a z - f a y - (L z - L y)‖ := norm_add₃_le
_ ≤ ε + ε + b := by
gcongr
· rw [← dist_eq_norm]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/Calculus/Rademacher.lean
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ theorem hasFderivAt_of_hasLineDerivAt_of_closure
_ = ‖(f (x + ρ • w) - f (x + ρ • y)) + (ρ • L y - ρ • L w)
+ (f (x + ρ • y) - f x - ρ • L y)‖ := by congr; abel
_ ≤ ‖f (x + ρ • w) - f (x + ρ • y)‖ + ‖ρ • L y - ρ • L w‖
+ ‖f (x + ρ • y) - f x - ρ • L y‖ := norm_add₃_le _ _ _
+ ‖f (x + ρ • y) - f x - ρ • L y‖ := norm_add₃_le
_ ≤ C * ‖(x + ρ • w) - (x + ρ • y)‖ + ρ * (‖L‖ * ‖y - w‖) + δ * ρ := by
gcongr
· exact hf.norm_sub_le _ _
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Analysis/Convex/Uniform.lean
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ theorem exists_forall_closed_ball_dist_add_le_two_sub (hε : 0 < ε) :
_ ≤ _ := by
have : ∀ x' y', x - y = x' - y' + (x - x') + (y' - y) := fun _ _ => by abel
rw [sub_le_iff_le_add, norm_sub_rev _ x, ← add_assoc, this]
exact norm_add₃_le _ _ _
exact norm_add₃_le
calc
‖x + y‖ ≤ ‖x' + y'‖ + ‖x' - x‖ + ‖y' - y‖ := by
have : ∀ x' y', x + y = x' + y' + (x - x') + (y - y') := fun _ _ => by abel
rw [norm_sub_rev, norm_sub_rev y', this]
exact norm_add₃_le _ _ _
exact norm_add₃_le
_ ≤ 2 - δ + δ' + δ' :=
(add_le_add_three (h (h₁ _ hx') (h₁ _ hy') hxy') (h₂ _ hx hx'.le) (h₂ _ hy hy'.le))
_ ≤ 2 - δ' := by
Expand Down
13 changes: 12 additions & 1 deletion Mathlib/Analysis/Normed/Field/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ instance MulOpposite.normOneClass [SeminormedAddCommGroup α] [One α] [NormOneC

section NonUnitalSeminormedRing

variable [NonUnitalSeminormedRing α]
variable [NonUnitalSeminormedRing α] {a a₁ a₂ b c : α}

theorem norm_mul_le (a b : α) : ‖a * b‖ ≤ ‖a‖ * ‖b‖ :=
NonUnitalSeminormedRing.norm_mul _ _
Expand All @@ -221,6 +221,17 @@ theorem nnnorm_mul_le (a b : α) : ‖a * b‖₊ ≤ ‖a‖₊ * ‖b‖₊ :=
simpa only [← norm_toNNReal, ← Real.toNNReal_mul (norm_nonneg _)] using
Real.toNNReal_mono (norm_mul_le _ _)

lemma norm_mul_le_of_le {r₁ r₂ : ℝ} (h₁ : ‖a₁‖ ≤ r₁) (h₂ : ‖a₂‖ ≤ r₂) : ‖a₁ * a₂‖ ≤ r₁ * r₂ :=
(norm_mul_le ..).trans <| mul_le_mul h₁ h₂ (norm_nonneg _) ((norm_nonneg _).trans h₁)

lemma nnnorm_mul_le_of_le {r₁ r₂ : ℝ≥0} (h₁ : ‖a₁‖₊ ≤ r₁) (h₂ : ‖a₂‖₊ ≤ r₂) :
‖a₁ * a₂‖₊ ≤ r₁ * r₂ := (nnnorm_mul_le ..).trans <| mul_le_mul' h₁ h₂

lemma norm_mul₃_le : ‖a * b * c‖ ≤ ‖a‖ * ‖b‖ * ‖c‖ := norm_mul_le_of_le (norm_mul_le ..) le_rfl

lemma nnnorm_mul₃_le : ‖a * b * c‖₊ ≤ ‖a‖₊ * ‖b‖₊ * ‖c‖₊ :=
nnnorm_mul_le_of_le (norm_mul_le ..) le_rfl

theorem one_le_norm_one (β) [NormedRing β] [Nontrivial β] : 1 ≤ ‖(1 : β)‖ :=
(le_mul_iff_one_le_left <| norm_pos_iff.mpr (one_ne_zero : (1 : β) ≠ 0)).mp
(by simpa only [mul_one] using norm_mul_le (1 : β) 1)
Expand Down
15 changes: 8 additions & 7 deletions Mathlib/Analysis/Normed/Group/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ abbrev GroupNorm.toNormedCommGroup [CommGroup E] (f : GroupNorm E) : NormedCommG
section SeminormedGroup

variable [SeminormedGroup E] [SeminormedGroup F] [SeminormedGroup G] {s : Set E}
{a a₁ a₂ b b₁ b₂ : E} {r r₁ r₂ : ℝ}
{a a₁ a₂ b b₁ b₂ c : E} {r r₁ r₂ : ℝ}

@[to_additive]
theorem dist_eq_norm_div (a b : E) : dist a b = ‖a / b‖ :=
Expand Down Expand Up @@ -387,13 +387,14 @@ theorem dist_mulIndicator (s t : Set α) (f : α → E) (x : α) :
theorem norm_mul_le' (a b : E) : ‖a * b‖ ≤ ‖a‖ + ‖b‖ := by
simpa [dist_eq_norm_div] using dist_triangle a 1 b⁻¹

@[to_additive]
theorem norm_mul_le_of_le (h₁ : ‖a₁‖ ≤ r₁) (h₂ : ‖a₂‖ ≤ r₂) : ‖a₁ * a₂‖ ≤ r₁ + r₂ :=
/-- **Triangle inequality** for the norm. -/
@[to_additive norm_add_le_of_le "**Triangle inequality** for the norm."]
theorem norm_mul_le_of_le' (h₁ : ‖a₁‖ ≤ r₁) (h₂ : ‖a₂‖ ≤ r₂) : ‖a₁ * a₂‖ ≤ r₁ + r₂ :=
(norm_mul_le' a₁ a₂).trans <| add_le_add h₁ h₂

@[to_additive norm_add₃_le]
theorem norm_mul₃_le (a b c : E) : ‖a * b * c‖ ≤ ‖a‖ + ‖b‖ + ‖c‖ :=
norm_mul_le_of_le (norm_mul_le' _ _) le_rfl
/-- **Triangle inequality** for the norm. -/
@[to_additive norm_add₃_le "**Triangle inequality** for the norm."]
lemma norm_mul₃_le' : ‖a * b * c‖ ≤ ‖a‖ + ‖b‖ + ‖c‖ := norm_mul_le_of_le' (norm_mul_le' _ _) le_rfl

@[to_additive]
lemma norm_div_le_norm_div_add_norm_div (a b c : E) : ‖a / c‖ ≤ ‖a / b‖ + ‖b / c‖ := by
Expand Down Expand Up @@ -1049,7 +1050,7 @@ theorem norm_pow_le_mul_norm (n : ℕ) (a : E) : ‖a ^ n‖ ≤ n * ‖a‖ :=
induction n with
| zero => simp
| succ n ih =>
simpa only [pow_succ, Nat.cast_succ, add_mul, one_mul] using norm_mul_le_of_le ih le_rfl
simpa only [pow_succ, Nat.cast_succ, add_mul, one_mul] using norm_mul_le_of_le' ih le_rfl

@[to_additive nnnorm_nsmul_le]
theorem nnnorm_pow_le_mul_norm (n : ℕ) (a : E) : ‖a ^ n‖₊ ≤ n * ‖a‖₊ := by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/Normed/Group/Pointwise.lean
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ theorem Bornology.IsBounded.mul (hs : IsBounded s) (ht : IsBounded t) : IsBounde
obtain ⟨Rt, hRt⟩ : ∃ R, ∀ x ∈ t, ‖x‖ ≤ R := ht.exists_norm_le'
refine isBounded_iff_forall_norm_le'.2 ⟨Rs + Rt, ?_⟩
rintro z ⟨x, hx, y, hy, rfl⟩
exact norm_mul_le_of_le (hRs x hx) (hRt y hy)
exact norm_mul_le_of_le' (hRs x hx) (hRt y hy)

@[to_additive]
theorem Bornology.IsBounded.of_mul (hst : IsBounded (s * t)) : IsBounded s ∨ IsBounded t :=
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Probability/StrongLaw.lean
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ lemma strong_law_ae_of_measurable
abel
_ ≤ ‖(n : ℝ)⁻¹ • ∑ i ∈ Finset.range n, (X i ω - Y k i ω)‖ +
‖(n : ℝ)⁻¹ • ∑ i ∈ Finset.range n, Y k i ω - μ [Y k 0]‖ + ‖μ [Y k 0] - μ [X 0]‖ :=
norm_add₃_le _ _ _
norm_add₃_le
_ ≤ (∑ i ∈ Finset.range n, ‖X i ω - Y k i ω‖) / n + δ + δ := by
gcongr
simp only [Function.comp_apply, norm_smul, norm_inv, RCLike.norm_natCast,
Expand Down

0 comments on commit e3e46c3

Please sign in to comment.