Buckets:
Lean 4 ยท 6
declarations fullstatements
| 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 | |
Outline
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.