Skip to content

Commit

Permalink
feat(Analysis/SpecialFunctions): some lemmas on complex functions of …
Browse files Browse the repository at this point in the history
…natural numbers (#10034)

This is the fourth PR in a sequence that adds auxiliary lemmas from the [EulerProducts](https://github.com/MichaelStollBayreuth/EulerProducts) project to Mathlib.

It adds some lemmas on functions of complex numbers applied to natural numbers:
```lean
lemma Complex.natCast_log {n : ℕ} : Real.log n = log n

lemma Complex.natCast_arg {n : ℕ} : arg n = 0

lemma Complex.natCast_mul_natCast_cpow (m n : ℕ) (s : ℂ) : (m * n : ℂ) ^ s = m ^ s * n ^ s

lemma Complex.natCast_cpow_natCast_mul (n m : ℕ) (z : ℂ) : (n : ℂ) ^ (m * z) = ((n : ℂ) ^ m) ^ z

lemma Complex.norm_log_natCast_le_rpow_div (n : ℕ) {ε : ℝ} (hε : 0 < ε) : ‖log n‖ ≤ n ^ ε / ε
```
(and `ofNat` versions of the first two).
  • Loading branch information
MichaelStollBayreuth committed Feb 1, 2024
1 parent ad46cc4 commit 2ba297e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean
Expand Up @@ -227,6 +227,14 @@ theorem tan_arg (x : ℂ) : Real.tan (arg x) = x.im / x.re := by
theorem arg_ofReal_of_nonneg {x : ℝ} (hx : 0 ≤ x) : arg x = 0 := by simp [arg, hx]
#align complex.arg_of_real_of_nonneg Complex.arg_ofReal_of_nonneg

@[simp, norm_cast]
lemma natCast_arg {n : ℕ} : arg n = 0 :=
ofReal_nat_cast n ▸ arg_ofReal_of_nonneg n.cast_nonneg

@[simp]
lemma ofNat_arg {n : ℕ} [n.AtLeastTwo] : arg (no_index (OfNat.ofNat n)) = 0 :=
natCast_arg

theorem arg_eq_zero_iff {z : ℂ} : arg z = 00 ≤ z.re ∧ z.im = 0 := by
refine' ⟨fun h => _, _⟩
· rw [← abs_mul_cos_add_sin_mul_I z, h]
Expand Down
8 changes: 8 additions & 0 deletions Mathlib/Analysis/SpecialFunctions/Complex/Log.lean
Expand Up @@ -72,6 +72,14 @@ theorem ofReal_log {x : ℝ} (hx : 0 ≤ x) : (x.log : ℂ) = log x :=
(by rw [ofReal_im, log_im, arg_ofReal_of_nonneg hx])
#align complex.of_real_log Complex.ofReal_log

@[simp, norm_cast]
lemma natCast_log {n : ℕ} : Real.log n = log n := ofReal_nat_cast n ▸ ofReal_log n.cast_nonneg

@[simp]
lemma ofNat_log {n : ℕ} [n.AtLeastTwo] :
Real.log (no_index (OfNat.ofNat n)) = log (OfNat.ofNat n) :=
natCast_log

theorem log_ofReal_re (x : ℝ) : (log (x : ℂ)).re = Real.log x := by simp [log_re]
#align complex.log_of_real_re Complex.log_ofReal_re

Expand Down
8 changes: 8 additions & 0 deletions Mathlib/Analysis/SpecialFunctions/Pow/Complex.lean
Expand Up @@ -217,6 +217,14 @@ theorem mul_cpow_ofReal_nonneg {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (r :
add_mul, exp_add, ← cpow_def_of_ne_zero ha'', ← cpow_def_of_ne_zero hb'']
#align complex.mul_cpow_of_real_nonneg Complex.mul_cpow_ofReal_nonneg

lemma natCast_mul_natCast_cpow (m n : ℕ) (s : ℂ) : (m * n : ℂ) ^ s = m ^ s * n ^ s :=
ofReal_nat_cast m ▸ ofReal_nat_cast n ▸ mul_cpow_ofReal_nonneg m.cast_nonneg n.cast_nonneg s

lemma natCast_cpow_natCast_mul (n m : ℕ) (z : ℂ) : (n : ℂ) ^ (m * z) = ((n : ℂ) ^ m) ^ z := by
refine cpow_nat_mul' (x := n) (n := m) ?_ ?_ z
· simp only [natCast_arg, mul_zero, Left.neg_neg_iff, pi_pos]
· simp only [natCast_arg, mul_zero, pi_pos.le]

theorem inv_cpow_eq_ite (x : ℂ) (n : ℂ) :
x⁻¹ ^ n = if x.arg = π then conj (x ^ conj n)⁻¹ else (x ^ n)⁻¹ := by
simp_rw [Complex.cpow_def, log_inv_eq_ite, inv_eq_zero, map_eq_zero, ite_mul, neg_mul,
Expand Down
8 changes: 8 additions & 0 deletions Mathlib/Analysis/SpecialFunctions/Pow/Real.lean
Expand Up @@ -859,6 +859,14 @@ lemma norm_natCast_cpow_le_norm_natCast_cpow_iff {n : ℕ} (hn : 1 < n) {w z :
‖(n : ℂ) ^ w‖ ≤ ‖(n : ℂ) ^ z‖ ↔ w.re ≤ z.re := by
simp_rw [norm_natCast_cpow_of_pos (Nat.zero_lt_of_lt hn),
Real.rpow_le_rpow_left_iff (Nat.one_lt_cast.mpr hn)]

lemma norm_log_natCast_le_rpow_div (n : ℕ) {ε : ℝ} (hε : 0 < ε) : ‖log n‖ ≤ n ^ ε / ε := by
rcases n.eq_zero_or_pos with rfl | h
· rw [Nat.cast_zero, Nat.cast_zero, log_zero, norm_zero, Real.zero_rpow hε.ne', zero_div]
rw [norm_eq_abs, ← natCast_log, abs_ofReal,
_root_.abs_of_nonneg <| Real.log_nonneg <| by exact_mod_cast Nat.one_le_of_lt h.lt]
exact Real.log_natCast_le_rpow_div n hε

end Complex

/-!
Expand Down

0 comments on commit 2ba297e

Please sign in to comment.