Download data/lean/OAI/Combinatorics/GraphThreshold/LocalFailureNumerics.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.6 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/GraphThreshold/LocalFailureNumerics.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/GraphThreshold/LocalFailureNumerics.lean
-
curl -L -o LocalFailureNumerics.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/GraphThreshold/LocalFailureNumerics.lean
4.6 kB
| import OAI.Combinatorics.GraphThreshold.Basic | |
| import Mathlib.Analysis.Complex.ExponentialBounds | |
| import Mathlib.Data.Nat.Choose.Sum | |
| import Mathlib.Tactic | |
| namespace OAI | |
| noncomputable section | |
| open Finset | |
| namespace LeanBlast.SecondKahnKalai | |
| theorem two_lt_exp_one : (2 : β) < Real.exp 1 := Real.exp_one_gt_two | |
| theorem exp_one_lt_three : Real.exp 1 < (3 : β) := Real.exp_one_lt_three | |
| /-- The strict numerical estimate used to rule out large maximizing | |
| predecessors in the graph hierarchy. -/ | |
| theorem predecessor_power_lt_one {r : β} (hr : 1 β€ r) : | |
| 2 * (17 * Real.exp 1 / 128) ^ r < 1 := by | |
| have hbase0 : 0 β€ 17 * Real.exp 1 / 128 := by positivity | |
| have hbase : 17 * Real.exp 1 / 128 < (1 / 2 : β) := by | |
| nlinarith [exp_one_lt_three] | |
| have hp : (17 * Real.exp 1 / 128) ^ r β€ 17 * Real.exp 1 / 128 := | |
| pow_le_of_le_one hbase0 (by linarith) (by omega) | |
| linarith | |
| theorem exp_neg_fifty_lt_one : Real.exp (-50) < 1 := by | |
| exact Real.exp_lt_one_iff.mpr (by norm_num) | |
| theorem one_add_le_exp_one_of_le_exp_neg_fifty {q : β} | |
| (hq : q β€ Real.exp (-50)) : 1 + q β€ Real.exp 1 := by | |
| linarith [exp_neg_fifty_lt_one, two_lt_exp_one] | |
| theorem one_add_pow_le_exp_nat {q : β} (hq0 : 0 β€ q) | |
| (hq : q β€ Real.exp (-50)) (m : β) : | |
| (1 + q) ^ m β€ Real.exp (m : β) := by | |
| calc | |
| (1 + q) ^ m β€ Real.exp 1 ^ m := | |
| pow_le_pow_leftβ (by positivity) (one_add_le_exp_one_of_le_exp_neg_fifty hq) m | |
| _ = Real.exp (m : β) := by rw [β Real.exp_nat_mul]; simp | |
| theorem two_pow_le_exp_nat (m : β) : (2 : β) ^ m β€ Real.exp (m : β) := by | |
| calc | |
| (2 : β) ^ m β€ Real.exp 1 ^ m := pow_le_pow_leftβ (by norm_num) two_lt_exp_one.le m | |
| _ = Real.exp (m : β) := by rw [β Real.exp_nat_mul]; simp | |
| /-- A term beyond half the capacity has the required exponential decay. -/ | |
| theorem large_intersection_power_le {m r : β} {q : β} | |
| (hq0 : 0 β€ q) (hq : q β€ Real.exp (-50)) (hr : m < 2 * r) : | |
| q ^ r β€ Real.exp (-25 * (m : β)) := by | |
| have hr' : (m : β) < 2 * (r : β) := by exact_mod_cast hr | |
| calc | |
| q ^ r β€ Real.exp (-50) ^ r := pow_le_pow_leftβ hq0 hq r | |
| _ = Real.exp ((r : β) * (-50)) := (Real.exp_nat_mul _ _).symm | |
| _ β€ Real.exp (-25 * (m : β)) := Real.exp_le_exp.mpr (by linarith) | |
| /-- The finite binomial upper tail used by the resampling argument. -/ | |
| def largeIntersectionTail (m : β) (q : β) : β := | |
| β r β range (m + 1), if m < 2 * r then (m.choose r : β) * q ^ r else 0 | |
| theorem largeIntersectionTail_le {m : β} {q : β} | |
| (hq0 : 0 β€ q) (hq : q β€ Real.exp (-50)) : | |
| largeIntersectionTail m q β€ (2 : β) ^ m * Real.exp (-25 * (m : β)) := by | |
| have hsum : (β r β range (m + 1), (m.choose r : β)) = (2 : β) ^ m := by | |
| exact_mod_cast Nat.sum_range_choose m | |
| unfold largeIntersectionTail | |
| calc | |
| (β r β range (m + 1), if m < 2 * r then (m.choose r : β) * q ^ r else 0) β€ | |
| β r β range (m + 1), (m.choose r : β) * Real.exp (-25 * (m : β)) := by | |
| apply sum_le_sum | |
| intro r hr | |
| split_ifs with h | |
| Β· exact mul_le_mul_of_nonneg_left (large_intersection_power_le hq0 hq h) (by positivity) | |
| Β· positivity | |
| _ = (2 : β) ^ m * Real.exp (-25 * (m : β)) := by rw [β sum_mul, hsum] | |
| theorem local_failure_exponential_combine {m : β} (hm : 1 β€ m) : | |
| Real.exp (-10 * (m : β)) + | |
| Real.exp (10 * (m : β)) * (2 : β) ^ m * Real.exp (-25 * (m : β)) β€ | |
| Real.exp (-9 * (m : β)) := by | |
| have hm0 : 0 β€ (m : β) := Nat.cast_nonneg m | |
| have hm1 : 1 β€ (m : β) := by exact_mod_cast hm | |
| have hterm : Real.exp (10 * (m : β)) * (2 : β) ^ m * | |
| Real.exp (-25 * (m : β)) β€ Real.exp (-10 * (m : β)) := by | |
| calc | |
| Real.exp (10 * (m : β)) * (2 : β) ^ m * Real.exp (-25 * (m : β)) β€ | |
| Real.exp (10 * (m : β)) * Real.exp (m : β) * Real.exp (-25 * (m : β)) := by | |
| gcongr | |
| exact two_pow_le_exp_nat m | |
| _ = Real.exp (-14 * (m : β)) := by rw [β Real.exp_add, β Real.exp_add]; congr 1; ring | |
| _ β€ Real.exp (-10 * (m : β)) := Real.exp_le_exp.mpr (by linarith) | |
| have htwo : (2 : β) β€ Real.exp (m : β) := | |
| two_lt_exp_one.le.trans (Real.exp_le_exp.mpr hm1) | |
| calc | |
| Real.exp (-10 * (m : β)) + | |
| Real.exp (10 * (m : β)) * (2 : β) ^ m * Real.exp (-25 * (m : β)) β€ | |
| 2 * Real.exp (-10 * (m : β)) := by linarith | |
| _ β€ Real.exp (m : β) * Real.exp (-10 * (m : β)) := by gcongr | |
| _ = Real.exp (-9 * (m : β)) := by rw [β Real.exp_add]; congr 1; ring | |
| end LeanBlast.SecondKahnKalai | |
| end | |
| end OAI | |