Download data/lean/OAI/Computability/DepthThree/FinalParameterBounds.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.2 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DepthThree/FinalParameterBounds.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/DepthThree/FinalParameterBounds.lean
-
curl -L -o FinalParameterBounds.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DepthThree/FinalParameterBounds.lean
6.2 kB
| import OAI.Computability.DepthThree.AsymptoticBounds | |
| import OAI.Computability.DepthThree.ReversePathRecurrence | |
| import Mathlib.Algebra.Order.Floor.Semiring | |
| import Mathlib.Data.Nat.Choose.Bounds | |
| import Mathlib.Algebra.Order.Archimedean.Real.Basic | |
| import Mathlib.Tactic.FieldSimp | |
| import Lean.Elab.Tactic.Omega | |
| namespace OAI | |
| noncomputable section | |
| open scoped BigOperators | |
| namespace DepthThreeLowerBound | |
| def liveProbability (B : β) (d : β) : β := B / Real.sqrt (d : β) | |
| def degreeCutoff (s : β) (d : β) : β := | |
| Nat.ceil (3 * (s + 1) * Real.sqrt (d : β)) | |
| def factorialBase (B s : β) : β := 4 * B * (3 * (s + 1) + 1) | |
| theorem liveProbability_pos (B : β) (hB : 0 < B) (d : β) (hd : 0 < d) : | |
| 0 < liveProbability B d := | |
| div_pos hB (Real.sqrt_pos.mpr (Nat.cast_pos.mpr hd)) | |
| theorem liveProbability_mul_dimension (B : β) (d : β) (hd : 0 < d) : | |
| liveProbability B d * (d : β) = B * Real.sqrt (d : β) := by | |
| have hroot : Real.sqrt (d : β) β 0 := | |
| (Real.sqrt_pos.mpr (Nat.cast_pos.mpr hd)).ne' | |
| unfold liveProbability | |
| calc | |
| B / Real.sqrt (d : β) * (d : β) = | |
| B / Real.sqrt (d : β) * (Real.sqrt (d : β) * Real.sqrt (d : β)) := by | |
| rw [Real.mul_self_sqrt (Nat.cast_nonneg d)] | |
| _ = B * Real.sqrt (d : β) := by | |
| rw [β mul_assoc, div_mul_cancelβ _ hroot] | |
| theorem degreeCutoff_lower (s : β) (d : β) : | |
| 3 * (s + 1) * Real.sqrt (d : β) β€ (degreeCutoff s d : β) := | |
| Nat.le_ceil _ | |
| theorem degreeCutoff_upper (s : β) (hs : 0 β€ s) (d : β) (hd : 1 β€ d) : | |
| (degreeCutoff s d : β) β€ (3 * (s + 1) + 1) * Real.sqrt (d : β) := by | |
| have hroot : (1 : β) β€ Real.sqrt (d : β) := | |
| Real.one_le_sqrt.mpr (by exact_mod_cast hd) | |
| have hnonneg : 0 β€ 3 * (s + 1) * Real.sqrt (d : β) := | |
| mul_nonneg (by linarith) (Real.sqrt_nonneg _) | |
| have hceil := Nat.ceil_lt_add_one hnonneg | |
| change (degreeCutoff s d : β) < 3 * (s + 1) * Real.sqrt (d : β) + 1 at hceil | |
| nlinarith | |
| theorem exists_liveProbability_threshold (B : β) (hB : 0 < B) : | |
| β D : β, 1 β€ D β§ β d : β, D β€ d β | |
| 0 < liveProbability B d β§ liveProbability B d β€ 1 / 2 := by | |
| obtain β¨D, hDβ© := exists_nat_ge (max (1 : β) ((2 * B) ^ 2)) | |
| have hDone : 1 β€ D := by | |
| exact_mod_cast (le_max_left (1 : β) ((2 * B) ^ 2)).trans hD | |
| refine β¨D, hDone, ?_β© | |
| intro d hd | |
| have hdone : 1 β€ d := hDone.trans hd | |
| have hrootpos : 0 < Real.sqrt (d : β) := | |
| Real.sqrt_pos.mpr (Nat.cast_pos.mpr (by omega : 0 < d)) | |
| have hsq : (2 * B) ^ 2 β€ (d : β) := | |
| ((le_max_right (1 : β) ((2 * B) ^ 2)).trans hD).trans (Nat.cast_le.mpr hd) | |
| have hroot : 2 * B β€ Real.sqrt (d : β) := Real.le_sqrt_of_sq_le hsq | |
| refine β¨liveProbability_pos B hB d (by omega), ?_β© | |
| change B / Real.sqrt (d : β) β€ 1 / 2 | |
| apply (div_le_iffβ hrootpos).mpr | |
| linarith | |
| theorem scaled_cutoff_le_factorialBase (B s : β) (hB : 0 β€ B) (hs : 0 β€ s) | |
| (d : β) (hd : 1 β€ d) (hp : liveProbability B d β€ 1 / 2) : | |
| (2 * liveProbability B d / (1 - liveProbability B d)) * | |
| (degreeCutoff s d : β) β€ factorialBase B s := by | |
| have hrootpos : 0 < Real.sqrt (d : β) := | |
| Real.sqrt_pos.mpr (Nat.cast_pos.mpr (by omega : 0 < d)) | |
| have hp0 : 0 β€ liveProbability B d := div_nonneg hB (Real.sqrt_nonneg _) | |
| have hΞ± : 2 * liveProbability B d / (1 - liveProbability B d) β€ | |
| 4 * liveProbability B d := by | |
| calc | |
| 2 * liveProbability B d / (1 - liveProbability B d) β€ | |
| 2 * liveProbability B d / (1 / 2) := | |
| div_le_div_of_nonneg_left (by linarith) (by norm_num) (by linarith) | |
| _ = 4 * liveProbability B d := by ring | |
| calc | |
| (2 * liveProbability B d / (1 - liveProbability B d)) * | |
| (degreeCutoff s d : β) β€ | |
| (4 * liveProbability B d) * (degreeCutoff s d : β) := | |
| mul_le_mul_of_nonneg_right hΞ± (Nat.cast_nonneg _) | |
| _ β€ (4 * liveProbability B d) * | |
| ((3 * (s + 1) + 1) * Real.sqrt (d : β)) := | |
| mul_le_mul_of_nonneg_left (degreeCutoff_upper s hs d hd) (by linarith) | |
| _ = factorialBase B s := by | |
| unfold liveProbability factorialBase | |
| field_simp [hrootpos.ne'] | |
| theorem reverseTheta_le_factorial_tail (Ξ± Q : β) (hΞ± : 0 β€ Ξ±) (b k : β) | |
| (hΞ±k : Ξ± * (k : β) β€ Q) : | |
| reverseTheta Ξ± b k β€ | |
| β β β Finset.Ico (b + 1) (k + 1), Q ^ β / (β.factorial : β) := by | |
| have hset : (Finset.range (k + 1)).filter (fun β => b < β) = | |
| Finset.Ico (b + 1) (k + 1) := by | |
| ext β | |
| simp only [Finset.mem_filter, Finset.mem_range, Finset.mem_Ico] | |
| omega | |
| unfold reverseTheta | |
| rw [β Finset.sum_filter, hset] | |
| apply Finset.sum_le_sum | |
| intro β hβ | |
| calc | |
| (k.choose β : β) * Ξ± ^ β β€ | |
| ((k : β) ^ β / (β.factorial : β)) * Ξ± ^ β := | |
| mul_le_mul_of_nonneg_right (Nat.choose_le_pow_div β k) (pow_nonneg hΞ± _) | |
| _ = (Ξ± * (k : β)) ^ β / (β.factorial : β) := by | |
| rw [mul_pow] | |
| ring | |
| _ β€ Q ^ β / (β.factorial : β) := | |
| div_le_div_of_nonneg_right | |
| (pow_le_pow_leftβ (mul_nonneg hΞ± (Nat.cast_nonneg k)) hΞ±k β) | |
| (Nat.cast_nonneg _) | |
| theorem exists_final_parameter_width (B s : β) (hB : 0 < B) (hs : 0 β€ s) : | |
| β b : β, 1 β€ b β§ β D : β, 1 β€ D β§ β d : β, D β€ d β | |
| 0 < liveProbability B d β§ liveProbability B d β€ 1 / 2 β§ | |
| reverseTheta (2 * liveProbability B d / (1 - liveProbability B d)) | |
| b (degreeCutoff s d) β€ 1 / 2 := by | |
| have hQ : 0 β€ factorialBase B s := | |
| mul_nonneg (mul_nonneg (by norm_num) hB.le) (by linarith) | |
| obtain β¨b, hb, htailβ© := exists_factorial_tail_width (factorialBase B s) hQ | |
| obtain β¨D, hD, hprobβ© := exists_liveProbability_threshold B hB | |
| refine β¨b, hb, D, hD, ?_β© | |
| intro d hd | |
| obtain β¨hp0, hphalfβ© := hprob d hd | |
| refine β¨hp0, hphalf, ?_β© | |
| have hΞ± : 0 β€ 2 * liveProbability B d / (1 - liveProbability B d) := | |
| div_nonneg (by linarith) (by linarith) | |
| exact (reverseTheta_le_factorial_tail _ _ hΞ± b (degreeCutoff s d) | |
| (scaled_cutoff_le_factorialBase B s hB.le hs d (hD.trans hd) hphalf)).trans | |
| (htail (degreeCutoff s d)) | |
| end DepthThreeLowerBound | |
| end | |
| end OAI | |