math / data /lean /OAI /Computability /DepthThree /CircuitQuantitative.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
2.56 kB
import OAI.Computability.DepthThree.CircuitLowerBound
import OAI.Computability.DepthThree.CircuitDensity
import OAI.Computability.DepthThree.AsymptoticBounds
import Mathlib.Tactic.Convert
namespace OAI
namespace DepthThreeLowerBound
theorem circuit_lower_bound_of_small_cnf_correlations
(d k : β„•) (s : ℝ) (hs : 0 ≀ s) (hd : 4 ≀ d)
(hk : 3 * (s + 1) * Real.sqrt (d : ℝ) ≀ (k : ℝ))
(f : Cube (Fin d) β†’ Bool)
(hcorr : βˆ€ H : CNF (Fin d), H.WidthAtMost k β†’
|finiteAvg (fun x : Cube (Fin d) => sign (f x) * indicator (H.eval x))| ≀
6 * (2 : ℝ) ^ (-(64 * (s + 1) * Real.sqrt (d : ℝ)) / 16))
(C : Circuit3 (Fin d)) (hC : C.Computes f) :
(2 : ℝ) ^ (s * Real.sqrt (d : ℝ)) < (C.gateCount : ℝ) := by
by_contra h
have hsize : (C.gateCount : ℝ) ≀ (2 : ℝ) ^ (s * Real.sqrt (d : ℝ)) :=
le_of_not_gt h
let Ξ΅ : ℝ := 6 * (2 : ℝ) ^ (-(64 * (s + 1) * Real.sqrt (d : ℝ)) / 16)
have hΞ΅ : 0 ≀ Ξ΅ := mul_nonneg (by norm_num) (Real.rpow_nonneg (by norm_num) _)
have hdReal : (4 : ℝ) ≀ (d : ℝ) := by exact_mod_cast hd
have hexponent : -(64 * (s + 1) * Real.sqrt (d : ℝ)) / 16 =
-(4 * (s + 1) * Real.sqrt (d : ℝ)) := by ring
have hsmall : Ξ΅ ≀ 3 / 8 := by
dsimp only [Ξ΅]
rw [hexponent]
exact correlation_error_le s (d : ℝ) hs (by linarith)
have hlower : (1 - Ξ΅) / 2 ≀
finiteAvg (fun x : Cube (Fin d) => indicator (f x)) := by
convert acceptance_density_lower_of_width_correlation f k Ξ΅
(fun H hH => by convert hcorr H hH)
have hupper : finiteAvg (fun x : Cube (Fin d) => indicator (f x)) ≀
(C.gateCount : ℝ) * Ξ΅ + (C.gateCount : ℝ) ^ 2 * ((2 : ℝ) ^ k)⁻¹ := by
convert C.acceptance_density_le f hC k Ξ΅ hΞ΅
(fun H hH => by convert hcorr H hH)
have hinverse : (2 : ℝ) ^ (-(k : ℝ)) = ((2 : ℝ) ^ k)⁻¹ := by
rw [Real.rpow_neg (by norm_num : (0 : ℝ) ≀ 2), Real.rpow_natCast]
have hfinal := final_error_le s (d : ℝ) (C.gateCount : ℝ) hs hdReal
(Nat.cast_nonneg _) hsize k hk
have hupper' : finiteAvg (fun x : Cube (Fin d) => indicator (f x)) ≀ 5 / 128 := by
calc
_ ≀ (C.gateCount : ℝ) * Ξ΅ + (C.gateCount : ℝ) ^ 2 * ((2 : ℝ) ^ k)⁻¹ := hupper
_ = 6 * (C.gateCount : ℝ) *
(2 : ℝ) ^ (-(64 * (s + 1) * Real.sqrt (d : ℝ)) / 16) +
(C.gateCount : ℝ) ^ 2 * (2 : ℝ) ^ (-(k : ℝ)) := by
rw [hinverse]
dsimp only [Ξ΅]
ring
_ ≀ 5 / 128 := hfinal
linarith
end DepthThreeLowerBound
end OAI