math / data /lean /OAI /Probability /LogConcave /JetEstimates /FlowJetMajorant.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
5.07 kB
import Mathlib
import OAI.Probability.LogConcave.JetEstimates.SmoothTensorCurve
namespace OAI
section
section
noncomputable section
namespace LogConcaveSampling.TensorEnergy
open Set Function
open scoped Classical BigOperators RealInnerProductSpace
def flowJetMajorant (A : β„• β†’ ℝ) (hA : βˆ€k,0≀A k) (n : β„•) : ℝ :=
(smoothTensorCurve_bounds A hA n).choose
lemma flowJetMajorant_nonneg (A : β„• β†’ ℝ) (hA : βˆ€k,0≀A k) (n : β„•) :
0≀flowJetMajorant A hA n := (smoothTensorCurve_bounds A hA n).choose_spec.1
def flowCorrectionMajorant (A : β„• β†’ ℝ) (hA : βˆ€k,0≀A k) (n : β„•) : ℝ :=
βˆ‘c : OrderedFinpartition n,A c.length*∏i,flowJetMajorant A hA (c.partSize i)
lemma flowCorrectionMajorant_nonneg (A : β„• β†’ ℝ) (hA : βˆ€k,0≀A k) (n : β„•) :
0≀flowCorrectionMajorant A hA n :=
Finset.sum_nonneg (fun _ _ => mul_nonneg (hA _) (Finset.prod_nonneg (fun _ _ => flowJetMajorant_nonneg A hA _)))
lemma multilinearTensor_sub {d n : β„•} (f g : Point d β†’ Point d)
(hf : ContDiff ℝ (⊀:β„•βˆž) f) (hg : ContDiff ℝ (⊀:β„•βˆž) g) (y : Point d) :
multilinearTensor (iteratedFDeriv ℝ n (fun z => f z-g z) y)=
multilinearTensor (iteratedFDeriv ℝ n f y)-multilinearTensor (iteratedFDeriv ℝ n g y) := by
change multilinearTensor (iteratedFDeriv ℝ n (f-g) y)=_
rw [iteratedFDeriv_sub_apply (hf.contDiffAt.of_le (by exact_mod_cast (le_top : (n:β„•βˆž)β‰€βŠ€)))
(hg.contDiffAt.of_le (by exact_mod_cast (le_top : (n:β„•βˆž)β‰€βŠ€)))]
ext c
simp only [multilinearTensor,sub_apply,inner_sub_right,Pi.sub_apply]
theorem smoothTensorCurve_correction {d n : β„•} (hn : 0<n) (A : β„• β†’ ℝ) (hA : βˆ€k,0≀A k)
{R b Ξ· : ℝ} (hR : 0<R) (hR1 : R≀1) (hb : 0≀b) (hb1 : b≀1) (hΞ· : 0≀η)
(X : ℝ Γ— Point d β†’ Point d) (V : ℝ β†’ Point d β†’ Point d)
(hX : SmoothTensorCurve d A R b X V)
(hv : βˆ€k u,u∈Icc 0 b β†’ βˆ€z,AllSplitBound
(multilinearTensor (iteratedFDeriv ℝ k (V u) z)) (Ξ·*A k/R^(k-1)))
{t : ℝ} (ht : t∈Icc 0 b) (y : Point d) :
AllSplitBound (multilinearTensor (iteratedFDeriv ℝ n (fun z => X (t,z)-z) y))
(Ξ·*flowCorrectionMajorant A hA n/R^(n-1)) := by
let T (u : ℝ) := multilinearTensor (iteratedFDeriv ℝ n (fun z => X (u,z)) y)-
multilinearTensor (iteratedFDeriv ℝ n (id : Point d β†’ Point d) y)
let D (u : ℝ) := multilinearTensor (iteratedFDeriv ℝ n (fun z => V u (X (u,z))) y)
let M (k : β„•) := (Ξ·*A k)/R^(k-1)
let N (k : β„•) := flowJetMajorant A hA k/R^(k-1)
have hM (k : β„•) : 0≀M k := by exact div_nonneg (mul_nonneg hΞ· (hA k)) (pow_nonneg hR.le _)
have hN (k : β„•) : 0≀N k := div_nonneg (flowJetMajorant_nonneg A hA _) (pow_nonneg hR.le _)
have hflow (k : β„•) (u : ℝ) (hu : u∈Icc 0 b) :
AllSplitBound (multilinearTensor (iteratedFDeriv ℝ k (fun z => X (u,z)) y)) (N k) :=
(smoothTensorCurve_bounds A hA k).choose_spec.2 d R b X V hR hR1 hb hb1 hX u hu y
have hbound (u : ℝ) (hu : u∈Ico 0 b) :
AllSplitBound (D u) (Ξ·*flowCorrectionMajorant A hA n/R^(n-1)) := by
have hs : ContDiff ℝ (⊀:β„•βˆž) (fun z => X (u,z)) := hX.smooth.comp (contDiff_const.prodMk contDiff_id)
have hvs := (hX.velocity_smooth u ⟨hu.1,hu.2.le⟩).contDiffAt (x:=X (u,y))
have he := iteratedFDeriv_comp_allSplit y
(hs.contDiffAt.of_le (by exact_mod_cast (le_top : (n:β„•βˆž)β‰€βŠ€)))
(hvs.of_le (by exact_mod_cast (le_top : (n:β„•βˆž)β‰€βŠ€))) M N hM hN
(fun k hk => hv k u ⟨hu.1,hu.2.le⟩ (X (u,y)))
(fun k hk => hflow k u ⟨hu.1,hu.2.le⟩)
have heq : (βˆ‘c : OrderedFinpartition n,M c.length*∏i,N (c.partSize i))=
Ξ·*flowCorrectionMajorant A hA n/R^(n-1) := by
dsimp only [M,N]
rw [partition_sum_scale hn (fun k => Ξ·*A k) (flowJetMajorant A hA) R]
simp only [flowCorrectionMajorant,←Finset.mul_sum,mul_assoc]
rw [heq] at he
exact he
have hinit : AllSplitBound (T 0) 0 := by
have he : (fun z => X (0,z))=(id : Point d β†’ Point d) := funext hX.initial
dsimp only [T]
rw [he,sub_self]
exact allSplitBound_zero
have hpos : 0≀η*flowCorrectionMajorant A hA n/R^(n-1) :=
div_nonneg (mul_nonneg hΞ· (flowCorrectionMajorant_nonneg A hA n)) (pow_nonneg hR.le _)
have hg := allSplit_gronwall (T:=T) (D:=D) (K:=0)
((spatialTensor_continuous hX.smooth y).sub continuous_const).continuousOn
(fun u hu => ((spatialTensor_time_deriv hX.smooth (V u) u
(hX.equation u ⟨hu.1,hu.2.le⟩) y).sub_const _).hasDerivWithinAt)
(le_refl (0:ℝ)) hpos (le_refl (0:ℝ)) hinit
(fun u hu => by simpa only [zero_mul,zero_add] using hbound u hu) ht
simp only [gronwallBound_K0,zero_add,sub_zero] at hg
have hfinal := hg.mono (mul_nonneg hpos ht.1) (mul_le_of_le_one_right hpos (ht.2.trans hb1))
have hs : ContDiff ℝ (⊀:β„•βˆž) (fun z => X (t,z)) := hX.smooth.comp (contDiff_const.prodMk contDiff_id)
rw [multilinearTensor_sub (fun z => X (t,z)) (fun z => z) hs contDiff_id]
exact hfinal
end LogConcaveSampling.TensorEnergy
end
end
end
end OAI