math / data /lean /OAI /Computability /MinUncut /Games /AdaptiveKernel.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
3.38 kB
import Mathlib
import OAI.Computability.MinUncut.Games.TripleKernel
namespace OAI
section
noncomputable section
open scoped BigOperators
namespace MinUncut.Composition
open BinaryFourier OuterSmoothness
attribute [local instance] Classical.propDecidable BinaryFourier.dualFintype
abbrev TripleIndex (J : Type*) := Option (Option (Option J))
def tripleTupleEquiv {J A : Type*} :
(TripleIndex J β†’ A) ≃ ((J β†’ A) Γ— (A Γ— A Γ— A)) where
toFun L := (fun j => L (some (some (some j))), L none,L (some none),L (some (some none)))
invFun z
| none => z.2.1
| some none => z.2.2.1
| some (some none) => z.2.2.2
| some (some (some j)) => z.1 j
left_inv L := by funext j; cases j with
| none => rfl
| some j => cases j with
| none => rfl
| some j => cases j <;> rfl
right_inv _ := rfl
lemma TripleIndex.card (J : Type*) [Fintype J] :
Fintype.card (TripleIndex J)=Fintype.card J+3 := by simp [TripleIndex]
variable {J V W : Type*} [Fintype J] [DecidableEq J]
[AddCommGroup V] [Module Fβ‚‚ V] [Fintype V]
[AddCommGroup W] [Module Fβ‚‚ W] [Fintype W]
def adaptiveKernel (f : (J β†’ V) β†’ V β†’ ℝ) (u : ℝ) (L : TripleIndex J β†’ V) : ℝ :=
tripleKernel (remainder (f (tripleTupleEquiv L).1) u) (tripleTupleEquiv L).2
omit [Fintype J] [DecidableEq J] in
lemma adaptiveKernel_abs (f : (J β†’ V) β†’ V β†’ ℝ) {M u : ℝ}
(hM : 0≀M) (hu : 0<u) (hf : βˆ€ D z, |f D z|≀M) (L : TripleIndex J β†’ V) :
|adaptiveKernel f u L|≀(M+M^2/u)^4 :=
tripleKernel_abs _ (by positivity) (remainder_abs_bound _ hM hu (hf _)) _
lemma adaptiveKernel_uniform (f : (J β†’ V) β†’ V β†’ ℝ) {M u : ℝ}
(hM : 0≀M) (hu : 0<u) (hf : βˆ€ D z, |f D z|≀M) :
(𝔼 L : TripleIndex J β†’ V, adaptiveKernel f u L)≀u^2*M^2 := by
have he : (𝔼 L : TripleIndex J β†’ V, adaptiveKernel f u L) =
𝔼 z : (J β†’ V) Γ— (V Γ— V Γ— V), tripleKernel (remainder (f z.1) u) z.2 :=
Fintype.expect_equiv tripleTupleEquiv _ _ (fun _ => rfl)
rw [he,expect_pair]
simp_rw [tripleKernel_mean]
exact (Finset.expect_le_expect (fun D _ => remainder_fourth_bound (f D) hM hu (hf D))).trans_eq
(Fintype.expect_const _)
omit [Fintype J] [DecidableEq J] [Fintype W] in
lemma adaptiveKernel_pullback (Ο€ : W β†’β‚—[Fβ‚‚] V) (f : (J β†’ V) β†’ V β†’ ℝ) (u : ℝ)
(L : TripleIndex J β†’ W) :
adaptiveKernel f u (fun j => Ο€ (L j)) =
tripleKernel (fun z => remainder (f (fun j => Ο€ ((tripleTupleEquiv L).1 j))) u (Ο€ z))
(tripleTupleEquiv L).2 := by
simp only [adaptiveKernel,tripleKernel,tripleTupleEquiv,Equiv.coe_fn_mk,map_add]
lemma adaptiveKernel_pullback_mean (Ο€ : W β†’β‚—[Fβ‚‚] V) (f : (J β†’ V) β†’ V β†’ ℝ) (u : ℝ) :
(𝔼 L : TripleIndex J β†’ W, adaptiveKernel f u (fun j => Ο€ (L j))) =
𝔼 D : J β†’ W, βˆ‘ Ξ² : Module.Dual Fβ‚‚ W,
coefficient (fun z => remainder (f (fun j => Ο€ (D j))) u (Ο€ z)) Ξ² ^4 := by
simp_rw [adaptiveKernel_pullback]
have he := Fintype.expect_equiv (tripleTupleEquiv (J := J) (A := W))
(fun L => tripleKernel (fun z => remainder (f (fun j => Ο€ ((tripleTupleEquiv L).1 j))) u (Ο€ z))
(tripleTupleEquiv L).2)
(fun z => tripleKernel (fun w => remainder (f (fun j => Ο€ (z.1 j))) u (Ο€ w)) z.2)
(fun _ => rfl)
rw [he,expect_pair]
simp_rw [tripleKernel_mean]
end MinUncut.Composition
end
end
end OAI