math / data /lean /OAI /Computability /MinUncut /Games /TripleKernel.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
2.33 kB
import Mathlib
import OAI.Computability.MinUncut.Estimates.Density
namespace OAI
noncomputable section
open scoped BigOperators
open MeasureTheory ProbabilityTheory Filter
open scoped Topology NNReal
open scoped BigOperators
namespace MinUncut.Composition
open BinaryFourier OuterSmoothness
variable {W : Type*} [AddCommGroup W] [Module Fβ‚‚ W] [Fintype W]
local instance tripleKernelDecidableEq : DecidableEq W := Classical.decEq W
attribute [local instance] BinaryFourier.dualFintype
def tripleKernel (f : W β†’ ℝ) (v : W Γ— W Γ— W) : ℝ :=
f v.1 * f v.2.1 * f v.2.2 * f (v.1+v.2.1+v.2.2)
lemma tripleKernel_mean (f : W β†’ ℝ) :
(𝔼 v : W Γ— W Γ— W, tripleKernel f v) =
βˆ‘ Ξ± : Module.Dual Fβ‚‚ W, coefficient f Ξ± ^ 4 := by
unfold tripleKernel
rw [expect_pair]
simp_rw [expect_pair]
exact fourth_moment f
omit [Module Fβ‚‚ W] [Fintype W] in
lemma tripleKernel_abs (f : W β†’ ℝ) {M : ℝ} (hM : 0 ≀ M)
(hf : βˆ€ w, |f w| ≀ M) (v : W Γ— W Γ— W) : |tripleKernel f v| ≀ M^4 := by
simp only [tripleKernel, abs_mul]
calc _ ≀ M * M * M * M := by
gcongr <;> exact hf _
_ = _ := by ring
theorem adaptive_fourth_moment {B : Type*} [Fintype B] [Nonempty B]
(p : Density (B Γ— (W Γ— W Γ— W))) (f : B β†’ W β†’ ℝ) {M u : ℝ}
(hM : 0 ≀ M) (hu : 0 < u) (hf : βˆ€ b w, |f b w| ≀ M) :
(𝔼 z, p z * tripleKernel (remainder (f z.1) u) z.2) ≀
u^2 * M^2 + 2 * p.tvUniform * (M + M^2/u)^4 := by
let g : B Γ— (W Γ— W Γ— W) β†’ ℝ := fun z => tripleKernel (remainder (f z.1) u) z.2
have hMr : 0 ≀ M + M^2/u := by positivity
have hg (z : B Γ— (W Γ— W Γ— W)) : |g z| ≀ (M + M^2/u)^4 :=
tripleKernel_abs _ hMr (remainder_abs_bound (f z.1) hM hu (hf z.1)) z.2
have hdiff := Density.expect_difference p g (pow_nonneg hMr _) hg
have hmean : (𝔼 z, g z) ≀ u^2 * M^2 := by
change (𝔼 z : B Γ— (W Γ— W Γ— W), tripleKernel (remainder (f z.1) u) z.2) ≀ _
rw [expect_pair]
simp_rw [tripleKernel_mean]
calc _ ≀ 𝔼 b : B, u^2 * M^2 := Finset.expect_le_expect (fun b _ =>
remainder_fourth_bound (f b) hM hu (hf b))
_ = _ := Fintype.expect_const _
have habs := le_abs_self ((𝔼 z, p z * g z) - (𝔼 z, g z))
dsimp only [g] at hdiff hmean habs
linarith
end MinUncut.Composition
end
end OAI