diff --git a/LeanTQI/VectorNorm.lean b/LeanTQI/VectorNorm.lean index bf9cc72..2ddab81 100755 --- a/LeanTQI/VectorNorm.lean +++ b/LeanTQI/VectorNorm.lean @@ -109,7 +109,7 @@ def LpNorm (p : ℝβ‰₯0∞) (M : Matrix m n 𝕂) : ℝ := /-- a function of lpnorm, of which LpNorm p M = β€–Mβ€–β‚Š for p-/ @[simp] -def NNLpNorm (p : ℝβ‰₯0∞) [Fact (1 ≀ p)] (M : Matrix m n 𝕂) : ℝ := +def LpNNNorm (p : ℝβ‰₯0∞) [Fact (1 ≀ p)] (M : Matrix m n 𝕂) : ℝ := if p = ∞ then ⨆ i, ⨆ j, β€–M i jβ€–β‚Š else (βˆ‘ i, βˆ‘ j, β€–M i jβ€–β‚Š ^ p.toReal) ^ (1 / p.toReal) @@ -308,8 +308,6 @@ theorem Finset.single_le_sum' [OrderedAddCommMonoid Ξ±] (M : m β†’ n β†’ Ξ±) (h -- Preorder.le_trans β€–M i jβ€– (βˆ‘ k : n, β€–M i kβ€–) (βˆ‘ k : m, βˆ‘ l : n, β€–M k lβ€–) (single_le_row M i j) -- (row_le_sum M i) -example (f : m β†’ ℝ) : βˆ‘ i, (f i) ^ p.toReal ≀ (βˆ‘ i, f i) ^ p.toReal := by - sorry -- apply? #check lp.sum_rpow_le_norm_rpow @@ -374,6 +372,7 @@ example (p₁ pβ‚‚ : ℝβ‰₯0∞) [Fact (1 ≀ p₁)] [Fact (1 ≀ pβ‚‚)] (h₁ : enter [2] intro j rw [this i j] + generalize (pβ‚‚.toReal - p₁.toReal) / p₁.toReal = p sorry -- apply lp.sum_rpow_le_norm_rpow @@ -428,6 +427,111 @@ example (p₁ pβ‚‚ : ℝβ‰₯0∞) [Fact (1 ≀ p₁)] [Fact (1 ≀ pβ‚‚)] (h₁ : + + +example [Fact (1 ≀ p)] : p β‰  0 := ge_one_ne_zero p + +example [Fact (1 ≀ p)] (h : p β‰  ⊀) : p⁻¹ β‰  0 := ENNReal.inv_ne_zero.mpr h + +example [Fact (1 ≀ p)] (h : p β‰  ⊀) : p.toReal β‰  0 := ge_one_toReal_ne_zero p h + +example [Fact (1 ≀ p)] (h : p β‰  ⊀) : p.toReal⁻¹ β‰  0 := inv_ne_zero (ge_one_toReal_ne_zero p h) + + +example [Fact (1 ≀ p)] : 0 ≀ p := by exact zero_le p + +example [Fact (1 ≀ p)] : 0 ≀ p.toReal := by exact ENNReal.toReal_nonneg + + + + + + + + + + + +theorem lpnorm_eq0_iff : LpNorm p M = 0 ↔ M = 0 := by + rw [← lp_norm_eq_lpnorm] + exact norm_eq_zero + +theorem lpnorm_nonneg : 0 ≀ LpNorm p M := by + rw [← lp_norm_eq_lpnorm] + exact norm_nonneg M + +theorem lpnorm_rpow_nonneg (h : 0 ≀ LpNorm p M) : 0 ≀ βˆ‘ i, βˆ‘ j, β€–M i jβ€– ^ p.toReal := by + apply Fintype.sum_nonneg + have : βˆ€ i, 0 ≀ (fun i ↦ βˆ‘ j : n, β€–M i jβ€– ^ p.toReal) i := by + intro i + simp only + apply Fintype.sum_nonneg + intro j + simp only + simp only [Pi.zero_apply] + exact Real.rpow_nonneg (norm_nonneg (M i j)) p.toReal + exact this + +theorem lpnorm_rpow_ne0 (h : LpNorm p M β‰  0) : βˆ‘ i, βˆ‘ j, β€–M i jβ€– ^ p.toReal β‰  0 := by + simp only [LpNorm, one_div, ne_eq] at h + intro g + rw [g] at h + by_cases h' : p = ⊀ + Β· simp only [if_pos h'] at h + sorry + Β· simp only [if_neg h'] at h + rw [Real.zero_rpow <| inv_ne_zero <| ge_one_toReal_ne_zero p h'] at h + contradiction + +example (p₁ pβ‚‚ : ℝβ‰₯0∞) [Fact (1 ≀ p₁)] [Fact (1 ≀ pβ‚‚)] (h₁ : p₁ β‰  ⊀) (hβ‚‚ : pβ‚‚ β‰  ⊀) (ple : p₁ ≀ pβ‚‚) : + LpNorm pβ‚‚ M ≀ LpNorm p₁ M := by + by_cases h : p₁ = pβ‚‚ + Β· rw [h] + have plt : p₁ < pβ‚‚ := by exact LE.le.lt_of_ne ple h + by_cases g : LpNorm pβ‚‚ M = 0 + Β· rw [g] + rw [← lp_norm_eq_lpnorm] at g + rw [(lpnorm_eq0_iff p₁ M).mpr (norm_eq_zero.mp g)] + have eq1 : βˆ‘ i, βˆ‘ j, (β€–M i jβ€– / LpNorm pβ‚‚ M)^pβ‚‚.toReal = 1 := by + simp only [LpNorm, one_div, if_neg hβ‚‚] + have : βˆ€ i j, (β€–M i jβ€– / (βˆ‘ i : m, βˆ‘ j : n, β€–M i jβ€– ^ pβ‚‚.toReal) ^ pβ‚‚.toReal⁻¹) ^ pβ‚‚.toReal = + (β€–M i jβ€– ^ pβ‚‚.toReal) / ((βˆ‘ i : m, βˆ‘ j : n, β€–M i jβ€– ^ pβ‚‚.toReal)) := by + intro i j + rw [Real.div_rpow (norm_nonneg (M i j))] + congr + rw [← Real.rpow_mul, mul_comm, CommGroupWithZero.mul_inv_cancel, Real.rpow_one] + Β· exact ge_one_toReal_ne_zero pβ‚‚ hβ‚‚ + Β· exact lpnorm_rpow_nonneg pβ‚‚ M (lpnorm_nonneg pβ‚‚ M) + Β· exact Real.rpow_nonneg (lpnorm_rpow_nonneg pβ‚‚ M (lpnorm_nonneg pβ‚‚ M)) pβ‚‚.toReal⁻¹ + simp_rw [this] + have : βˆ‘ x : m, βˆ‘ x_1 : n, β€–M x x_1β€– ^ pβ‚‚.toReal / βˆ‘ i : m, βˆ‘ j : n, β€–M i jβ€– ^ pβ‚‚.toReal = + (βˆ‘ x : m, βˆ‘ x_1 : n, β€–M x x_1β€– ^ pβ‚‚.toReal) / (βˆ‘ i : m, βˆ‘ j : n, β€–M i jβ€– ^ pβ‚‚.toReal) := by + simp_rw [div_eq_inv_mul] + conv_lhs => + enter [2] + intro i + rw [← Finset.mul_sum] + rw [← Finset.mul_sum] + simp_rw [this] + rw [div_self (lpnorm_rpow_ne0 pβ‚‚ M g)] + have le1 : βˆ‘ i, βˆ‘ j, (β€–M i jβ€– / LpNorm pβ‚‚ M)^pβ‚‚.toReal ≀ βˆ‘ i, βˆ‘ j, (β€–M i jβ€– / LpNorm pβ‚‚ M)^p₁.toReal := by + sorry + have eq2 : βˆ‘ i, βˆ‘ j, (β€–M i jβ€– / LpNorm pβ‚‚ M)^p₁.toReal = ((LpNorm p₁ M) / (LpNorm pβ‚‚ M))^p₁.toReal := by + sorry + have le2 : 1 ≀ ((LpNorm p₁ M) / (LpNorm pβ‚‚ M))^p₁.toReal := by + rw [eq2, eq1] at le1 + exact le1 + have le3 : 1 ≀ (LpNorm p₁ M) / (LpNorm pβ‚‚ M) := by + rw [Eq.symm (Real.one_rpow p₁.toReal)] at le2 + apply (Real.rpow_le_rpow_iff (zero_le_one' ℝ) _ ((ENNReal.toReal_pos_iff_ne_top p₁).mpr h₁)).mp le2 + rw [div_eq_inv_mul] + exact Left.mul_nonneg (inv_nonneg_of_nonneg <| lpnorm_nonneg pβ‚‚ M) (lpnorm_nonneg p₁ M) + have : 0 < LpNorm pβ‚‚ M := + lt_of_le_of_ne (lpnorm_nonneg pβ‚‚ M) fun a ↦ g (id (Eq.symm a)) + exact (one_le_divβ‚€ this).mp le3 + + + #check mul_le_mul_of_nonneg_left