File size: 4,600 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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | 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
|