Skip to content

Commit

Permalink
feat(Analysis/SpecialFunctions/Pow/NNReal): Specialise some lemmas to…
Browse files Browse the repository at this point in the history
… natural/integers powers (#16248)

... and lemmas about negative real powers

From LeanAPAP
  • Loading branch information
YaelDillies committed Sep 9, 2024
1 parent 7ebd1b2 commit 0c4fd28
Show file tree
Hide file tree
Showing 15 changed files with 185 additions and 90 deletions.
12 changes: 6 additions & 6 deletions Mathlib/Analysis/FunctionalSpaces/SobolevInequality.lean
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ theorem lintegral_pow_le_pow_lintegral_fderiv {u : E → F}
refine (Continuous.nnnorm ?_).measurable.coe_nnreal_ennreal
exact (hu.continuous_fderiv le_rfl).comp e.symm.continuous
_ = (‖(e.symm : (ι → ℝ) →L[ℝ] E)‖₊ ^ p : ℝ≥0) * (∫⁻ y, ‖fderiv ℝ u (e.symm y)‖₊) ^ p := by
rw [ENNReal.mul_rpow_of_nonneg _ _ h0p, ENNReal.coe_rpow_of_nonneg _ h0p]
rw [ENNReal.mul_rpow_of_nonneg _ _ h0p, ENNReal.coe_rpow_of_nonneg _ h0p]
_ = (‖(e.symm : (ι → ℝ) →L[ℝ] E)‖₊ ^ p : ℝ≥0)
* (∫⁻ x, ‖fderiv ℝ u x‖₊ ∂(volume : Measure (ι → ℝ)).map e.symm) ^ p := by
congr
Expand All @@ -430,7 +430,7 @@ theorem lintegral_pow_le_pow_lintegral_fderiv {u : E → F}
fun_prop
rw [← ENNReal.mul_le_mul_left h3c ENNReal.coe_ne_top, ← mul_assoc, ← ENNReal.coe_mul, ← hC,
ENNReal.coe_mul] at this
rw [ENNReal.mul_rpow_of_nonneg _ _ h0p, ← mul_assoc, ENNReal.coe_rpow_of_ne_zero hc.ne']
rw [ENNReal.mul_rpow_of_nonneg _ _ h0p, ← mul_assoc, ENNReal.coe_rpow_of_ne_zero hc.ne']
exact this

/-- The constant factor occurring in the conclusion of `eLpNorm_le_eLpNorm_fderiv_one`.
Expand All @@ -448,7 +448,7 @@ theorem eLpNorm_le_eLpNorm_fderiv_one {u : E → F} (hu : ContDiff ℝ 1 u) (h2
have h0p : 0 < (p : ℝ) := hp.coe.symm.pos
rw [eLpNorm_one_eq_lintegral_nnnorm,
← ENNReal.rpow_le_rpow_iff h0p, ENNReal.mul_rpow_of_nonneg _ _ h0p.le,
ENNReal.coe_rpow_of_nonneg _ h0p.le, eLpNormLESNormFDerivOneConst, ← NNReal.rpow_mul,
ENNReal.coe_rpow_of_nonneg _ h0p.le, eLpNormLESNormFDerivOneConst, ← NNReal.rpow_mul,
eLpNorm_nnreal_pow_eq_lintegral hp.symm.pos.ne',
inv_mul_cancel₀ h0p.ne', NNReal.rpow_one]
exact lintegral_pow_le_pow_lintegral_fderiv μ hu h2u hp.coe
Expand Down Expand Up @@ -553,13 +553,13 @@ theorem eLpNorm_le_eLpNorm_fderiv_of_eq_inner {u : E → F'}
calc (∫⁻ x, ‖u x‖₊ ^ (p' : ℝ) ∂μ) ^ (1 / (n' : ℝ)) = eLpNorm v n' μ := by
rw [← h2γ, eLpNorm_nnreal_eq_lintegral hn.symm.pos.ne']
simp (discharger := positivity) [v, Real.nnnorm_rpow_of_nonneg, ENNReal.rpow_mul,
ENNReal.coe_rpow_of_nonneg]
ENNReal.coe_rpow_of_nonneg]
_ ≤ C * eLpNorm (fderiv ℝ v) 1 μ := eLpNorm_le_eLpNorm_fderiv_one μ hv h2v hn
_ = C * ∫⁻ x, ‖fderiv ℝ v x‖₊ ∂μ := by rw [eLpNorm_one_eq_lintegral_nnnorm]
_ ≤ C * γ * ∫⁻ x, ‖u x‖₊ ^ ((γ : ℝ) - 1) * ‖fderiv ℝ u x‖₊ ∂μ := by
rw [mul_assoc, ← lintegral_const_mul γ]
gcongr
simp_rw [← mul_assoc, ENNReal.coe_rpow_of_nonneg _ (sub_nonneg.mpr h1γ.le)]
simp_rw [← mul_assoc, ENNReal.coe_rpow_of_nonneg _ (sub_nonneg.mpr h1γ.le)]
exact ENNReal.coe_le_coe.mpr <| nnnorm_fderiv_norm_rpow_le (hu.differentiable le_rfl) h1γ
fun_prop
_ ≤ C * γ * ((∫⁻ x, ‖u x‖₊ ^ (p' : ℝ) ∂μ) ^ (1 / q) *
Expand Down Expand Up @@ -697,7 +697,7 @@ theorem eLpNorm_le_eLpNorm_fderiv_of_le [FiniteDimensional ℝ F]
= eLpNorm u q (μ.restrict s) := by rw [eLpNorm_restrict_eq_of_support_subset h2u]
_ ≤ eLpNorm u p' (μ.restrict s) * t := by
convert eLpNorm_le_eLpNorm_mul_rpow_measure_univ this hu.continuous.aestronglyMeasurable
rw [ENNReal.coe_rpow_of_nonneg]
rw [ENNReal.coe_rpow_of_nonneg]
· simp [ENNReal.coe_toNNReal hs.measure_lt_top.ne]
· rw [one_div, one_div]
norm_cast
Expand Down
16 changes: 8 additions & 8 deletions Mathlib/Analysis/MeanInequalities.lean
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ theorem young_inequality (a b : ℝ≥0∞) {p q : ℝ} (hpq : p.IsConjExponent
cases' h with h h <;> rw [h] <;> simp [h, hpq.pos, hpq.symm.pos]
push_neg at h
-- if a ≠ ⊤ and b ≠ ⊤, use the nnreal version: nnreal.young_inequality_real
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, ←
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
Expand Down Expand Up @@ -520,7 +520,7 @@ theorem isGreatest_Lp (f : ι → ℝ≥0) {p q : ℝ} (hpq : p.IsConjExponent q
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_iff, ← mul_div_assoc, B]
rpow_sub' A, add_sub_cancel_right, le_refl, true_and_iff, ← mul_div_assoc, B]
rw [div_eq_iff, ← rpow_add hf.ne', one_div, one_div, hpq.inv_add_inv_conj, rpow_one]
simpa [hpq.symm.ne_zero] using hf.ne'
· rintro _ ⟨g, hg, rfl⟩
Expand Down Expand Up @@ -795,8 +795,8 @@ theorem inner_le_Lp_mul_Lq (hpq : p.IsConjExponent q) :
ENNReal.sum_eq_top, not_or] using H'
have := ENNReal.coe_le_coe.2 (@NNReal.inner_le_Lp_mul_Lq _ s (fun i => ENNReal.toNNReal (f i))
(fun i => ENNReal.toNNReal (g i)) _ _ hpq)
simp [ENNReal.coe_rpow_of_nonneg, le_of_lt hpq.pos, le_of_lt hpq.one_div_pos,
le_of_lt hpq.symm.pos, le_of_lt hpq.symm.one_div_pos] at this
simp [ENNReal.coe_rpow_of_nonneg, hpq.pos.le, hpq.one_div_pos.le, hpq.symm.pos.le,
hpq.symm.one_div_pos.le] at this
convert this using 1 <;> [skip; congr 2] <;> [skip; skip; simp; skip; simp] <;>
· refine Finset.sum_congr rfl fun i hi => ?_
simp [H'.1 i hi, H'.2 i hi, -WithZero.coe_mul]
Expand All @@ -821,9 +821,9 @@ lemma inner_le_weight_mul_Lp_of_nonneg (s : Finset ι) {p : ℝ} (hp : 1 ≤ p)
have := coe_le_coe.2 <| NNReal.inner_le_weight_mul_Lp s hp.le (fun i ↦ ENNReal.toNNReal (w i))
fun i ↦ ENNReal.toNNReal (f i)
rw [coe_mul] at this
simp_rw [coe_rpow_of_nonneg _ <| inv_nonneg.2 hp₀.le, coe_finset_sum, ENNReal.toNNReal_rpow,
simp_rw [coe_rpow_of_nonneg _ <| inv_nonneg.2 hp₀.le, coe_finset_sum, ENNReal.toNNReal_rpow,
← ENNReal.toNNReal_mul, sum_congr rfl fun i hi ↦ coe_toNNReal (H'.2 i hi)] at this
simp [ENNReal.coe_rpow_of_nonneg, hp₀.le, hp₁.le] at this
simp [ENNReal.coe_rpow_of_nonneg, hp₀.le, hp₁.le] at this
convert this using 2 with i hi
· obtain hw | hw := eq_or_ne (w i) 0
· simp [hw]
Expand Down Expand Up @@ -864,7 +864,7 @@ theorem Lp_add_le (hp : 1 ≤ p) :
ENNReal.coe_le_coe.2
(@NNReal.Lp_add_le _ s (fun i => ENNReal.toNNReal (f i)) (fun i => ENNReal.toNNReal (g i)) _
hp)
push_cast [ENNReal.coe_rpow_of_nonneg, le_of_lt pos, le_of_lt (one_div_pos.2 pos)] at this
push_cast [ENNReal.coe_rpow_of_nonneg, le_of_lt pos, le_of_lt (one_div_pos.2 pos)] at this
convert this using 2 <;> [skip; congr 1; congr 1] <;>
· refine Finset.sum_congr rfl fun i hi => ?_
simp [H'.1 i hi, H'.2 i hi]
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Analysis/MeanInequalitiesPow.lean
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ theorem rpow_add_le_mul_rpow_add_rpow (z₁ z₂ : ℝ≥0) {p : ℝ} (hp : 1
· simp only [one_div, inv_mul_cancel_left₀, Ne, mul_eq_zero, two_ne_zero, one_ne_zero,
not_false_iff]
· have A : p - 10 := ne_of_gt (sub_pos.2 h'p)
simp only [mul_rpow, rpow_sub' _ A, div_eq_inv_mul, rpow_one, mul_one]
simp only [mul_rpow, rpow_sub' A, div_eq_inv_mul, rpow_one, mul_one]
ring

/-- Weighted generalized mean inequality, version for sums over finite sets, with `ℝ≥0`-valued
Expand Down Expand Up @@ -241,7 +241,7 @@ theorem rpow_arith_mean_le_arith_mean_rpow (w z : ι → ℝ≥0∞) (hw' : ∑
specialize h_top i hi
rwa [Ne, ← h_top_iff_rpow_top i hi]
-- put the `.toNNReal` inside the sums.
simp_rw [toNNReal_sum h_top_rpow, toNNReal_rpow, toNNReal_sum h_top, toNNReal_mul,
simp_rw [toNNReal_sum h_top_rpow, toNNReal_rpow, toNNReal_sum h_top, toNNReal_mul,
toNNReal_rpow]
-- use corresponding nnreal result
refine
Expand Down Expand Up @@ -282,7 +282,7 @@ theorem add_rpow_le_rpow_add {p : ℝ} (a b : ℝ≥0∞) (hp1 : 1 ≤ p) : a ^
obtain ⟨ha_top, hb_top⟩ := add_ne_top.mp h_top
lift a to ℝ≥0 using ha_top
lift b to ℝ≥0 using hb_top
simpa [ENNReal.coe_rpow_of_nonneg _ hp_pos.le] using
simpa [ENNReal.coe_rpow_of_nonneg _ hp_pos.le] using
ENNReal.coe_le_coe.2 (NNReal.add_rpow_le_rpow_add a b hp1)

theorem rpow_add_rpow_le_add {p : ℝ} (a b : ℝ≥0∞) (hp1 : 1 ≤ p) :
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/Normed/Lp/ProdLp.lean
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ theorem prod_antilipschitzWith_equiv_aux [PseudoEMetricSpace α] [PseudoEMetricS
gcongr <;> simp [edist]
_ = (2 ^ (1 / p.toReal) : ℝ≥0) * edist (WithLp.equiv p _ x) (WithLp.equiv p _ y) := by
simp only [← two_mul, ENNReal.mul_rpow_of_nonneg _ _ nonneg, ← ENNReal.rpow_mul, cancel,
ENNReal.rpow_one, ENNReal.coe_rpow_of_nonneg _ nonneg, coe_ofNat]
ENNReal.rpow_one, ENNReal.coe_rpow_of_nonneg _ nonneg, coe_ofNat]

theorem prod_aux_uniformity_eq [PseudoEMetricSpace α] [PseudoEMetricSpace β] :
𝓤 (WithLp p (α × β)) = 𝓤[instUniformSpaceProd] := by
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ lemma nnrpow_add {a : A} {x y : ℝ≥0} (hx : 0 < x) (hy : 0 < y) :
simp only [nnrpow_def]
rw [← cfcₙ_mul _ _ a]
congr! 2 with z
exact_mod_cast NNReal.rpow_add' z <| ne_of_gt (add_pos hx hy)
exact mod_cast z.rpow_add' <| ne_of_gt (add_pos hx hy)

@[simp]
lemma nnrpow_zero {a : A} : a ^ (0 : ℝ≥0) = 0 := by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/SpecialFunctions/Pow/Asymptotics.lean
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ theorem ENNReal.tendsto_rpow_at_top {y : ℝ} (hy : 0 < y) :
lift a to ℝ≥0 using ha'
-- Porting note: reduced defeq abuse
simp only [Set.mem_Ioi, coe_lt_coe] at ha hc
rw [ENNReal.coe_rpow_of_nonneg _ hy.le]
rw [ENNReal.coe_rpow_of_nonneg _ hy.le]
exact mod_cast hc a ha

end Limits
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ theorem eventually_pow_one_div_le {x : ℝ≥0∞} (hx : x ≠ ∞) {y : ℝ≥0
· lift y to ℝ≥0 using h
have := NNReal.eventually_pow_one_div_le x (mod_cast hy : 1 < y)
refine this.congr (Eventually.of_forall fun n => ?_)
rw [coe_rpow_of_nonneg x (by positivity : 0 ≤ (1 / n : ℝ)), coe_le_coe]
rw [coe_rpow_of_nonneg x (by positivity : 0 ≤ (1 / n : ℝ)), coe_le_coe]

private theorem continuousAt_rpow_const_of_pos {x : ℝ≥0∞} {y : ℝ} (h : 0 < y) :
ContinuousAt (fun a : ℝ≥0∞ => a ^ y) x := by
Expand All @@ -457,7 +457,7 @@ private theorem continuousAt_rpow_const_of_pos {x : ℝ≥0∞} {y : ℝ} (h : 0
rw [continuousAt_coe_iff]
convert continuous_coe.continuousAt.comp (NNReal.continuousAt_rpow_const (Or.inr h.le)) using 1
ext1 x
simp [coe_rpow_of_nonneg _ h.le]
simp [coe_rpow_of_nonneg _ h.le]

@[continuity, fun_prop]
theorem continuous_rpow_const {y : ℝ} : Continuous fun a : ℝ≥0∞ => a ^ y := by
Expand Down
Loading

0 comments on commit 0c4fd28

Please sign in to comment.