File size: 4,179 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 | import OAI.Probability.SATComputability.PoissonBlockBound
import OAI.Probability.SATComputability.CandidateSurvival
namespace OAI
namespace FixedClauseThreshold.Computability
open DilutedSpinGlass MeasureTheory ProbabilityTheory
open scoped BigOperators NNReal Classical
noncomputable def dyadicLevel (j : β) : β := ((2 : β)^j)β»ΒΉ
def dyadicTruncation (j : β) : β := j+122
def dyadicMultiplicity (j : β) : β := 2*(j+122)*2^((j+1)/2)
def dyadicBlock (j : β) : β := 32*dyadicTruncation j*dyadicMultiplicity j
theorem dyadicLevel_pos (j : β) : 0 < dyadicLevel j := by
unfold dyadicLevel
positivity
theorem dyadicLevel_le_one (j : β) : dyadicLevel j β€ 1 := by
unfold dyadicLevel
exact inv_le_one_of_one_leβ (one_le_powβ (by norm_num))
theorem dyadic_truncation_error (j : β) :
Real.exp 60 / (2 : β)^(dyadicTruncation j) β€ dyadicLevel j/4 := by
have he : Real.exp 60 β€ (2 : β)^120 := by
calc
_ = (Real.exp 1)^60 := by rw [β Real.exp_nat_mul]; norm_num
_ β€ (4 : β)^60 := pow_le_pow_leftβ (Real.exp_pos 1).le
(Real.exp_one_lt_three.le.trans (by norm_num : (3 : β) β€ 4)) 60
_ = _ := by norm_num
have hden : (2 : β)^(dyadicTruncation j) = (2 : β)^j * (2 : β)^122 := by
rw [dyadicTruncation, pow_add]
rw [dyadicLevel, hden]
apply (div_le_iffβ (by positivity)).mpr
field_simp
nlinarith
theorem dyadic_multiplicity_pos (j : β) : 0 < dyadicMultiplicity j := by
unfold dyadicMultiplicity
positivity
theorem dyadic_replacement_error (j : β) :
(dyadicTruncation j : β) / (dyadicMultiplicity j : β)^2 β€ dyadicLevel j/4 := by
have hp : j β€ (j+1)/2*2 := by omega
have hpow : (2 : β)^j β€ ((2 : β)^((j+1)/2))^2 := by
rw [β pow_mul]
exact pow_le_pow_rightβ (by norm_num) hp
have hL : (1 : β) β€ j+122 := by exact_mod_cast (show 1 β€ j+122 by omega)
have hmul : (4 : β)*((j:β)+122)*(2:β)^j β€
(2*((j:β)+122)*(2:β)^((j+1)/2))^2 := by
have hprod := mul_le_mul_of_nonneg_left hpow
(show (0 : β) β€ 4*((j:β)+122) by positivity)
have hrest := mul_nonneg
(show (0 : β) β€ (j:β)+122-1 by linarith)
(show (0 : β) β€ 4*((j:β)+122)*((2:β)^((j+1)/2))^2 by positivity)
nlinarith
unfold dyadicTruncation dyadicMultiplicity dyadicLevel
push_cast
apply (div_le_iffβ (by positivity)).mpr
rw [show (2^j : β)β»ΒΉ / 4 * (2*((j:β)+122)*2^((j+1)/2))^2 =
(2*((j:β)+122)*2^((j+1)/2))^2 / (4*2^j) by field_simp]
apply (le_div_iffβ (by positivity)).mpr
nlinarith
theorem dyadic_block_kills {n : β} [NeZero n]
(U : Finset (DeletionCandidate n)) (j : β) (rate : ββ₯0)
(hrate : (1 : β)/8 β€ rate)
(hq : dyadicLevel j β€ poissonKillProbability U 2 60) :
dyadicLevel j/4 β€ poissonKillProbability U 3 (rate*dyadicBlock j) := by
apply poisson_two_to_three_block U (dyadic_multiplicity_pos j)
(show 0 < dyadicTruncation j by unfold dyadicTruncation; omega) hq
(dyadic_truncation_error j) (dyadic_replacement_error j)
simp only [dyadicBlock, NNReal.coe_mul, NNReal.coe_natCast, Nat.cast_mul,
Nat.cast_ofNat, NNReal.coe_ofNat]
have h := mul_le_mul_of_nonneg_right hrate
(show (0 : β) β€ 32*(dyadicTruncation j : β)*dyadicMultiplicity j by positivity)
nlinarith
def dyadicBin {n : β} [NeZero n] (j : β) (U : Finset (DeletionCandidate n)) : Prop :=
U.Nonempty β§ dyadicLevel j β€ poissonKillProbability U 2 60 β§
poissonKillProbability U 2 60 β€ 2*dyadicLevel j
theorem dyadic_bin_occupation {n : β} [NeZero n]
(rate : ββ₯0) (hrate : (1 : β)/8 β€ rate) (j M : β)
(U : Finset (DeletionCandidate n)) :
(β t β Finset.range M, (candidateBlock (rate*t) 3 U).expect
(fun V => if dyadicBin j V then 1 else 0)) β€
4*(dyadicBlock j : β)/dyadicLevel j := by
classical
have h := candidateBlock_occupation rate 3 (dyadicBlock j) M (dyadicBin j)
(show 0 < dyadicLevel j/4 by positivity [dyadicLevel_pos j])
(fun V hV => β¨hV.1, dyadic_block_kills V j rate hrate hV.2.1β©) U
convert h using 1
ring
end FixedClauseThreshold.Computability
end OAI
|