math / data /lean /OAI /Geometry /IsometricImmersion /Comparison /ActualClassComparisonGradient.lean
Download data/lean/OAI/Geometry/IsometricImmersion/Comparison/ActualClassComparisonGradient.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 11.3 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/IsometricImmersion/Comparison/ActualClassComparisonGradient.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/IsometricImmersion/Comparison/ActualClassComparisonGradient.lean
-
curl -L -o ActualClassComparisonGradient.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/IsometricImmersion/Comparison/ActualClassComparisonGradient.lean
11.3 kB
| import OAI.Geometry.IsometricImmersion.Metrics.SmoothMetricRestriction | |
| import OAI.Geometry.IsometricImmersion.Coordinates.ActualReferenceSegment | |
| import OAI.Geometry.IsometricImmersion.Comparison.ActualComparisonGradient | |
| import OAI.Geometry.IsometricImmersion.Comparison.ComparisonPulseGeometry | |
| import OAI.Geometry.IsometricImmersion.Taylor.TaylorInitialVelocity | |
| namespace OAI | |
| noncomputable section | |
| open Set Filter Function MeasureTheory | |
| open scoped ContDiff Topology Matrix | |
| namespace SmoothLocal.Perturbation | |
| open SmoothLocal.Geometry SmoothLocal.Pulse SmoothLocal.HighEquation SmoothLocal.Flow | |
| open SmoothLocal.ODE SmoothLocal.Weighted SmoothLocal.Hyperbolic SmoothLocal.Taylor | |
| theorem exists_actual_class_comparison_gradient_from_source | |
| {gStar : MetricField} {V : Set Coord} | |
| (hgStar : SmoothPositiveOn gStar V) (hV : IsOpen V) (hSV : modelSquare β V) | |
| {G d kappa q0 r : β} (M : β) (hG : 0 β€ G) (hd : 0 < d) | |
| (hgStarB : β i j k, k β€ 2 β β p β modelSquare, | |
| βiteratedFDeriv β k (fun q => gStar q i j) pβ β€ G) | |
| (hdStar : β p β modelSquare, d β€ (gStar p).det) | |
| (hkappa : 0 < kappa) (hM : 0 < M) (hq0 : |q0| β€ 1/20) | |
| (hr : 0 < r) (hrhalf : r < 1/2) (hLr : boundedClassWidth kappa M*r β€ 1/20) | |
| (hrsmall : heightQuotientJetBound G (M : β) d (1/(M : β))* | |
| (r+107*(boundedClassWidth kappa M*r)/100) β€ 9/(100*boundedClassWidth kappa M)) | |
| (N : β) (hN : 2 < N) : | |
| β Cgradient : β, 0 β€ Cgradient β§ | |
| β delta : β, 0 < delta β delta β€ 1/2 β | |
| βαΆ tau : β in atTop, | |
| β (g0 : MetricField) (eta : metricPatchSet g0 kappa) (U W : Set Coord) | |
| (z : Coord β β) (Y : β β β β β), | |
| SmoothPositiveOn (perturbedMetric g0 eta.val) U β IsOpen U β | |
| CapInductionHeight (perturbedMetric g0 eta.val) U (M : β) (1/(M : β)) (1/(M : β)) z β | |
| CapInductionFlow (perturbedMetric g0 eta.val) U G (M : β) d (1/(M : β)) (1/(M : β)) kappa z Y W β | |
| BoundedAdmissibleHeight (perturbedMetric g0 eta.val) M z β | |
| (β i j k, k β€ 4 β β p β modelSquare, | |
| βiteratedFDeriv β k (fun q => perturbedMetric g0 eta.val q i j) pβ β€ G) β | |
| (β p β modelSquare, d β€ |(perturbedMetric g0 eta.val p).det|) β | |
| |hessianQuotient (perturbedMetric g0 eta.val) z 0-q0| β€ 1/(100*boundedClassWidth kappa M) β | |
| (β i j : Fin 2, β k β€ tau, β p β modelSquare, | |
| βiteratedFDeriv β k (fun q => perturbedMetric g0 eta.val q i j- | |
| testMetric gStar q0 (boundedClassWidth kappa M*r/16) N delta (tau : β) q i j) pβ β€ | |
| metricApproximationAccuracy tau) β | |
| let zs := heightInShearCoordinates z q0 | |
| let gs := metricInShearCoordinates gStar q0 | |
| let P := taylorApproximation gs (-delta/(tau : β)) | |
| (heightCauchyValue zs (-delta/(tau : β))) | |
| (heightCauchyVelocity zs (-delta/(tau : β))) N | |
| β F : β, 0 β€ F β | |
| (β p β pulseStrip (boundedClassWidth kappa M*r/2) delta (tau : β), | |
| |actualComparisonSource gStar (perturbedMetric g0 eta.val) z q0 P p| β€ F) β | |
| β theta β Icc (-(delta/(tau : β))) (delta/(tau : β)), β i : Fin 2, | |
| Real.sqrt (β« x in Icc (-(boundedClassWidth kappa M*r/16)) (boundedClassWidth kappa M*r/16), | |
| (coordPartial i (comparisonDifference P zs) (boxPoint x theta))^2) β€ | |
| Cgradient*F*delta/(tau : β) := by | |
| let L := boundedClassWidth kappa M | |
| let Z := (2*(1+|q0|))^3*(M : β) | |
| let nu := (boundedClassSpeed kappa M)^2/(2*(M : β)) | |
| let gs := metricInShearCoordinates gStar q0 | |
| let Vs := inverseShearCoordinates q0 β»ΒΉ' V | |
| have hL : 0 < L := boundedClassWidth_pos kappa M | |
| have hLrpos : 0 < L*r := mul_pos hL hr | |
| have hnu : 0 < nu := boundedClassShearHxxFloor_pos hkappa hM | |
| have hminv : 0 < 1/(M : β) := one_div_pos.mpr (Nat.cast_pos.mpr hM) | |
| obtain β¨CP,A,_,hA,hsegmentβ© := exists_actual_reference_segment_at_radius | |
| hgStar hV hSV M hG hd hgStarB hdStar hkappa hM hq0 hr hrhalf hLr hrsmall N hN | |
| let s0 := ((nu*(1/(M : β)))/2)/A^2 | |
| have hs0 : 0 < s0 := div_pos (half_pos (mul_pos hnu hminv)) | |
| (sq_pos_of_pos (zero_lt_one.trans_le hA)) | |
| have hgs : SmoothPositiveOn gs Vs := metricInShearCoordinates_smoothPositive hgStar q0 | |
| have hVs : IsOpen Vs := shearedModelDomain_isOpen hV q0 | |
| obtain β¨CE,hCE,hgradientβ© := exists_actual_comparison_gradient hgs hVs | |
| (shearedModelSquare_isCompact q0) (shearedModelSquare_subset_domain hSV q0) | |
| 1 CP Z (by norm_num) (half_pos hnu) hs0 | |
| let speed := comparisonEnergySpeed CE | |
| let rate := comparisonEnergyRate CE CP Z s0 | |
| let Cgradient := 2*Real.exp 1*Real.sqrt (2*(1+1/s0))*Real.sqrt (2*(L*r/4)) | |
| have hs : 0 β€ speed := add_nonneg (zero_le_one.trans hCE) (Real.sqrt_nonneg _) | |
| have hCg : 0 β€ Cgradient := by dsimp [Cgradient]; positivity | |
| refine β¨Cgradient,hCg,?_β© | |
| intro delta hdelt hdhalf | |
| have hwidth : βαΆ tau : β in atTop, 1 β€ (tau : β) β§ delta/(2*(tau : β)) β€ r/4 := | |
| (tendsto_natCast_atTop_atTop : Tendsto (fun tau : β => (tau : β)) atTop atTop).eventually | |
| (pulse_width_eventually hr delta) | |
| have hlarge : βαΆ tau : β in atTop, rate*(2*delta) β€ (tau : β) := | |
| (tendsto_natCast_atTop_atTop : Tendsto (fun tau : β => (tau : β)) atTop atTop).eventually | |
| (eventually_ge_atTop _) | |
| have hpulse : 0 < L*r/16 := div_pos hLrpos (by norm_num : (0 : β) < 16) | |
| filter_upwards [hsegment delta hdelt hdhalf,hwidth,hlarge, | |
| comparison_pulse_geometry_eventually hpulse hs delta hdelt.le] | |
| with tau hsegTau hw hrateTau htravel | |
| intro g0 eta U W z Y hg hU hh hf hclass hgB hdet hcenter happ | |
| let g := perturbedMetric g0 eta.val | |
| let gt := metricInShearCoordinates g q0 | |
| let zs := heightInShearCoordinates z q0 | |
| let a := -delta/(tau : β) | |
| let b := delta/(tau : β) | |
| let I := Ioo (-(L*r)) (L*r) | |
| let P := taylorApproximation gs a (heightCauchyValue zs a) (heightCauchyVelocity zs a) N | |
| let T := closedRectangle (-(L*r/2)) (L*r/2) a b | |
| have hTP : T = pulseStrip (L*r/2) delta (tau : β) := by | |
| simp only [T,pulseStrip,a,b,neg_div] | |
| let Us := inverseShearCoordinates q0 β»ΒΉ' U | |
| let D := (Us β© Vs) β© spatialStrip I | |
| have hUs : IsOpen Us := shearedModelDomain_isOpen hU q0 | |
| have hD : IsOpen D := (hUs.inter hVs).inter (spatialStrip_isOpen isOpen_Ioo) | |
| have hSU : modelSquare β U := hf.squareSubset.trans hf.domainSubset | |
| have htpos : (0 : β) < tau := zero_lt_one.trans_le hw.1 | |
| have hbnonneg : 0 β€ b := div_nonneg hdelt.le htpos.le | |
| have hab : a β€ b := by dsimp only [a,b]; simp only [neg_div]; linarith | |
| have hbr : b β€ r := by | |
| have he : delta/(tau : β)=2*(delta/(2*(tau : β))) := by ring | |
| dsimp only [b] | |
| rw [he] | |
| linarith [hw.2] | |
| have hcoordinates (p : Coord) (hp : p β T) : |p 0| β€ L*r β§ |p 1| β€ r := by | |
| have hx : |p 0| β€ L*r/2 := abs_le.mpr hp.1 | |
| have ht : |p 1| β€ b := abs_le.mpr | |
| β¨by simpa only [a,b,neg_div] using hp.2.1,hp.2.2β© | |
| exact β¨hx.trans (by linarith),ht.trans hbrβ© | |
| have hgeom (p : Coord) (hp : p β T) := actual_central_sheared_solution_margins | |
| eta hclass hG hd hkappa hr.le hLr hq0 hrsmall hgB hdet hcenter | |
| (hcoordinates p hp).1 (hcoordinates p hp).2 | |
| have hpS (p : Coord) (hp : p β T) : inverseShearCoordinates q0 p β modelSquare := (hgeom p hp).1 | |
| have hbox : T β D := by | |
| intro p hp | |
| exact β¨β¨hSU (hpS p hp),hSV (hpS p hp)β©, | |
| β¨by linarith [hp.1.1],by linarith [hp.1.2]β©β© | |
| have hpoint (p : Coord) (hp : p β T) : βpβ β€ 1 := by | |
| apply (pi_norm_le_iff_of_nonneg (by norm_num : (0 : β) β€ 1)).mpr | |
| intro i | |
| fin_cases i | |
| Β· change |p 0| β€ 1 | |
| exact (hcoordinates p hp).1.trans (hLr.trans (by norm_num)) | |
| Β· change |p 1| β€ 1 | |
| exact (hcoordinates p hp).2.trans (by linarith) | |
| have hgt : SmoothPositiveOn gt D := | |
| (metricInShearCoordinates_smoothPositive hg q0).mono (fun p hp => hp.1.1) | |
| have hzsUs : ContDiffOn β β zs Us := heightInShearCoordinates_contDiffOn hh.smooth q0 | |
| have hzsD : ContDiffOn β β zs D := hzsUs.mono (fun p hp => hp.1.1) | |
| obtain β¨hP,hPB,hsegActualβ© := hsegTau g0 eta U W z Y hg hU hh hf hclass hgB hdet hcenter happ | |
| have hPD : ContDiffOn β β P D := hP.mono inter_subset_right | |
| have hzB : CoordinateBound zs T 3 Z := bounded_class_sheared_C3_on_actual_region hclass q0 hpS | |
| have hPB' : CoordinateBound P T 3 CP := by rw [hTP]; exact hPB | |
| have hCauchy := actual_taylor_Cauchy_of_smooth gs zs a N isOpen_Ioo hP | |
| have hpointEq (x t : β) : boxPoint x t=(![x,t] : Coord) := by | |
| ext i | |
| fin_cases i | |
| Β· change x*1+t*0=x | |
| ring | |
| Β· change x*0+t*1=t | |
| ring | |
| have hvalue (x : β) (hx : x β Ioo (-(L*r/2)) (L*r/2)) : | |
| P (boxPoint x a)=zs (boxPoint x a) := by | |
| rw [hpointEq] | |
| exact (hCauchy x β¨by linarith [hx.1],by linarith [hx.2]β©).1 | |
| have hvelocity (x : β) (hx : x β Ioo (-(L*r/2)) (L*r/2)) : | |
| coordPartial 1 P (boxPoint x a)=coordPartial 1 zs (boxPoint x a) := by | |
| rw [hpointEq] | |
| exact (hCauchy x β¨by linarith [hx.1],by linarith [hx.2]β©).2 | |
| have hmargin (p : Coord) (hp : p β T) (sigma : β) (hsigma : sigma β Icc (0 : β) 1) : | |
| nu/2 β€ |stateQDenominator gs (qHeightJetSegment P zs sigma p)| β§ | |
| s0 β€ qFirstCoefficient gs 5 (qHeightJetSegment P zs sigma p) := by | |
| have hm := hsegActual p (by simpa only [hTP] using hp) sigma hsigma | |
| have he : nu/2=(boundedClassSpeed kappa M)^2/(4*(M : β)) := by dsimp [nu]; ring | |
| exact β¨by simpa only [he] using hm.1,hm.2.2.2.1β© | |
| have htravel' : speed*(b-a) β€ L*r/4-L*r/16 := by | |
| have he : b-a=2*delta/(tau : β) := by dsimp [a,b]; ring | |
| rw [he] | |
| calc | |
| speed*(2*delta/(tau : β)) β€ 3*(L*r/16) := htravel.2.1 | |
| _ = L*r/4-L*r/16 := by ring | |
| dsimp only | |
| intro F hF hsource theta htheta i | |
| have hsourceMetric (p : Coord) (hp : p β T) : | |
| |metricComparisonSource gt gs P zs p| β€ F := by | |
| change |actualComparisonSource gStar g z q0 P p| β€ F | |
| exact hsource p (by simpa only [hTP] using hp) | |
| have hgrad := hgradient gt P zs D (L*r/2) (L*r/4) (L*r/16) a b F | |
| hD (fun p hp => hp.1.2) hgt hPD hzsD (by positivity) (by linarith) hab | |
| hbox (fun p hp => hpS p hp) hpoint hPB' hzB | |
| (fun p hp => (hgeom p hp).2.2.2.2.2.1) | |
| (fun p hp => abs_pos.mp (hnu.trans_le (hgeom p hp).2.1)) | |
| hmargin hvalue hvelocity (by positivity) hF htravel' | |
| hsourceMetric theta | |
| (by simpa only [a,b,neg_div] using htheta) i | |
| have he : b-a=2*delta/(tau : β) := by dsimp [a,b]; ring | |
| rw [he] at hgrad | |
| have hexp := comparison_exponential_le_fixed htpos hrateTau | |
| have hbound := mul_le_mul_of_nonneg_right hexp hF | |
| have hbound := mul_le_mul_of_nonneg_right hbound (Real.sqrt_nonneg (2*(L*r/4))) | |
| have hduration : 0 β€ 2*delta/(tau : β) := | |
| div_nonneg (mul_nonneg (by norm_num : (0 : β) β€ 2) hdelt.le) htpos.le | |
| have hbound := mul_le_mul_of_nonneg_right hbound hduration | |
| have hbound := mul_le_mul_of_nonneg_left hbound (Real.sqrt_nonneg (2*(1+1/s0))) | |
| apply hgrad.trans | |
| convert hbound using 1 | |
| dsimp [Cgradient] | |
| ring | |
| end SmoothLocal.Perturbation | |
| end | |
| end OAI | |