File size: 3,206 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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | import Mathlib
import OAI.Probability.SKBarriers.Interpolation.AdaptiveODEExistence
namespace OAI
section
section
noncomputable section
open scoped BigOperators NNReal
open Set Metric
namespace SK.Analytic
theorem exists_positive_adaptive_path {k : β}
(R : (β Γ (Fin (k+1) β β)) β (Fin (k+1) β β)) (hR : ContDiff β 1 R)
(hRb : β p j, R p j β Icc (0:β) 1) (hRm : β p, Monotone (R p))
(Ξ· : β) (hΞ· : 0 < Ξ·) :
β q : β β (Fin (k+1) β β),
q 0 = (fun j => ((j.val:β)+1)*Ξ·) β§
(β t β Icc (0:β) 1, HasDerivWithinAt q
(R (Real.sqrt (1-t),fun j => Real.sqrt (cumulativeGapMap k (q t) j))) (Icc (0:β) 1) t) β§
(β t β Icc (0:β) 1, β j, Ξ· β€ cumulativeGapMap k (q t) j) β§
(β t β Icc (0:β) 1, β j, q t j β€ ((j.val:β)+1)*Ξ·+t) := by
let qβ : Fin (k+1) β β := fun j => ((j.val:β)+1)*Ξ·
let Ξ΅ := Ξ·/2
obtain β¨q,hq0,hqβ© := exists_floored_adaptive_path R hR hRb Ξ΅ (by dsimp [Ξ΅]; positivity) qβ
let v := fun t => R (Real.sqrt (1-t),positiveGapScales k Ξ΅ (q t))
have hGap0 (j : Fin (k+1)) : cumulativeGapMap k qβ j = Ξ· := by
refine Fin.cases ?_ (fun i => ?_) j
Β· simp [qβ]
Β· simp only [cumulativeGapMap_succ,qβ,Fin.val_succ,Fin.val_castSucc,Nat.cast_add,Nat.cast_one]
ring
have hGapD (j : Fin (k+1)) (t : β) (ht : t β Icc (0:β) 1) :
HasDerivWithinAt (fun u => cumulativeGapMap k (q u) j)
(cumulativeGapMap k (v t) j) (Icc (0:β) 1) t := by
exact ((ContinuousLinearMap.proj j).comp (cumulativeGapMap k)).hasFDerivAt.comp_hasDerivWithinAt t (hq t ht)
have hGapV (t : β) (j : Fin (k+1)) : 0 β€ cumulativeGapMap k (v t) j := by
refine Fin.cases ?_ (fun i => ?_) j
Β· exact (hRb _ 0).1
Β· change 0 β€ v t i.succ-v t i.castSucc
exact sub_nonneg.mpr (hRm _ (Fin.castSucc_le_succ i))
have hGap (t : β) (ht : t β Icc (0:β) 1) (j : Fin (k+1)) :
Ξ· β€ cumulativeGapMap k (q t) j := by
have H := monotoneOn_unit_of_deriv_nonneg (hGapD j) (fun t _ => hGapV t j)
(show (0:β) β Icc 0 1 by norm_num) ht ht.1
change cumulativeGapMap k (q 0) j β€ cumulativeGapMap k (q t) j at H
rwa [hq0,hGap0] at H
have hscales (t : β) (ht : t β Icc (0:β) 1) :
positiveGapScales k Ξ΅ (q t) = fun j => Real.sqrt (cumulativeGapMap k (q t) j) := by
funext j
rw [positiveGapScales,max_eq_right]
exact (by dsimp [Ξ΅]; linarith : Ξ΅ β€ Ξ·).trans (hGap t ht j)
refine β¨q,hq0,?_,hGap,?_β©
Β· intro t ht
simpa only [hscales t ht] using hq t ht
Β· intro t ht j
have hD (u : β) (hu : u β Icc (0:β) 1) :
HasDerivWithinAt (fun s => s-q s j) (1-v u j) (Icc (0:β) 1) u := by
exact (hasDerivWithinAt_id u _).sub
((ContinuousLinearMap.proj (R := β) (Ο := fun _ : Fin (k+1) => β) j).hasFDerivAt.comp_hasDerivWithinAt u (hq u hu))
have H := monotoneOn_unit_of_deriv_nonneg hD (fun u _ => sub_nonneg.mpr (hRb _ j).2)
(show (0:β) β Icc 0 1 by norm_num) ht ht.1
change 0-q 0 j β€ t-q t j at H
rw [hq0] at H
change 0-((j.val:β)+1)*Ξ· β€ t-q t j at H
linarith
end SK.Analytic
end
end
end
end OAI
|