Skip to content

Commit

Permalink
chore: Rename rpow_nonneg_of_nonneg to rpow_nonneg (#9518)
Browse files Browse the repository at this point in the history
This better matches other lemma names.

From LeanAPAP
  • Loading branch information
YaelDillies committed Jan 8, 2024
1 parent 46aac50 commit 494478b
Show file tree
Hide file tree
Showing 32 changed files with 76 additions and 68 deletions.
2 changes: 1 addition & 1 deletion Mathlib/Analysis/Distribution/SchwartzSpace.lean
Expand Up @@ -163,7 +163,7 @@ theorem isBigO_cocompact_rpow [ProperSpace E] (s : ℝ) :
from this.comp_tendsto tendsto_norm_cocompact_atTop
simp_rw [Asymptotics.IsBigO, Asymptotics.IsBigOWith]
refine' ⟨1, (Filter.eventually_ge_atTop 1).mono fun x hx => _⟩
rw [one_mul, Real.norm_of_nonneg (Real.rpow_nonneg_of_nonneg (zero_le_one.trans hx) _),
rw [one_mul, Real.norm_of_nonneg (Real.rpow_nonneg (zero_le_one.trans hx) _),
Real.norm_of_nonneg (zpow_nonneg (zero_le_one.trans hx) _), ← Real.rpow_int_cast, Int.cast_neg,
Int.cast_ofNat]
exact Real.rpow_le_rpow_of_exponent_le hx hk
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/Fourier/PoissonSummation.lean
Expand Up @@ -165,7 +165,7 @@ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
rw [max_lt_iff] at hx'
rw [norm_norm,
ContinuousMap.norm_le _
(mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))]
(mul_nonneg (mul_nonneg hc.le <| rpow_nonneg one_half_pos.le _) (norm_nonneg _))]
refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _
have A : ∀ x : ℝ, 0 ≤ |x| ^ (-b) := fun x => by positivity
rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)]
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Analysis/MeanInequalities.lean
Expand Up @@ -138,7 +138,7 @@ theorem geom_mean_le_arith_mean {ι : Type*} (s : Finset ι) (w : ι → ℝ) (z
(hw : ∀ i ∈ s, 0 ≤ w i) (hw' : 0 < ∑ i in s, w i) (hz : ∀ i ∈ s, 0 ≤ z i) :
(∏ i in s, z i ^ w i) ^ (∑ i in s, w i)⁻¹ ≤ (∑ i in s, w i * z i) / (∑ i in s, w i) := by
convert geom_mean_le_arith_mean_weighted s (fun i => (w i) / ∑ i in s, w i) z ?_ ?_ hz using 2
· rw [← finset_prod_rpow _ _ (fun i hi => rpow_nonneg_of_nonneg (hz _ hi) _) _]
· 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]
Expand Down Expand Up @@ -264,7 +264,7 @@ theorem young_inequality_of_nonneg {a b p q : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b)
(hpq : p.IsConjugateExponent 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.one_div_nonneg hpq.symm.one_div_nonneg
(rpow_nonneg_of_nonneg ha p) (rpow_nonneg_of_nonneg hb q) hpq.inv_add_inv_conj
(rpow_nonneg ha p) (rpow_nonneg hb q) hpq.inv_add_inv_conj
#align real.young_inequality_of_nonneg Real.young_inequality_of_nonneg

/-- Young's inequality, a version for arbitrary real numbers. -/
Expand Down Expand Up @@ -594,7 +594,7 @@ theorem Lp_add_le (hp : 1 ≤ p) :
(NNReal.Lp_add_le s (fun i => ⟨_, abs_nonneg (f i)⟩) (fun i => ⟨_, abs_nonneg (g i)⟩) hp)
push_cast at this
refine' le_trans (rpow_le_rpow _ (sum_le_sum fun i _ => _) _) this <;>
simp [sum_nonneg, rpow_nonneg_of_nonneg, abs_nonneg, le_trans zero_le_one hp, abs_add,
simp [sum_nonneg, rpow_nonneg, abs_nonneg, le_trans zero_le_one hp, abs_add,
rpow_le_rpow]
#align real.Lp_add_le Real.Lp_add_le

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Analysis/MeanInequalitiesPow.lean
Expand Up @@ -104,9 +104,9 @@ theorem arith_mean_le_rpow_mean (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i)
rw [← rpow_le_rpow_iff _ _ this, ← rpow_mul, one_div_mul_cancel (ne_of_gt this), rpow_one]
exact rpow_arith_mean_le_arith_mean_rpow s w z hw hw' hz hp
all_goals
apply_rules [sum_nonneg, rpow_nonneg_of_nonneg]
apply_rules [sum_nonneg, rpow_nonneg]
intro i hi
apply_rules [mul_nonneg, rpow_nonneg_of_nonneg, hw i hi, hz i hi]
apply_rules [mul_nonneg, rpow_nonneg, hw i hi, hz i hi]
#align real.arith_mean_le_rpow_mean Real.arith_mean_le_rpow_mean

end Real
Expand Down
8 changes: 4 additions & 4 deletions Mathlib/Analysis/MellinTransform.lean
Expand Up @@ -226,8 +226,8 @@ theorem mellin_convergent_top_of_isBigO {f : ℝ → ℝ}
‖t ^ (s - 1) * f t‖ ≤ t ^ (s - 1 + -a) * d := by
refine' (ae_restrict_mem measurableSet_Ioi).mono fun t ht => _
have ht' : 0 < t := he'.trans ht
rw [norm_mul, rpow_add ht', ← norm_of_nonneg (rpow_nonneg_of_nonneg ht'.le (-a)), mul_assoc,
mul_comm _ d, norm_of_nonneg (rpow_nonneg_of_nonneg ht'.le _)]
rw [norm_mul, rpow_add ht', ← norm_of_nonneg (rpow_nonneg ht'.le (-a)), mul_assoc,
mul_comm _ d, norm_of_nonneg (rpow_nonneg ht'.le _)]
gcongr
exact he t ((le_max_left e 1).trans_lt ht).le
refine' (HasFiniteIntegral.mul_const _ _).mono' this
Expand Down Expand Up @@ -261,7 +261,7 @@ theorem mellin_convergent_zero_of_isBigO {b : ℝ} {f : ℝ → ℝ}
exact ht.2
· calc _ ≤ d * ‖t ^ (-b)‖ * ‖t ^ (s - 1)‖ := by gcongr
_ = d * t ^ (s - b - 1) := ?_
simp_rw [norm_of_nonneg (rpow_nonneg_of_nonneg (le_of_lt ht.1) _), mul_assoc]
simp_rw [norm_of_nonneg (rpow_nonneg (le_of_lt ht.1) _), mul_assoc]
rw [← rpow_add ht.1]
congr 2
abel
Expand Down Expand Up @@ -375,7 +375,7 @@ theorem mellin_hasDerivAt_of_isBigO_rpow [CompleteSpace E] [NormedSpace ℂ E] {
rw [Complex.norm_eq_abs, abs_cpow_eq_rpow_re_of_pos ht]
rcases le_or_lt 1 t with h | h
· refine' le_add_of_le_of_nonneg (rpow_le_rpow_of_exponent_le h _)
(rpow_nonneg_of_nonneg (zero_le_one.trans h) _)
(rpow_nonneg (zero_le_one.trans h) _)
rw [sub_re, one_re, sub_le_sub_iff_right]
rw [mem_ball_iff_norm, Complex.norm_eq_abs] at hz
have hz' := (re_le_abs _).trans hz.le
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Analysis/NormedSpace/PiLp.lean
Expand Up @@ -625,9 +625,9 @@ instance normedSpace [∀ i, SeminormedAddCommGroup (β i)] [∀ i, NormedSpace
have smul_apply : ∀ i : ι, (c • f) i = c • (f i) := fun i => rfl
simp only [norm_eq_sum (zero_lt_one.trans_le hp), norm_smul, Real.mul_rpow, norm_nonneg, ←
Finset.mul_sum, smul_apply]
rw [mul_rpow (rpow_nonneg_of_nonneg (norm_nonneg _) _), ← rpow_mul (norm_nonneg _), this,
rw [mul_rpow (rpow_nonneg (norm_nonneg _) _), ← rpow_mul (norm_nonneg _), this,
Real.rpow_one]
exact Finset.sum_nonneg fun i _ => rpow_nonneg_of_nonneg (norm_nonneg _) _ }
exact Finset.sum_nonneg fun i _ => rpow_nonneg (norm_nonneg _) _ }
#align pi_Lp.normed_space PiLp.normedSpace

/- Register simplification lemmas for the applications of `PiLp` elements, as the usual lemmas
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/NormedSpace/ProdLp.lean
Expand Up @@ -745,7 +745,7 @@ instance instProdNormedSpace : NormedSpace 𝕜 (WithLp p (α × β)) where
have smul_snd : (c • f).snd = c • f.snd := rfl
simp only [prod_norm_eq_add (zero_lt_one.trans_le hp), norm_smul, Real.mul_rpow,
norm_nonneg, smul_fst, smul_snd]
rw [← mul_add, mul_rpow (rpow_nonneg_of_nonneg (norm_nonneg _) _),
rw [← mul_add, mul_rpow (rpow_nonneg (norm_nonneg _) _),
← rpow_mul (norm_nonneg _), this, Real.rpow_one]
positivity

Expand Down
14 changes: 7 additions & 7 deletions Mathlib/Analysis/NormedSpace/lpSpace.lean
Expand Up @@ -121,7 +121,7 @@ theorem memℓp_gen' {C : ℝ} {f : ∀ i, E i} (hf : ∀ s : Finset α, ∑ i i
use ⨆ s : Finset α, ∑ i in s, ‖f i‖ ^ p.toReal
apply hasSum_of_isLUB_of_nonneg
· intro b
exact Real.rpow_nonneg_of_nonneg (norm_nonneg _) _
exact Real.rpow_nonneg (norm_nonneg _) _
apply isLUB_ciSup
use C
rintro - ⟨s, rfl⟩
Expand Down Expand Up @@ -206,7 +206,7 @@ theorem of_exponent_ge {p q : ℝ≥0∞} {f : ∀ i, E i} (hfq : Memℓp f q) (
exact H.subset fun i hi => Real.one_le_rpow hi hq.le
· show ∀ i, ¬|‖f i‖ ^ p.toReal| ≤ ‖f i‖ ^ q.toReal → 1 ≤ ‖f i‖
intro i hi
have : 0 ≤ ‖f i‖ ^ p.toReal := Real.rpow_nonneg_of_nonneg (norm_nonneg _) p.toReal
have : 0 ≤ ‖f i‖ ^ p.toReal := Real.rpow_nonneg (norm_nonneg _) p.toReal
simp only [abs_of_nonneg, this] at hi
contrapose! hi
exact Real.rpow_le_rpow_of_exponent_ge' (norm_nonneg _) hi.le hq.le hpq'
Expand Down Expand Up @@ -438,8 +438,8 @@ theorem norm_nonneg' (f : lp E p) : 0 ≤ ‖f‖ := by
inhabit α
exact (norm_nonneg (f default)).trans ((lp.isLUB_norm f).1 ⟨default, rfl⟩)
· rw [lp.norm_eq_tsum_rpow hp f]
refine' Real.rpow_nonneg_of_nonneg (tsum_nonneg _) _
exact fun i => Real.rpow_nonneg_of_nonneg (norm_nonneg _) _
refine' Real.rpow_nonneg (tsum_nonneg _) _
exact fun i => Real.rpow_nonneg (norm_nonneg _) _
#align lp.norm_nonneg' lp.norm_nonneg'

@[simp]
Expand Down Expand Up @@ -468,7 +468,7 @@ theorem norm_eq_zero_iff {f : lp E p} : ‖f‖ = 0 ↔ f = 0 := by
· have hf : HasSum (fun i : α => ‖f i‖ ^ p.toReal) 0 := by
have := lp.hasSum_norm hp f
rwa [h, Real.zero_rpow hp.ne'] at this
have : ∀ i, 0 ≤ ‖f i‖ ^ p.toReal := fun i => Real.rpow_nonneg_of_nonneg (norm_nonneg _) _
have : ∀ i, 0 ≤ ‖f i‖ ^ p.toReal := fun i => Real.rpow_nonneg (norm_nonneg _) _
rw [hasSum_zero_iff_of_nonneg this] at hf
ext i
have : f i = 0 ∧ p.toReal ≠ 0 := by
Expand Down Expand Up @@ -560,15 +560,15 @@ theorem norm_apply_le_norm (hp : p ≠ 0) (f : lp E p) (i : α) : ‖f i‖ ≤
· haveI : Nonempty α := ⟨i⟩
exact (isLUB_norm f).1 ⟨i, rfl⟩
have hp'' : 0 < p.toReal := ENNReal.toReal_pos hp hp'
have : ∀ i, 0 ≤ ‖f i‖ ^ p.toReal := fun i => Real.rpow_nonneg_of_nonneg (norm_nonneg _) _
have : ∀ i, 0 ≤ ‖f i‖ ^ p.toReal := fun i => Real.rpow_nonneg (norm_nonneg _) _
rw [← Real.rpow_le_rpow_iff (norm_nonneg _) (norm_nonneg' _) hp'']
convert le_hasSum (hasSum_norm hp'' f) i fun i _ => this i
#align lp.norm_apply_le_norm lp.norm_apply_le_norm

theorem sum_rpow_le_norm_rpow (hp : 0 < p.toReal) (f : lp E p) (s : Finset α) :
∑ i in s, ‖f i‖ ^ p.toReal ≤ ‖f‖ ^ p.toReal := by
rw [lp.norm_rpow_eq_tsum hp f]
have : ∀ i, 0 ≤ ‖f i‖ ^ p.toReal := fun i => Real.rpow_nonneg_of_nonneg (norm_nonneg _) _
have : ∀ i, 0 ≤ ‖f i‖ ^ p.toReal := fun i => Real.rpow_nonneg (norm_nonneg _) _
refine' sum_le_tsum _ (fun i _ => this i) _
exact (lp.memℓp f).summable hp
#align lp.sum_rpow_le_norm_rpow lp.sum_rpow_le_norm_rpow
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean
Expand Up @@ -339,7 +339,7 @@ theorem approx_Gamma_integral_tendsto_Gamma_integral {s : ℂ} (hs : 0 < re s) :
rcases lt_or_le (n : ℝ) x with (hxn | hxn)
· rw [indicator_of_not_mem (not_mem_Ioc_of_gt hxn), norm_zero,
mul_nonneg_iff_right_nonneg_of_pos (exp_pos _)]
exact rpow_nonneg_of_nonneg (le_of_lt hx) _
exact rpow_nonneg (le_of_lt hx) _
· rw [indicator_of_mem (mem_Ioc.mpr ⟨mem_Ioi.mp hx, hxn⟩), norm_mul, Complex.norm_eq_abs,
Complex.abs_of_nonneg
(pow_nonneg (sub_nonneg.mpr <| div_le_one_of_le hxn <| by positivity) _),
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/SpecialFunctions/Gamma/BohrMollerup.lean
Expand Up @@ -122,7 +122,7 @@ theorem Gamma_mul_add_mul_le_rpow_Gamma_mul_rpow_Gamma {s t a b : ℝ} (hs : 0 <
∀ {c x : ℝ} (_ : 0 < c) (u : ℝ) (_ : 0 < x), exp (-x) * x ^ (u - 1) = f c u x ^ (1 / c) := by
intro c x hc u hx
dsimp only
rw [mul_rpow (exp_pos _).le ((rpow_nonneg_of_nonneg hx.le) _), ← exp_mul, ← rpow_mul hx.le]
rw [mul_rpow (exp_pos _).le ((rpow_nonneg hx.le) _), ← exp_mul, ← rpow_mul hx.le]
congr 2 <;> · field_simp [hc.ne']; ring
-- show `f c u` is in `ℒp` for `p = 1/c`:
have f_mem_Lp :
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/SpecialFunctions/Gaussian.lean
Expand Up @@ -628,7 +628,7 @@ theorem isLittleO_exp_neg_mul_sq_cocompact {a : ℂ} (ha : 0 < a.re) (s : ℝ) :
tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact ha (-s))
refine' (eventually_cofinite_ne 0).mp (eventually_of_forall fun x _ => _)
dsimp only
rw [norm_mul, norm_of_nonneg (rpow_nonneg_of_nonneg (abs_nonneg _) _), mul_comm,
rw [norm_mul, norm_of_nonneg (rpow_nonneg (abs_nonneg _) _), mul_comm,
rpow_neg (abs_nonneg x), div_eq_mul_inv, norm_of_nonneg (exp_pos _).le]
#align is_o_exp_neg_mul_sq_cocompact isLittleO_exp_neg_mul_sq_cocompact

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/SpecialFunctions/ImproperIntegrals.lean
Expand Up @@ -70,7 +70,7 @@ theorem integrableOn_Ioi_rpow_of_lt {a : ℝ} (ha : a < -1) {c : ℝ} (hc : 0 <
apply Tendsto.div_const
simpa only [neg_neg] using tendsto_rpow_neg_atTop (by linarith : 0 < -(a + 1))
exact
integrableOn_Ioi_deriv_of_nonneg' hd (fun t ht => rpow_nonneg_of_nonneg (hc.trans ht).le a) ht
integrableOn_Ioi_deriv_of_nonneg' hd (fun t ht => rpow_nonneg (hc.trans ht).le a) ht
#align integrable_on_Ioi_rpow_of_lt integrableOn_Ioi_rpow_of_lt

theorem integrableOn_Ioi_rpow_iff {s t : ℝ} (ht : 0 < t) :
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/SpecialFunctions/Integrals.lean
Expand Up @@ -81,7 +81,7 @@ theorem intervalIntegrable_rpow' {r : ℝ} (h : -1 < r) :
convert (Real.hasDerivAt_rpow_const (p := r + 1) (Or.inl hx.1.ne')).div_const (r + 1) using 1
field_simp [(by linarith : r + 10)]; ring
apply integrableOn_deriv_of_nonneg _ hderiv
· intro x hx; apply rpow_nonneg_of_nonneg hx.1.le
· intro x hx; apply rpow_nonneg hx.1.le
· refine' (continuousOn_id.rpow_const _).div_const _; intro x _; right; linarith
intro c; rcases le_total 0 c with (hc | hc)
· exact this c hc
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/SpecialFunctions/JapaneseBracket.lean
Expand Up @@ -145,7 +145,7 @@ theorem integrable_one_add_norm [MeasureSpace E] [BorelSpace E] [(@volume E _).I
exact ((measurable_norm.const_add _).pow_const _).aestronglyMeasurable
-- Lower Lebesgue integral
have : (∫⁻ a : E, ‖(1 + ‖a‖) ^ (-r)‖₊) = ∫⁻ a : E, ENNReal.ofReal ((1 + ‖a‖) ^ (-r)) :=
lintegral_nnnorm_eq_of_nonneg fun _ => rpow_nonneg_of_nonneg (by positivity) _
lintegral_nnnorm_eq_of_nonneg fun _ => rpow_nonneg (by positivity) _
rw [HasFiniteIntegral, this]
exact finite_integral_one_add_norm hnr
#align integrable_one_add_norm integrable_one_add_norm
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Analysis/SpecialFunctions/Pow/Asymptotics.lean
Expand Up @@ -40,7 +40,7 @@ theorem tendsto_rpow_atTop {y : ℝ} (hy : 0 < y) : Tendsto (fun x : ℝ => x ^
exact
le_of_max_le_left
(by
convert rpow_le_rpow (rpow_nonneg_of_nonneg (le_max_right b 0) (1 / y)) hx (le_of_lt hy)
convert rpow_le_rpow (rpow_nonneg (le_max_right b 0) (1 / y)) hx (le_of_lt hy)
using 1
rw [← rpow_mul (le_max_right b 0), (eq_div_iff (ne_of_gt hy)).mp rfl, Real.rpow_one])
#align tendsto_rpow_at_top tendsto_rpow_atTop
Expand Down Expand Up @@ -148,7 +148,7 @@ theorem tendsto_exp_mul_div_rpow_atTop (s : ℝ) (b : ℝ) (hb : 0 < b) :
Tendsto (fun x : ℝ => exp (b * x) / x ^ s) atTop atTop := by
refine' ((tendsto_rpow_atTop hb).comp (tendsto_exp_div_rpow_atTop (s / b))).congr' _
filter_upwards [eventually_ge_atTop (0 : ℝ)] with x hx₀
simp [Real.div_rpow, (exp_pos x).le, rpow_nonneg_of_nonneg, ← Real.rpow_mul, ← exp_mul,
simp [Real.div_rpow, (exp_pos x).le, rpow_nonneg, ← Real.rpow_mul, ← exp_mul,
mul_comm x, hb.ne', *]
#align tendsto_exp_mul_div_rpow_at_top tendsto_exp_mul_div_rpow_atTop

Expand Down Expand Up @@ -280,7 +280,7 @@ theorem IsBigO.rpow (hr : 0 ≤ r) (hg : 0 ≤ᶠ[l] g) (h : f =O[l] g) :
theorem IsLittleO.rpow (hr : 0 < r) (hg : 0 ≤ᶠ[l] g) (h : f =o[l] g) :
(fun x => f x ^ r) =o[l] fun x => g x ^ r :=
IsLittleO.of_isBigOWith fun c hc =>
((h.forall_isBigOWith (rpow_pos_of_pos hc r⁻¹)).rpow (rpow_nonneg_of_nonneg hc.le _) hr.le
((h.forall_isBigOWith (rpow_pos_of_pos hc r⁻¹)).rpow (rpow_nonneg hc.le _) hr.le
hg).congr_const
(by rw [← rpow_mul hc.le, inv_mul_cancel hr.ne', Real.rpow_one])
#align asymptotics.is_o.rpow Asymptotics.IsLittleO.rpow
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean
Expand Up @@ -429,7 +429,7 @@ theorem continuousAt_rpow {x : ℝ≥0} {y : ℝ} (h : x ≠ 0 ∨ 0 < y) :
(fun p : ℝ≥0 × ℝ => p.1 ^ p.2) =
Real.toNNReal ∘ (fun p : ℝ × ℝ => p.1 ^ p.2) ∘ fun p : ℝ≥0 × ℝ => (p.1.1, p.2) := by
ext p
erw [coe_rpow, Real.coe_toNNReal _ (Real.rpow_nonneg_of_nonneg p.1.2 _)]
erw [coe_rpow, Real.coe_toNNReal _ (Real.rpow_nonneg p.1.2 _)]
rfl
rw [this]
refine' continuous_real_toNNReal.continuousAt.comp (ContinuousAt.comp _ _)
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/SpecialFunctions/Pow/NNReal.lean
Expand Up @@ -30,7 +30,7 @@ namespace NNReal
restriction of the real power function. For `x > 0`, it is equal to `exp (y log x)`. For `x = 0`,
one sets `0 ^ 0 = 1` and `0 ^ y = 0` for `y ≠ 0`. -/
noncomputable def rpow (x : ℝ≥0) (y : ℝ) : ℝ≥0 :=
⟨(x : ℝ) ^ y, Real.rpow_nonneg_of_nonneg x.2 y⟩
⟨(x : ℝ) ^ y, Real.rpow_nonneg x.2 y⟩
#align nnreal.rpow NNReal.rpow

noncomputable instance : Pow ℝ≥0 ℝ :=
Expand Down
22 changes: 15 additions & 7 deletions Mathlib/Analysis/SpecialFunctions/Pow/Real.lean
Expand Up @@ -155,13 +155,13 @@ theorem zero_rpow_nonneg (x : ℝ) : 0 ≤ (0 : ℝ) ^ x := by
by_cases h : x = 0 <;> simp [h, zero_le_one]
#align real.zero_rpow_nonneg Real.zero_rpow_nonneg

theorem rpow_nonneg_of_nonneg {x : ℝ} (hx : 0 ≤ x) (y : ℝ) : 0 ≤ x ^ y := by
theorem rpow_nonneg {x : ℝ} (hx : 0 ≤ x) (y : ℝ) : 0 ≤ x ^ y := by
rw [rpow_def_of_nonneg hx]; split_ifs <;>
simp only [zero_le_one, le_refl, le_of_lt (exp_pos _)]
#align real.rpow_nonneg_of_nonneg Real.rpow_nonneg_of_nonneg
#align real.rpow_nonneg_of_nonneg Real.rpow_nonneg

theorem abs_rpow_of_nonneg {x y : ℝ} (hx_nonneg : 0 ≤ x) : |x ^ y| = |x| ^ y := by
have h_rpow_nonneg : 0 ≤ x ^ y := Real.rpow_nonneg_of_nonneg hx_nonneg _
have h_rpow_nonneg : 0 ≤ x ^ y := Real.rpow_nonneg hx_nonneg _
rw [abs_eq_self.mpr hx_nonneg, abs_eq_self.mpr h_rpow_nonneg]
#align real.abs_rpow_of_nonneg Real.abs_rpow_of_nonneg

Expand Down Expand Up @@ -360,7 +360,7 @@ def evalRpow : Mathlib.Meta.Positivity.PositivityExt where eval {_ _} zα pα e
pure (.positive (q(Real.rpow_pos_of_pos $pa' $b) : Expr))
| .nonnegative pa =>
have pa' : Q(0 ≤ $a) := pa
pure (.nonnegative (q(Real.rpow_nonneg_of_nonneg $pa' $b) : Expr))
pure (.nonnegative (q(Real.rpow_nonneg $pa' $b) : Expr))
| _ => pure .none

end Mathlib.Meta.Positivity
Expand All @@ -375,7 +375,7 @@ namespace Real
variable {x y z : ℝ} {n : ℕ}

theorem rpow_mul {x : ℝ} (hx : 0 ≤ x) (y z : ℝ) : x ^ (y * z) = (x ^ y) ^ z := by
rw [← Complex.ofReal_inj, Complex.ofReal_cpow (rpow_nonneg_of_nonneg hx _),
rw [← Complex.ofReal_inj, Complex.ofReal_cpow (rpow_nonneg hx _),
Complex.ofReal_cpow hx, Complex.ofReal_mul, Complex.cpow_mul, Complex.ofReal_cpow hx] <;>
simp only [(Complex.ofReal_mul _ _).symm, (Complex.ofReal_log hx).symm, Complex.ofReal_im,
neg_lt_zero, pi_pos, le_of_lt pi_pos]
Expand Down Expand Up @@ -820,7 +820,7 @@ section Sqrt

theorem sqrt_eq_rpow (x : ℝ) : sqrt x = x ^ (1 / (2 : ℝ)) := by
obtain h | h := le_or_lt 0 x
· rw [← mul_self_inj_of_nonneg (sqrt_nonneg _) (rpow_nonneg_of_nonneg h _), mul_self_sqrt h, ← sq,
· rw [← mul_self_inj_of_nonneg (sqrt_nonneg _) (rpow_nonneg h _), mul_self_sqrt h, ← sq,
← rpow_nat_cast, ← rpow_mul h]
norm_num
· have : 1 / (2 : ℝ) * π = π / (2 : ℝ) := by ring
Expand All @@ -842,7 +842,7 @@ theorem exists_rat_pow_btwn_rat_aux (hn : n ≠ 0) (x y : ℝ) (h : x < y) (hy :
have hn' : 0 < (n : ℝ) := mod_cast hn.bot_lt
obtain ⟨q, hxq, hqy⟩ :=
exists_rat_btwn (rpow_lt_rpow (le_max_left 0 x) (max_lt hy h) <| inv_pos.mpr hn')
have := rpow_nonneg_of_nonneg (le_max_left 0 x) n⁻¹
have := rpow_nonneg (le_max_left 0 x) n⁻¹
have hq := this.trans_lt hxq
replace hxq := rpow_lt_rpow this hxq hn'
replace hqy := rpow_lt_rpow hq.le hqy hn'
Expand Down Expand Up @@ -957,3 +957,11 @@ section Tactics
-- end NormNum

end Tactics

/-!
### Deprecated lemmas
These lemmas have been deprecated on 2024-01-07.
-/

@[deprecated] alias rpow_nonneg_of_nonneg := rpow_nonneg
2 changes: 1 addition & 1 deletion Mathlib/Analysis/SpecificLimits/FloorPow.lean
Expand Up @@ -272,7 +272,7 @@ theorem sum_div_pow_sq_le_div_sq (N : ℕ) {j : ℝ} (hj : 0 < j) {c : ℝ} (hc
exact inv_lt_one hc
_ ≤ (c⁻¹ ^ 2) ^ (Real.log j / Real.log c - 1) / ((1 : ℝ) - c⁻¹ ^ 2) := by
apply div_le_div _ _ _ le_rfl
· apply Real.rpow_nonneg_of_nonneg (sq_nonneg _)
· apply Real.rpow_nonneg (sq_nonneg _)
· rw [← Real.rpow_nat_cast]
apply Real.rpow_le_rpow_of_exponent_ge A
· exact pow_le_one _ (inv_nonneg.2 (zero_le_one.trans hc.le)) (inv_le_one hc.le)
Expand Down

0 comments on commit 494478b

Please sign in to comment.