cfahlgren1's picture
download
raw
6.71 kB
import Mathlib
import OAI.Analysis.BiholderTransport.Coordinates.SplitPairing
import OAI.Analysis.BiholderTransport.Calculus.SecondTaylorComposition
import OAI.Analysis.BiholderTransport.LinearAlgebra.MovingSplit
namespace OAI
section
section
noncomputable section
open Set Filter Manifold MeasureTheory Bundle
open scoped ENNReal ContDiff Topology
namespace WeakMTWTransport
section Prefix
variable {n : โ„•} {M : Type*} [MetricSpace M] [CompactSpace M]
[ChartedSpace (Model n) M] [IsManifold ๐“˜(โ„,Model n) โˆž M]
[RiemannianBundle (fun x : M => TangentSpace ๐“˜(โ„,Model n) x)]
[IsContMDiffRiemannianBundle ๐“˜(โ„,Model n) โˆž (Model n)
(fun x : M => TangentSpace ๐“˜(โ„,Model n) x)]
[IsRiemannianManifold ๐“˜(โ„,Model n) M]
def prefixNormalCost (x : M) (t : โ„)
(q : TangentSpace ๐“˜(โ„,Model n) x ร— TangentSpace ๐“˜(โ„,Model n) x) : โ„ :=
cost (riemannianExp x q.1) (riemannianExp x (t โ€ข q.2))/t
lemma prefixNormalCost_contDiffAt {x : M} {p : TangentSpace ๐“˜(โ„,Model n) x}
{t : โ„} (hleft : t โ€ข p โˆˆ injectivityDomain x) :
ContDiffAt โ„ โˆž (prefixNormalCost x t) (0,p) := by
let V := TangentSpace ๐“˜(โ„,Model n) x
have he := contMDiff_riemannianExp_fiber (n := n) x
have hu : ContMDiffAt ๐“˜(โ„,Vร—V) ๐“˜(โ„,Model n) โˆž
(fun q : Vร—V => riemannianExp x q.1) (0,p) :=
(he _).comp (0,p) contDiffAt_fst.contMDiffAt
have hv : ContMDiffAt ๐“˜(โ„,Vร—V) ๐“˜(โ„,Model n) โˆž
(fun q : Vร—V => riemannianExp x (t โ€ข q.2)) (0,p) :=
(he _).comp (0,p) (show ContDiffAt โ„ โˆž (fun q : Vร—V => t โ€ข q.2) (0,p) from by fun_prop).contMDiffAt
have hc := cost_contMDiffAt_of_injectivityDomain
(โŸจx,t โ€ข pโŸฉ : TangentBundle ๐“˜(โ„,Model n) M) hleft
have hc' : ContMDiffAt (๐“˜(โ„,Model n).prod ๐“˜(โ„,Model n)) ๐“˜(โ„,โ„) โˆž
(fun q : Mร—M => cost q.1 q.2) (riemannianExp x (0:V),riemannianExp x (t โ€ข p)) := by
simpa only [riemannianExp_zero] using hc
exact ((hc'.comp (0,p) (hu.prodMk hv)).contDiffAt.div_const t)
lemma prefixNormalCost_zero {x : M} {p : TangentSpace ๐“˜(โ„,Model n) x}
{t : โ„} (ht : 0 < t) (hp : t โ€ข p โˆˆ injectivityDomain x) :
prefixNormalCost x t (0,p) = t/2*โ€–pโ€–^2 := by
have H := injectivityDomain_subset_minimizingVectors x hp
change dist x (riemannianExp x (t โ€ข p)) = โ€–t โ€ข pโ€– at H
simp only [prefixNormalCost,riemannianExp_zero,cost,H,norm_smul_of_nonneg ht.le]
field_simp
lemma prefixNormalCost_source_gradient {x : M} {p : TangentSpace ๐“˜(โ„,Model n) x}
{t : โ„} (ht : t โ‰  0) (hp : t โ€ข p โˆˆ injectivityDomain x)
(u : TangentSpace ๐“˜(โ„,Model n) x) :
fderiv โ„ (prefixNormalCost x t) (0,p) (u,0) = -inner โ„ p u := by
have hB := (prefixNormalCost_contDiffAt hp).differentiableAt (by simp)
have hnc := ((normalCost_contDiffAt hp).differentiableAt (by simp)).hasFDerivAt
have H := hnc.mul_const tโปยน
have H' : HasFDerivAt (fun a => prefixNormalCost x t (a,p))
(tโปยน โ€ข fderiv โ„ (normalCost x (t โ€ข p)) 0) 0 := by
simpa only [prefixNormalCost,normalCost,div_eq_mul_inv] using H
have hpair := (hasFDerivAt_id (๐•œ := โ„) (0 : TangentSpace ๐“˜(โ„,Model n) x)).prodMk
(hasFDerivAt_const p (0 : TangentSpace ๐“˜(โ„,Model n) x))
have heq := (hB.hasFDerivAt.comp (f := fun a => (a,p)) 0 hpair).unique H'
have hh := congrArg (fun A : TangentSpace ๐“˜(โ„,Model n) x โ†’L[โ„] โ„ => A u) heq
change fderiv โ„ (prefixNormalCost x t) (0,p) (u,0) =
tโปยน * fderiv โ„ (normalCost x (t โ€ข p)) 0 u at hh
rw [normalCost_fderiv_zero hp,real_inner_smul_left] at hh
rw [hh]
field_simp
lemma prefixNormalCost_target_gradient {x : M} {p : TangentSpace ๐“˜(โ„,Model n) x}
{t : โ„} (ht : 0 < t) (hp : t โ€ข p โˆˆ injectivityDomain x)
(u : TangentSpace ๐“˜(โ„,Model n) x) :
fderiv โ„ (prefixNormalCost x t) (0,p) (0,u) = t*inner โ„ p u := by
let V := TangentSpace ๐“˜(โ„,Model n) x
have hB := (prefixNormalCost_contDiffAt hp).differentiableAt (by simp)
have hnear : โˆ€แถ  q : V in ๐“ p, t โ€ข q โˆˆ injectivityDomain x :=
(show ContinuousAt (fun q : V => t โ€ข q) p from by fun_prop).preimage_mem_nhds
(isOpen_injectivityDomain x |>.mem_nhds hp)
have heq : (fun q : V => prefixNormalCost x t (0,q)) =แถ [๐“ p]
(fun q : V => t/2*โ€–qโ€–^2) := hnear.mono (fun _ h => prefixNormalCost_zero ht h)
have H := ((hasFDerivAt_id (๐•œ := โ„) p).norm_sq).const_mul (t/2)
have Hd : HasFDerivAt (fun q : V => prefixNormalCost x t (0,q))
((t/2) โ€ข (2 โ€ข innerSL โ„ p)) p := by
exact H.congr_of_eventuallyEq heq
have hpair := (hasFDerivAt_const (0:V) p).prodMk (hasFDerivAt_id (๐•œ := โ„) p)
have hh := congrArg (fun A : V โ†’L[โ„] โ„ => A u)
((hB.hasFDerivAt.comp (f := fun q : V => ((0:V),q)) p hpair).unique Hd)
simp only [ContinuousLinearMap.comp_apply,ContinuousLinearMap.prod_apply,zero_apply,
smul_apply,innerSL_apply_apply] at hh
convert! hh using 1
simp only [smul_eq_mul]
ring
lemma prefixNormalCost_hessian_blocks {x : M} {p : TangentSpace ๐“˜(โ„,Model n) x}
{t : โ„} (ht : 0 < t) (hp : t โ€ข p โˆˆ injectivityDomain x)
(u v : TangentSpace ๐“˜(โ„,Model n) x) :
fderiv โ„ (fderiv โ„ (prefixNormalCost x t)) (0,p) (u,0) (0,v) = -inner โ„ u v โˆง
fderiv โ„ (fderiv โ„ (prefixNormalCost x t)) (0,p) (0,u) (0,v) = t*inner โ„ u v := by
let V := TangentSpace ๐“˜(โ„,Model n) x
have hBโ‚‚ := (prefixNormalCost_contDiffAt hp).of_le (m := 2)
(ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)
have hnear : โˆ€แถ  q : V in ๐“ p, t โ€ข q โˆˆ injectivityDomain x :=
(show ContinuousAt (fun q : V => t โ€ข q) p from by fun_prop).preimage_mem_nhds
(isOpen_injectivityDomain x |>.mem_nhds hp)
constructor
ยท have heq : (fun q : V => fderiv โ„ (prefixNormalCost x t) (0,q) (u,0)) =แถ [๐“ p]
(fun q : V => -inner โ„ u q) := by
filter_upwards [hnear] with q hq
rw [prefixNormalCost_source_gradient ht.ne' hq,real_inner_comm]
have H := pair_hessian_snd_from_gradient hBโ‚‚ (u,0) heq
(((innerSL โ„ u).hasFDerivAt (x := p)).neg) v
rw [(hBโ‚‚.isSymmSndFDerivAt (by simp)).eq] at H
exact H
ยท have heq : (fun q : V => fderiv โ„ (prefixNormalCost x t) (0,q) (0,v)) =แถ [๐“ p]
(fun q : V => t*inner โ„ v q) := by
filter_upwards [hnear] with q hq
rw [prefixNormalCost_target_gradient ht hq,real_inner_comm]
have H := pair_hessian_snd_from_gradient hBโ‚‚ (0,v) heq
(((innerSL โ„ v).hasFDerivAt (x := p)).const_mul t) u
simpa only [smul_apply,innerSL_apply_apply,real_inner_comm v u,smul_eq_mul] using H
end Prefix
end WeakMTWTransport
end
end
end
end OAI

Xet Storage Details

Size:
6.71 kB
ยท
Xet hash:
2221eeb5e0b2e9090a09b0789dba421e1023f340078e34bcbb842c033e4c5125

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.