File size: 3,581 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | import Mathlib.Analysis.SpecificLimits.Normed
namespace OAI
/-! Polynomial tensor restrictions and exact coefficient extraction. -/
noncomputable section
open Filter
open scoped Topology
namespace MatrixMultiplication.Foundation
theorem tendsto_affine_mul_geometric_zero (D C : β) {q : β}
(hq : 0 β€ q) (hq_one : q < 1) :
Tendsto (fun n : β => (D * (n : β) + C) * q ^ n) atTop (π 0) := by
have hlinear := (tendsto_self_mul_const_pow_of_lt_one hq hq_one).const_mul D
have hconstant := (tendsto_pow_atTop_nhds_zero_of_lt_one hq hq_one).const_mul C
simpa only [mul_zero, add_zero, add_mul, mul_assoc] using hlinear.add hconstant
theorem eventually_affine_mul_pow_le_pow (D C : β) {r s : β}
(hr : 0 β€ r) (hrs : r < s) :
βαΆ n : β in atTop, (D * (n : β) + C) * r ^ n β€ s ^ n := by
have hs : 0 < s := hr.trans_lt hrs
have hratio : 0 β€ r / s := div_nonneg hr hs.le
have hratio_one : r / s < 1 := (div_lt_one hs).2 hrs
have hsmall :=
(tendsto_affine_mul_geometric_zero D C hratio hratio_one).eventually_lt_const
(show (0 : β) < 1 from zero_lt_one)
filter_upwards [hsmall] with n hn
rw [div_pow, β mul_div_assoc] at hn
exact ((div_lt_iffβ (pow_pos hs n)).1 hn).le.trans_eq (one_mul _)
theorem eventually_affine_mul_pow_le_add_pow (D C : β) {r Ξ΅ : β}
(hr : 0 β€ r) (hΞ΅ : 0 < Ξ΅) :
βαΆ n : β in atTop, (D * (n : β) + C) * r ^ n β€ (r + Ξ΅) ^ n :=
eventually_affine_mul_pow_le_pow D C hr (lt_add_of_pos_right r hΞ΅)
theorem power_le_of_eventually_pow_le_affine_mul_pow {a r D C : β}
(hr : 0 β€ r)
(h : βαΆ n : β in atTop, a ^ n β€ (D * (n : β) + C) * r ^ n) :
a β€ r := by
by_contra hnot
have hra : r < a := lt_of_not_ge hnot
have ha : 0 < a := hr.trans_lt hra
have hratio : 0 β€ r / a := div_nonneg hr ha.le
have hratio_one : r / a < 1 := (div_lt_one ha).2 hra
have hsmall :=
(tendsto_affine_mul_geometric_zero D C hratio hratio_one).eventually_lt_const
(show (0 : β) < 1 from zero_lt_one)
rcases (h.and hsmall).exists with β¨n, hbound, hltβ©
have hge : (1 : β) β€ (D * (n : β) + C) * (r / a) ^ n := by
rw [div_pow, β mul_div_assoc]
exact (le_div_iffβ (pow_pos ha n)).2 (by simpa only [one_mul] using hbound)
exact (not_lt_of_ge hge) hlt
theorem power_le_of_forall_pow_le_affine_mul_pow {a r D C : β}
(hr : 0 β€ r)
(h : β n : β, 0 < n β a ^ n β€ (D * (n : β) + C) * r ^ n) :
a β€ r := by
apply power_le_of_eventually_pow_le_affine_mul_pow hr
exact eventually_atTop.2 β¨1, fun n hn => h n (Nat.zero_lt_one.trans_le hn)β©
theorem power_le_of_forall_pow_le_mul_pow {a r C : β}
(hr : 0 β€ r) (h : β n : β, 0 < n β a ^ n β€ C * r ^ n) :
a β€ r := by
apply power_le_of_forall_pow_le_affine_mul_pow (D := 0) (C := C) hr
simpa only [zero_mul, zero_add] using h
theorem power_le_of_forall_pow_le_linear_mul_pow (D : β) {a r : β}
(hr : 0 β€ r)
(h : β n : β, 0 < n β a ^ n β€ ((D * n + 1 : β) : β) * r ^ n) :
a β€ r := by
apply power_le_of_forall_pow_le_affine_mul_pow (D := (D : β)) (C := 1) hr
simpa only [Nat.cast_add, Nat.cast_mul, Nat.cast_one] using h
theorem eventually_linear_mul_pow_le_add_pow (D : β) {r Ξ΅ : β}
(hr : 0 β€ r) (hΞ΅ : 0 < Ξ΅) :
βαΆ n : β in atTop, ((D * n + 1 : β) : β) * r ^ n β€ (r + Ξ΅) ^ n := by
simpa only [Nat.cast_add, Nat.cast_mul, Nat.cast_one] using
eventually_affine_mul_pow_le_add_pow (D : β) 1 hr hΞ΅
end MatrixMultiplication.Foundation
end
end OAI
|