Download data/lean/OAI/LinearAlgebra/MatrixMultiplication/Rectangular/RateLimit.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.99 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Rectangular/RateLimit.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Rectangular/RateLimit.lean
-
curl -L -o RateLimit.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Rectangular/RateLimit.lean
3.99 kB
| import OAI.LinearAlgebra.MatrixMultiplication.Entropy.ConditionalLabels | |
| namespace OAI | |
| /-! Rectangular matrix multiplication algorithms and their asymptotic exponents. -/ | |
| noncomputable section | |
| namespace MatrixMultiplication.RectangularRateLimit | |
| open Filter | |
| open scoped Topology | |
| theorem eventually_two_le_of_positive_log_rate | |
| {a : β β β} {scale : β β β} {A : β} | |
| (scale_positive : βαΆ n in atTop, 0 < scale n) | |
| (rate : Tendsto (fun n => Real.log (a n : β) / scale n) atTop (π A)) | |
| (positive : 0 < A) : βαΆ n in atTop, 2 β€ a n := by | |
| filter_upwards [rate.eventually_const_lt positive, scale_positive] with n hn hs | |
| have hlog : 0 < Real.log (a n : β) := (div_pos_iff_of_pos_right hs).mp hn | |
| have ha : (1 : β) < a n := (Real.log_pos_iff (Nat.cast_nonneg _)).mp hlog | |
| have : 1 < a n := by exact_mod_cast ha | |
| omega | |
| theorem eventually_aspect_of_rate_gap | |
| {a b : β β β} {scale : β β β} {A B k : β} | |
| (a_positive : β n, 0 < a n) (b_positive : β n, 0 < b n) | |
| (scale_positive : βαΆ n in atTop, 0 < scale n) | |
| (a_rate : Tendsto (fun n => Real.log (a n : β) / scale n) atTop (π A)) | |
| (b_rate : Tendsto (fun n => Real.log (b n : β) / scale n) atTop (π B)) | |
| (gap : k * A < B) : βαΆ n in atTop, (a n : β) ^ k β€ (b n : β) := by | |
| filter_upwards [(a_rate.const_mul k).eventually_lt b_rate gap, scale_positive] | |
| with n hn hs | |
| have hlog : k * Real.log (a n : β) < Real.log (b n : β) := by | |
| apply (div_lt_div_iff_of_pos_right hs).mp | |
| simpa only [mul_div_assoc] using hn | |
| have ha : (0 : β) < a n := Nat.cast_pos.mpr (a_positive n) | |
| have hb : (0 : β) < b n := Nat.cast_pos.mpr (b_positive n) | |
| apply le_of_lt | |
| apply (Real.log_lt_log_iff (Real.rpow_pos_of_pos ha k) hb).mp | |
| simpa only [Real.log_rpow ha] using hlog | |
| theorem rate_inequality_of_log_bounds | |
| {a multiplicity rank : β β β} {scale : β β β} {A M R exponent : β} | |
| (scale_positive : βαΆ n in atTop, 0 < scale n) | |
| (a_rate : Tendsto (fun n => Real.log (a n : β) / scale n) atTop (π A)) | |
| (multiplicity_rate : Tendsto | |
| (fun n => Real.log (multiplicity n : β) / scale n) atTop (π M)) | |
| (rank_rate : Tendsto (fun n => Real.log (rank n : β) / scale n) atTop (π R)) | |
| (finite_bound : βαΆ n in atTop, | |
| exponent * Real.log (a n : β) β€ | |
| Real.log (rank n : β) - Real.log (multiplicity n : β)) : | |
| exponent * A β€ R - M := by | |
| apply le_of_tendsto_of_tendsto (a_rate.const_mul exponent) | |
| (rank_rate.sub multiplicity_rate) | |
| filter_upwards [finite_bound, scale_positive] with n hn hs | |
| have h := div_le_div_of_nonneg_right hn hs.le | |
| simpa only [mul_div_assoc, sub_div] using h | |
| theorem exponent_le_of_finite_asi | |
| {a b multiplicity rank : β β β} {scale : β β β} | |
| {A B M R k exponent : β} | |
| (a_positive : β n, 0 < a n) (b_positive : β n, 0 < b n) | |
| (scale_positive : βαΆ n in atTop, 0 < scale n) | |
| (a_rate : Tendsto (fun n => Real.log (a n : β) / scale n) atTop (π A)) | |
| (b_rate : Tendsto (fun n => Real.log (b n : β) / scale n) atTop (π B)) | |
| (multiplicity_rate : Tendsto | |
| (fun n => Real.log (multiplicity n : β) / scale n) atTop (π M)) | |
| (rank_rate : Tendsto (fun n => Real.log (rank n : β) / scale n) atTop (π R)) | |
| (positive : 0 < A) (gap : k * A < B) | |
| (finite_asi : β n, 2 β€ a n β (a n : β) ^ k β€ (b n : β) β | |
| exponent * Real.log (a n : β) β€ | |
| Real.log (rank n : β) - Real.log (multiplicity n : β)) : | |
| exponent β€ (R - M) / A := by | |
| apply (le_div_iffβ positive).mpr | |
| apply rate_inequality_of_log_bounds scale_positive a_rate multiplicity_rate rank_rate | |
| filter_upwards [eventually_two_le_of_positive_log_rate scale_positive a_rate positive, | |
| eventually_aspect_of_rate_gap a_positive b_positive scale_positive a_rate b_rate gap] | |
| with n ha hab | |
| exact finite_asi n ha hab | |
| end MatrixMultiplication.RectangularRateLimit | |
| end | |
| end OAI | |