Download data/lean/OAI/Algorithms/SubexponentialSAT/SqrtLog/AsymptoticLayoutCost.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.19 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algorithms/SubexponentialSAT/SqrtLog/AsymptoticLayoutCost.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Algorithms/SubexponentialSAT/SqrtLog/AsymptoticLayoutCost.lean
-
curl -L -o AsymptoticLayoutCost.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algorithms/SubexponentialSAT/SqrtLog/AsymptoticLayoutCost.lean
4.19 kB
| import OAI.Algorithms.SubexponentialSAT.LeanCompat | |
| import OAI.Algorithms.SubexponentialSAT.SqrtLog.AsymptoticLayoutFeasibility | |
| import OAI.Algorithms.SubexponentialSAT.SqrtLog.AsymptoticLayoutLabels | |
| namespace OAI.Algorithms | |
| namespace SubexponentialSAT.SqrtLog.Asymptotic | |
| open Filter | |
| open scoped Topology | |
| theorem eventually_layout_inverse_target : | |
| βαΆ n : β in atTop, (n : β) / layoutR n β€ 128 * Statement.runtimeScale n := by | |
| filter_upwards [eventually_inverse_schedule_target, eventually_le_s 1] with n hn hs | |
| have hs' : (0 : β) < s n := by exact_mod_cast (by omega : 0 < s n) | |
| have hr : (s n : β) β€ layoutR n := by exact_mod_cast le_max_right 2 (s n) | |
| exact (div_le_div_of_nonneg_left (Nat.cast_nonneg n) hs' hr).trans hn | |
| theorem eventually_cutoff_ratio (b : β β β) (q : β) | |
| (hb : βαΆ n : β in atTop, b n β€ L n ^ q) : | |
| βαΆ n : β in atTop, | |
| (layoutCutoff n (b n) : β) / layoutQ n β€ | |
| (128 * (28 * q + 312) : β) * (w n : β) / Real.sqrt (L n : β) := by | |
| filter_upwards [eventually_layoutCutoff_sq_le b q hb, | |
| eventually_layoutQ_comparison, eventually_layoutQ_ge 1] with n hsq hcomp hQ | |
| have hQ' : (0 : β) < layoutQ n := by exact_mod_cast (by omega : 0 < layoutQ n) | |
| have hL : (0 : β) < L n := by exact_mod_cast L_pos n | |
| have hroot0 : 0 < Real.sqrt (L n : β) := Real.sqrt_pos.2 hL | |
| have hroot := Real.sq_sqrt hL.le | |
| have hsq' : (layoutCutoff n (b n) : β) ^ 2 β€ (28 * q + 312 : β) * (L n : β) := by | |
| exact_mod_cast hsq | |
| have hK : (1 : β) β€ (28 * q + 312 : β) := by norm_cast; omega | |
| have hR : (layoutCutoff n (b n) : β) β€ | |
| (28 * q + 312 : β) * Real.sqrt (L n : β) := by | |
| apply (sq_le_sqβ (by positivity) (by positivity)).mp | |
| calc | |
| (layoutCutoff n (b n) : β) ^ 2 β€ (28 * q + 312 : β) * (L n : β) := hsq' | |
| _ β€ ((28 * q + 312 : β) : β) ^ 2 * (L n : β) := | |
| mul_le_mul_of_nonneg_right (by nlinarith) hL.le | |
| _ = ((28 * q + 312 : β) * Real.sqrt (L n : β)) ^ 2 := by rw [mul_pow, hroot] | |
| have hprod := mul_le_mul_of_nonneg_right hR hroot0.le | |
| have hprod' : (layoutCutoff n (b n) : β) * Real.sqrt (L n : β) β€ | |
| (28 * q + 312 : β) * (L n : β) := by | |
| calc | |
| _ β€ (28 * q + 312 : β) * Real.sqrt (L n : β) * Real.sqrt (L n : β) := hprod | |
| _ = _ := by rw [mul_assoc, β pow_two, hroot] | |
| have hcomp' : (L n : β) β€ 128 * (layoutQ n : β) * w n := by exact_mod_cast hcomp.1 | |
| have hm := mul_le_mul_of_nonneg_left hcomp' (show (0 : β) β€ (28 * q + 312 : β) by positivity) | |
| apply (div_le_div_iffβ hQ' hroot0).2 | |
| convert hprod'.trans hm using 1 ; push_cast ; ring | |
| /-- The spectral numerator times the logarithmic support-entropy loss fits | |
| the exact target. Any further fixed coefficient may multiply this bound. -/ | |
| theorem eventually_layout_spectral_cost (b : β β β) (q : β) | |
| (hb : βαΆ n : β in atTop, b n β€ L n ^ q) : | |
| βαΆ n : β in atTop, | |
| (n : β) * ((layoutCutoff n (b n) : β) / layoutQ n) * w n β€ | |
| (8192 * (28 * q + 312) : β) * Statement.runtimeScale n := by | |
| filter_upwards [eventually_cutoff_ratio b q hb] with n hn | |
| have ht := four_le_logSize n | |
| have hW := two_le_logLogSize n | |
| have hroots : Real.sqrt (logSize n) β€ Real.sqrt (L n : β) := | |
| Real.sqrt_le_sqrt (logSize_lt_L n).le | |
| have hrootpos : 0 < Real.sqrt (logSize n) := Real.sqrt_pos.2 (by linarith) | |
| have hw := w_le_twice_logLogSize n | |
| have hmain : (n : β) * ((layoutCutoff n (b n) : β) / layoutQ n) * w n β€ | |
| (512 * (28 * q + 312) : β) * binaryScale n := by | |
| calc | |
| _ β€ (n : β) * (((128 * (28 * q + 312) : β) : β) * w n / | |
| Real.sqrt (L n : β)) * w n := by gcongr | |
| _ β€ (n : β) * (((128 * (28 * q + 312) : β) : β) * (2 * logLogSize n) / | |
| Real.sqrt (logSize n)) * (2 * logLogSize n) := by gcongr | |
| _ = _ := by unfold binaryScale; push_cast; ring | |
| have htarget := binaryScale_le_target n | |
| have hm := mul_le_mul_of_nonneg_left htarget | |
| (show (0 : β) β€ (512 * (28 * q + 312) : β) by positivity) | |
| push_cast at hmain hm β’ | |
| nlinarith | |
| end SubexponentialSAT.SqrtLog.Asymptotic | |
| end OAI.Algorithms | |