File size: 1,988 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 | import Mathlib.Analysis.SpecialFunctions.Exp
import Mathlib.Tactic
namespace OAI
/-!
# The fixed repetition schedule
The numerical amplification estimate from the final section of
*A Low-Space Algorithm for Worst-Case Subset Sum*. The per-round failure bound
must be proved for the actual trials before this estimate applies.
-/
namespace LowSpaceSubsetSum
/-- The failure estimate for `u^120` fresh rounds with success at least `u^-110`.
The bound applies to any nonnegative per-round failure probability `q` below
the stated threshold. -/
theorem amplification_bound {u : β} (hu : 2 β€ u) {q : β}
(hq0 : 0 β€ q) (hq : q β€ 1 - 1 / (u : β) ^ 110) :
q ^ (u ^ 120) < (1 / 3 : β) := by
have hu0 : (0 : β) < u := by exact_mod_cast (by omega : 0 < u)
have hu1 : (1 : β) < u := by exact_mod_cast hu
have hp : (u : β) ^ 120 = (u : β) ^ 110 * (u : β) ^ 10 := by
rw [β pow_add]
have hratio : (u : β) ^ 10 / (u ^ 120 : β) = 1 / (u : β) ^ 110 := by
rw [Nat.cast_pow, hp]
field_simp
have ht : (u : β) ^ 10 β€ (u ^ 120 : β) := by
rw [Nat.cast_pow, hp]
have hlarge : (1 : β) β€ (u : β) ^ 110 := one_le_powβ hu1.le
nlinarith [pow_pos hu0 10]
have hexp := Real.one_sub_div_pow_le_exp_neg (n := u ^ 120) ht
rw [hratio] at hexp
have hqpow := pow_le_pow_leftβ hq0 hq (u ^ 120)
have ht2 : (2 : β) β€ (u : β) ^ 10 := by
have hule : (u : β) β€ (u : β) ^ 10 := le_self_powβ (by linarith) (by decide)
have hu2 : (2 : β) β€ u := by exact_mod_cast hu
exact hu2.trans hule
have hstrict : 3 < Real.exp ((u : β) ^ 10) := by
have h := Real.add_one_lt_exp (by positivity : (u : β) ^ 10 β 0)
linarith
have hsmall : Real.exp (-((u : β) ^ 10)) < (1 / 3 : β) := by
rw [Real.exp_neg]
apply (inv_lt_commβ (Real.exp_pos _) (by norm_num : (0 : β) < 1 / 3)).mpr
norm_num
exact hstrict
exact (hqpow.trans hexp).trans_lt hsmall
end LowSpaceSubsetSum
end OAI
|