Skip to content

Commit

Permalink
feat(Analysis/SpecialFunctions/Pow/Real): add some lemmas (#20608)
Browse files Browse the repository at this point in the history
This adds a few lemmas on powers with real exponents:
* injectivity as a function of the exponent (when the base is positive and ≠ 1)
* `(x ^ y) ^ n = (x ^ n) ^ y` when `y` is real and `n` is a natural number or an integer
  • Loading branch information
MichaelStollBayreuth committed Jan 10, 2025
1 parent 804cb79 commit b1178f1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Mathlib/Analysis/SpecialFunctions/Pow/Real.lean
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,12 @@ theorem rpow_mul {x : ℝ} (hx : 0 ≤ x) (y z : ℝ) : x ^ (y * z) = (x ^ y) ^
simp only [(Complex.ofReal_mul _ _).symm, (Complex.ofReal_log hx).symm, Complex.ofReal_im,
neg_lt_zero, pi_pos, le_of_lt pi_pos]

lemma rpow_pow_comm {x : ℝ} (hx : 0 ≤ x) (y : ℝ) (n : ℕ) : (x ^ y) ^ n = (x ^ n) ^ y := by
simp_rw [← rpow_natCast, ← rpow_mul hx, mul_comm y]

lemma rpow_zpow_comm {x : ℝ} (hx : 0 ≤ x) (y : ℝ) (n : ℤ) : (x ^ y) ^ n = (x ^ n) ^ y := by
simp_rw [← rpow_intCast, ← rpow_mul hx, mul_comm y]

lemma rpow_add_intCast {x : ℝ} (hx : x ≠ 0) (y : ℝ) (n : ℤ) : x ^ (y + n) = x ^ y * x ^ n := by
rw [rpow_def, rpow_def, Complex.ofReal_add,
Complex.cpow_add _ _ (Complex.ofReal_ne_zero.mpr hx), Complex.ofReal_intCast,
Expand Down Expand Up @@ -896,6 +902,12 @@ lemma antitone_rpow_of_base_le_one {b : ℝ} (hb₀ : 0 < b) (hb₁ : b ≤ 1) :
case inl => exact (strictAnti_rpow_of_base_lt_one hb₀ hb₁).antitone
case inr => intro _ _ _; simp

lemma rpow_right_inj (hx₀ : 0 < x) (hx₁ : x ≠ 1) : x ^ y = x ^ z ↔ y = z := by
refine ⟨fun H ↦ ?_, fun H ↦ by rw [H]⟩
rcases hx₁.lt_or_lt with h | h
· exact (strictAnti_rpow_of_base_lt_one hx₀ h).injective H
· exact (strictMono_rpow_of_base_gt_one h).injective H

/-- Guessing rule for the `bound` tactic: when trying to prove `x ^ y ≤ x ^ z`, we can either assume
`1 ≤ x` or `0 < x ≤ 1`. -/
@[bound] lemma rpow_le_rpow_of_exponent_le_or_ge {x y z : ℝ}
Expand Down

0 comments on commit b1178f1

Please sign in to comment.