Download data/lean/OAI/Geometry/BallPacking/Moser/BackgroundDensity.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 29.7 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/BallPacking/Moser/BackgroundDensity.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/BallPacking/Moser/BackgroundDensity.lean
-
curl -L -o BackgroundDensity.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/BallPacking/Moser/BackgroundDensity.lean
29.7 kB
| import Mathlib | |
| import OAI.Geometry.BallPacking.Moser.CircleCorrection | |
| namespace OAI | |
| noncomputable section | |
| namespace PackingSufficiencySupport.Hamiltonian | |
| section | |
| open scoped ContDiff Topology NNReal | |
| open scoped ContDiff Topology | |
| open Set Metric | |
| open scoped ContDiff Topology | |
| open Set Metric | |
| open scoped ContDiff Classical | |
| open Set Function MeasureTheory | |
| open scoped ContDiff Topology Classical NNReal | |
| open Set Function MeasureTheory | |
| theorem exists_relative_planar_moser_correction {ΞΉ : Type*} [Fintype ΞΉ] | |
| {f : Plane β β} (hf : ContDiff β β f) (hfc : HasCompactSupport f) | |
| (hf0 : (β« p, f p) = 0) (hpos : β x, 0 < 1+f x) | |
| (R : ΞΉ β β) (hR : β i, 0 < R i) (hRi : Injective R) | |
| (hz : β i, (β« p in roundDisk (R i), f p) = 0) : | |
| β Ξ¦ : Plane ββ Plane, ContDiff β β Ξ¦ β§ ContDiff β β Ξ¦.symm β§ | |
| HasCompactSupport (fun x => Ξ¦ x - x) β§ | |
| (β x v w, (1+f (Ξ¦ x)) * planarArea (fderiv β Ξ¦ x v) (fderiv β Ξ¦ x w) = planarArea v w) β§ | |
| (β i, Ξ¦ '' roundDisk (R i) = roundDisk (R i)) := by | |
| obtain β¨U,V,hU,hV,hUc,hVc,hcurl,htanβ© := | |
| exists_relative_planar_primitive hf hfc hf0 R hR hRi hz | |
| have hXs := moserField_smooth hf hU hV hpos | |
| have hXc := moserField_hasCompactSupport (f := f) hUc hVc | |
| obtain β¨L,hLβ© := ContDiff.lipschitzWith_of_hasCompactSupport hXc hXs (by simp) | |
| let X : C(β Γ Plane,Plane) := β¨moserField f U V,hXs.continuousβ© | |
| let K := tsupport U βͺ tsupport V | |
| have hK : IsCompact K := hUc.union hVc | |
| have hfix (t : β) (x : Plane) (hx : x β K) : X (t,x) = 0 := by | |
| have hu : U x = 0 := image_eq_zero_of_notMem_tsupport (fun h => hx (Or.inl h)) | |
| have hv : V x = 0 := image_eq_zero_of_notMem_tsupport (fun h => hx (Or.inr h)) | |
| change moserField f U V (t,x) = 0 | |
| simp [moserField,hu,hv] | |
| obtain β¨Ξ¦,hΞ¦,hΞ¦i,_,hΞ¦c,hΞ¦area,_,hΞ¦diskβ© := exists_density_transport_relative X hL hXs hXc | |
| (moserDensity f) (moserDensity_smooth hf) planarArea | |
| (moserField_transport hf hU hV hpos hcurl) K hK hfix R hR | |
| (fun i => moserField_tangent (htan i)) 0 1 | |
| refine β¨Ξ¦,hΞ¦,hΞ¦i,hΞ¦c,?_,hΞ¦diskβ© | |
| intro x v w | |
| simpa only [zero_add,moserDensity,Real.smoothTransition.one,Real.smoothTransition.zero, | |
| one_mul,zero_mul,add_zero] using hΦarea x v w | |
| theorem homeomorph_image_closedRoundDisk (Ξ¦ : Plane ββ Plane) (R : β) | |
| (hcircle : β p, radiusSq (Ξ¦ p) = R^2 β radiusSq p = R^2) : | |
| Ξ¦ '' closedRoundDisk R = closedRoundDisk R := by | |
| apply Set.Subset.antisymm | |
| Β· exact (homeomorph_mapsTo_closedRoundDisk Ξ¦ R (fun p => (hcircle p).mpr)).image_subset | |
| Β· intro p hp | |
| have hi : β q, radiusSq (Ξ¦.symm q) = R^2 β radiusSq q = R^2 := by | |
| intro q hq | |
| simpa only [Homeomorph.apply_symm_apply] using (hcircle (Ξ¦.symm q)).mpr hq | |
| exact β¨Ξ¦.symm p,homeomorph_mapsTo_closedRoundDisk Ξ¦.symm R | |
| (fun q hq => (hcircle (Ξ¦.symm q)).mp (by simpa only [Homeomorph.apply_symm_apply] using hq)) hp, | |
| Ξ¦.apply_symm_apply pβ© | |
| def backgroundDensity (g f : Plane β β) (p : β Γ Plane) : β := | |
| g p.2 + Real.smoothTransition p.1 * f p.2 | |
| theorem backgroundDensity_positive {g f : Plane β β} | |
| (hg : β x, 0 < g x) (hf : β x, 0 < g x+f x) (p : β Γ Plane) : | |
| 0 < backgroundDensity g f p := by | |
| have hb := Real.smoothTransition.nonneg p.1 | |
| have hc := Real.smoothTransition.le_one p.1 | |
| unfold backgroundDensity | |
| by_cases hx : 0 β€ f p.2 | |
| Β· exact add_pos_of_pos_of_nonneg (hg p.2) (mul_nonneg hb hx) | |
| Β· have hx' : f p.2 < 0 := lt_of_not_ge hx | |
| have hmul := mul_le_mul_of_nonpos_right hc hx'.le | |
| nlinarith [hf p.2] | |
| theorem backgroundDensity_smooth {g f : Plane β β} (hg : ContDiff β β g) (hf : ContDiff β β f) : | |
| ContDiff β β (backgroundDensity g f) := | |
| (hg.comp contDiff_snd).add ((Real.smoothTransition.contDiff.comp contDiff_fst).mul (hf.comp contDiff_snd)) | |
| def backgroundField (g f U V : Plane β β) (p : β Γ Plane) : Plane := | |
| (-(deriv Real.smoothTransition p.1) * V p.2 / backgroundDensity g f p, | |
| (deriv Real.smoothTransition p.1) * U p.2 / backgroundDensity g f p) | |
| theorem backgroundField_smooth {g f U V : Plane β β} (hg : ContDiff β β g) (hf : ContDiff β β f) | |
| (hU : ContDiff β β U) (hV : ContDiff β β V) | |
| (hgpos : β x, 0 < g x) (hpos : β x, 0 < g x+f x) : | |
| ContDiff β β (backgroundField g f U V) := by | |
| have hΞ² : ContDiff β β (deriv Real.smoothTransition) := | |
| (contDiff_infty_iff_deriv.mp Real.smoothTransition.contDiff).2 | |
| exact (((hΞ².comp contDiff_fst).neg.mul (hV.comp contDiff_snd)).div | |
| (backgroundDensity_smooth hg hf) (fun p => (backgroundDensity_positive hgpos hpos p).ne')).prodMk | |
| (((hΞ².comp contDiff_fst).mul (hU.comp contDiff_snd)).div | |
| (backgroundDensity_smooth hg hf) (fun p => (backgroundDensity_positive hgpos hpos p).ne')) | |
| theorem backgroundField_compact {g f U V : Plane β β} | |
| (hU : HasCompactSupport U) (hV : HasCompactSupport V) : HasCompactSupport (backgroundField g f U V) := by | |
| apply HasCompactSupport.intro (smoothTransition_deriv_compact.prod (hU.union hV)) | |
| intro p hp | |
| have hn : p.1 β tsupport (deriv Real.smoothTransition) β¨ p.2 β tsupport U βͺ tsupport V := by | |
| simpa only [mem_prod, not_and_or] using hp | |
| rcases hn with ht | hx | |
| Β· simp [backgroundField, image_eq_zero_of_notMem_tsupport ht] | |
| Β· have hUx : U p.2 = 0 := image_eq_zero_of_notMem_tsupport (fun h => hx (Or.inl h)) | |
| have hVx : V p.2 = 0 := image_eq_zero_of_notMem_tsupport (fun h => hx (Or.inr h)) | |
| simp [backgroundField,hUx,hVx] | |
| theorem backgroundField_transport {g f U V : Plane β β} (hg : ContDiff β β g) (hf : ContDiff β β f) | |
| (hU : ContDiff β β U) (hV : ContDiff β β V) (hgpos : β x, 0 < g x) (hpos : β x, 0 < g x+f x) | |
| (hcurl : β p, deriv (fun x => V (x,p.2)) p.1 - deriv (fun t => U (p.1,t)) p.2 = f p) | |
| (p : β Γ Plane) (v w : Plane) : | |
| fderiv β (backgroundDensity g f) p (1,backgroundField g f U V p) * planarArea v w + | |
| backgroundDensity g f p * (planarArea (fderiv β (backgroundField g f U V) p (0,v)) w + | |
| planarArea v (fderiv β (backgroundField g f U V) p (0,w))) = 0 := by | |
| let X := backgroundField g f U V | |
| let Ο := backgroundDensity g f | |
| let b := deriv Real.smoothTransition p.1 | |
| let d := fderiv β Ο p | |
| let A := (fderiv β X p).comp (ContinuousLinearMap.inr β β Plane) | |
| have hXd : Differentiable β X := (backgroundField_smooth hg hf hU hV hgpos hpos).differentiable (by simp) | |
| have hΟd : Differentiable β Ο := (backgroundDensity_smooth hg hf).differentiable (by simp) | |
| have hUd : Differentiable β U := hU.differentiable (by simp) | |
| have hVd : Differentiable β V := hV.differentiable (by simp) | |
| have hflux1 : d (0,(1,0)) * (X p).1 + Ο p * (A (1,0)).1 = | |
| -b * fderiv β V p.2 (1,0) := by | |
| have hd := (hasDerivAt_horizontal_first hΟd p).mul (hasDerivAt_horizontal_first hXd p).fst | |
| have he : (fun x => Ο (p.1,(x,p.2.2)) * (X (p.1,(x,p.2.2))).1) = | |
| fun x => -b * V (x,p.2.2) := by | |
| funext x | |
| dsimp [X,Ο,backgroundField,b] | |
| field_simp [(backgroundDensity_positive hgpos hpos (p.1,(x,p.2.2))).ne'] | |
| change HasDerivAt (fun x => Ο (p.1,(x,p.2.2)) * (X (p.1,(x,p.2.2))).1) _ p.2.1 at hd | |
| rw [he] at hd | |
| have hd' := ((hVd p.2).hasFDerivAt.comp_hasDerivAt p.2.1 | |
| ((hasDerivAt_id p.2.1).prodMk (hasDerivAt_const p.2.1 p.2.2))).const_mul (-b) | |
| exact hd.unique hd' | |
| have hflux2 : d (0,(0,1)) * (X p).2 + Ο p * (A (0,1)).2 = | |
| b * fderiv β U p.2 (0,1) := by | |
| have hd := (hasDerivAt_horizontal_second hΟd p).mul (hasDerivAt_horizontal_second hXd p).snd | |
| have he : (fun y => Ο (p.1,(p.2.1,y)) * (X (p.1,(p.2.1,y))).2) = | |
| fun y => b * U (p.2.1,y) := by | |
| funext y | |
| dsimp [X,Ο,backgroundField,b] | |
| field_simp [(backgroundDensity_positive hgpos hpos (p.1,(p.2.1,y))).ne'] | |
| change HasDerivAt (fun y => Ο (p.1,(p.2.1,y)) * (X (p.1,(p.2.1,y))).2) _ p.2.2 at hd | |
| rw [he] at hd | |
| have hd' := ((hUd p.2).hasFDerivAt.comp_hasDerivAt p.2.2 | |
| ((hasDerivAt_const p.2.2 p.2.1).prodMk (hasDerivAt_id p.2.2))).const_mul b | |
| exact hd.unique hd' | |
| have ht : d (1,(0,0)) = b * f p.2 := by | |
| have hd := (hΟd p).hasFDerivAt.comp_hasDerivAt p.1 | |
| ((hasDerivAt_id p.1).prodMk (hasDerivAt_const p.1 p.2)) | |
| have hΞ² : ContDiff β β Real.smoothTransition := Real.smoothTransition.contDiff | |
| have hb := (hΞ².differentiable (by simp) p.1).hasDerivAt | |
| have hd' := (hb.mul_const (f p.2)).const_add (g p.2) | |
| exact hd.unique hd' | |
| have hc : fderiv β V p.2 (1,0) - fderiv β U p.2 (0,1) = f p.2 := by | |
| simpa only [plane_deriv_first hVd,plane_deriv_second hUd] using hcurl p.2 | |
| have hlin : d (1,X p) = d (1,(0,0)) + (X p).1 * d (0,(1,0)) + (X p).2 * d (0,(0,1)) := by | |
| have he : ((1:β),X p) = ((1:β),(0:Plane)) + | |
| (X p).1 β’ ((0:β),((1:β),(0:β))) + (X p).2 β’ ((0:β),((0:β),(1:β))) := by | |
| ext <;> simp | |
| conv_lhs => rw [he] | |
| simp only [map_add,map_smul,smul_eq_mul] | |
| rfl | |
| have hdiv : d (1,X p) + Ο p * ((A (1,0)).1+(A (0,1)).2) = 0 := by | |
| rw [hlin] | |
| linear_combination hflux1 + hflux2 + ht - b * hc | |
| change d (1,X p) * planarArea v w + Ο p * (planarArea (A v) w + planarArea v (A w)) = 0 | |
| rw [planarArea_trace_identity] | |
| linear_combination (planarArea v w) * hdiv | |
| theorem backgroundField_tangent {g f U V : Plane β β} {R : β} | |
| (ht : β p, radiusSq p = R^2 β -p.2*U p+p.1*V p = 0) : | |
| β t p, radiusSq p = R^2 β radialDrift (backgroundField g f U V) (t,p) = 0 := by | |
| intro t p hp | |
| have he := ht p hp | |
| unfold radialDrift backgroundField | |
| dsimp only | |
| calc | |
| 2*(p.1*(-deriv Real.smoothTransition t*V p/backgroundDensity g f (t,p)) + | |
| p.2*(deriv Real.smoothTransition t*U p/backgroundDensity g f (t,p))) = | |
| (-2*deriv Real.smoothTransition t/backgroundDensity g f (t,p)) * (-p.2*U p+p.1*V p) := by ring | |
| _ = 0 := by rw [he,mul_zero] | |
| theorem exists_relative_background_moser {ΞΉ : Type*} [Fintype ΞΉ] | |
| {g f : Plane β β} (hg : ContDiff β β g) (hf : ContDiff β β f) | |
| (hfc : HasCompactSupport f) (hf0 : (β« p, f p) = 0) | |
| (hgpos : β x, 0 < g x) (hpos : β x, 0 < g x+f x) | |
| (R : ΞΉ β β) (hR : β i, 0 < R i) (hRi : Injective R) | |
| (hz : β i, (β« p in roundDisk (R i), f p) = 0) : | |
| β Ξ¦ : Plane ββ Plane, ContDiff β β Ξ¦ β§ ContDiff β β Ξ¦.symm β§ | |
| HasCompactSupport (fun x => Ξ¦ x - x) β§ | |
| (β x v w, (g (Ξ¦ x)+f (Ξ¦ x)) * planarArea (fderiv β Ξ¦ x v) (fderiv β Ξ¦ x w) = | |
| g x * planarArea v w) β§ | |
| (β i, Ξ¦ '' closedRoundDisk (R i) = closedRoundDisk (R i)) := by | |
| obtain β¨U,V,hU,hV,hUc,hVc,hcurl,htanβ© := | |
| exists_relative_planar_primitive hf hfc hf0 R hR hRi hz | |
| have hXs := backgroundField_smooth hg hf hU hV hgpos hpos | |
| have hXc := backgroundField_compact (g := g) (f := f) hUc hVc | |
| obtain β¨L,hLβ© := ContDiff.lipschitzWith_of_hasCompactSupport hXc hXs (by simp) | |
| let X : C(β Γ Plane,Plane) := β¨backgroundField g f U V,hXs.continuousβ© | |
| let K := tsupport U βͺ tsupport V | |
| have hK : IsCompact K := hUc.union hVc | |
| have hfix (t : β) (x : Plane) (hx : x β K) : X (t,x) = 0 := by | |
| have hu : U x = 0 := image_eq_zero_of_notMem_tsupport (fun h => hx (Or.inl h)) | |
| have hv : V x = 0 := image_eq_zero_of_notMem_tsupport (fun h => hx (Or.inr h)) | |
| change backgroundField g f U V (t,x) = 0 | |
| simp [backgroundField,hu,hv] | |
| obtain β¨Ξ¦,hΞ¦,hΞ¦i,_,hΞ¦c,hΞ¦area,hΞ¦circle,_β© := exists_density_transport_relative X hL hXs hXc | |
| (backgroundDensity g f) (backgroundDensity_smooth hg hf) planarArea | |
| (backgroundField_transport hg hf hU hV hgpos hpos hcurl) K hK hfix R hR | |
| (fun i => backgroundField_tangent (htan i)) 0 1 | |
| refine β¨Ξ¦,hΞ¦,hΞ¦i,hΞ¦c,?_,?_β© | |
| Β· intro x v w | |
| simpa only [zero_add,backgroundDensity,Real.smoothTransition.one,Real.smoothTransition.zero, | |
| one_mul,zero_mul,add_zero] using hΦarea x v w | |
| Β· intro i | |
| exact homeomorph_image_closedRoundDisk Φ (R i) (hΦcircle i) | |
| end | |
| section | |
| open scoped ContDiff Topology NNReal | |
| open Set Function MeasureTheory | |
| variable {P : Type} [NormedAddCommGroup P] [NormedSpace β P] | |
| def parameterSegmentLinear : (P Γ β) βL[β] C(Time,P Γ β) := | |
| LinearMap.mkContinuous { | |
| toFun := fun p => β¨fun s => (p.1,(s:β)*p.2), | |
| continuous_const.prodMk (continuous_subtype_val.mul continuous_const)β© | |
| map_add' := by intros; ext s <;> simp [mul_add] | |
| map_smul' := by intros; ext s <;> simp [mul_left_comm] } | |
| 1 (by | |
| intro p | |
| rw [one_mul] | |
| apply (ContinuousMap.norm_le _ (norm_nonneg p)).mpr | |
| intro s | |
| change β(p.1,(s:β)*p.2)β β€ βpβ | |
| simp only [Prod.norm_def,norm_mul,Real.norm_eq_abs,abs_of_nonneg s.property.1] | |
| apply max_le | |
| Β· exact le_max_left _ _ | |
| Β· exact (mul_le_of_le_one_left (abs_nonneg p.2) s.property.2).trans (le_max_right _ _)) | |
| def parameterSegmentPath (a : β) (p : P Γ β) : C(Time,P Γ β) := | |
| constantPath (0,a) + parameterSegmentLinear (p-(0,a)) | |
| @[simp] theorem parameterSegmentPath_apply (a : β) (p : P Γ β) (s : Time) : | |
| parameterSegmentPath a p s = (p.1,a+(s:β)*(p.2-a)) := by | |
| change (0+(p.1-0),a+(s:β)*(p.2-a)) = _ | |
| simp | |
| theorem parameterSegmentPath_smooth (a : β) : ContDiff β β (parameterSegmentPath (P := P) a) := | |
| contDiff_const.add ((parameterSegmentLinear (P := P)).contDiff.comp (contDiff_id.sub contDiff_const)) | |
| theorem parameter_segment_integral_eq (f : P Γ β β β) (hf : Continuous f) | |
| (a : β) (p : P Γ β) : | |
| (β« x in a..p.2, f (p.1,x)) = | |
| (p.2-a) * pathAverage ((β¨f,hfβ© : C(P Γ β,β)).comp (parameterSegmentPath a p)) := by | |
| let u := (β¨f,hfβ© : C(P Γ β,β)).comp (parameterSegmentPath a p) | |
| have he : (β« s in (0:β)..1, extendPath u s) = | |
| β« s in (0:β)..1, f (p.1,a+s*(p.2-a)) := by | |
| apply intervalIntegral.integral_congr | |
| intro s hs | |
| rw [uIcc_of_le (by norm_num : (0:β) β€ 1)] at hs | |
| rw [show extendPath u s = u β¨s,hsβ© from extendPath_coe u β¨s,hsβ©] | |
| change f (parameterSegmentPath a p β¨s,hsβ©) = _ | |
| rw [parameterSegmentPath_apply] | |
| change _ = (p.2-a) * (β« s in (0:β)..1, extendPath u s) | |
| rw [he] | |
| have hi := intervalIntegral.smul_integral_comp_add_mul (fun x => f (p.1,x)) | |
| (a := (0:β)) (b := 1) (p.2-a) a | |
| simpa only [smul_eq_mul,mul_zero,mul_one,add_zero,add_sub_cancel,mul_comm] using hi.symm | |
| variable [FiniteDimensional β P] | |
| theorem contDiff_parameter_segment_integral {f : P Γ β β β} (hf : ContDiff β β f) (a : β) : | |
| ContDiff β β (fun p : P Γ β => β« x in a..p.2, f (p.1,x)) := by | |
| have he : (fun p : P Γ β => β« x in a..p.2, f (p.1,x)) = | |
| fun p => (p.2-a)*pathAverage | |
| ((β¨f,hf.continuousβ© : C(P Γ β,β)).comp (parameterSegmentPath a p)) := by | |
| funext p | |
| exact parameter_segment_integral_eq f hf.continuous a p | |
| rw [he] | |
| exact (contDiff_snd.sub contDiff_const).mul | |
| (pathAverage.contDiff.comp ((postcomp_contDiff (K := Time) (E := P Γ β) (F := β) hf).comp (parameterSegmentPath_smooth (P := P) a))) | |
| theorem planarPrimitive_parameter_smooth {f : P Γ Plane β β} (hf : ContDiff β β f) | |
| {Ο : β β β} (hΟ : ContDiff β β Ο) (A : β) : | |
| ContDiff β β (fun p : P Γ Plane => planarPrimitiveX A (fun x => f (p.1,x)) Ο p.2) β§ | |
| ContDiff β β (fun p : P Γ Plane => planarPrimitiveY A (fun x => f (p.1,x)) Ο p.2) := by | |
| have hff : ContDiff β β (fun p : (P Γ β) Γ β => f (p.1.1,(p.2,p.1.2))) := | |
| hf.comp ((contDiff_fst.comp contDiff_fst).prodMk | |
| (contDiff_snd.prodMk (contDiff_snd.comp contDiff_fst))) | |
| have hg : ContDiff β β (fun p : P Γ β => planarMarginal A (fun x => f (p.1,x)) p.2) := | |
| (contDiff_parameter_segment_integral hff (-A)).comp (contDiff_id.prodMk contDiff_const) | |
| have hG : ContDiff β β (fun p : P Γ Plane => | |
| β« t in -A..p.2.2, planarMarginal A (fun x => f (p.1,x)) t) := | |
| (contDiff_parameter_segment_integral hg (-A)).comp | |
| (contDiff_fst.prodMk (contDiff_snd.comp contDiff_snd)) | |
| refine β¨((hΟ.comp (contDiff_fst.comp contDiff_snd)).neg.mul hG),?_β© | |
| have hF : ContDiff β β (fun p : (P Γ β) Γ β => | |
| f (p.1.1,(p.2,p.1.2)) - Ο p.2*planarMarginal A (fun x => f (p.1.1,x)) p.1.2) := | |
| hff.sub ((hΟ.comp contDiff_snd).mul (hg.comp contDiff_fst)) | |
| exact (contDiff_parameter_segment_integral hF (-A)).comp | |
| ((contDiff_fst.prodMk (contDiff_snd.comp contDiff_snd)).prodMk (contDiff_fst.comp contDiff_snd)) | |
| omit [FiniteDimensional β P] in | |
| theorem planarPrimitive_zero_outside {A : β} (hA : 0 β€ A) {f : β Γ β β β} | |
| (hf : Continuous f) {Ο : β β β} (hΟ : Continuous Ο) | |
| (hfs : β x t, A β€ |x| β¨ A β€ |t| β f (x,t) = 0) | |
| (hΟs : β x, A β€ |x| β Ο x = 0) | |
| (hΟ1 : (β« x in -A..A, Ο x) = 1) | |
| (hg : Continuous (planarMarginal A f)) | |
| (hf0 : (β« t in -A..A, planarMarginal A f t) = 0) : | |
| β p, A β€ |p.1| β¨ A β€ |p.2| β | |
| planarPrimitiveX A f Ο p = 0 β§ planarPrimitiveY A f Ο p = 0 := by | |
| have hgt (t : β) (ht : A β€ |t|) : planarMarginal A f t = 0 := by | |
| unfold planarMarginal | |
| have he : (fun x => f (x,t)) = fun _ => (0:β) := by | |
| funext x | |
| exact hfs x t (Or.inr ht) | |
| rw [he,intervalIntegral.integral_zero] | |
| have hF (t : β) : (β« x in -A..A, f (x,t) - Ο x * planarMarginal A f t) = 0 := by | |
| have hc : Continuous (fun x => f (x,t)) := hf.comp (continuous_id.prodMk continuous_const) | |
| have hd : Continuous (fun x => Ο x * planarMarginal A f t) := hΟ.mul continuous_const | |
| rw [intervalIntegral.integral_sub (hc.intervalIntegrable (-A) A) | |
| (hd.intervalIntegrable (-A) A)] | |
| rw [intervalIntegral.integral_mul_const, hΟ1, one_mul] | |
| exact sub_self _ | |
| have hzero (p : β Γ β) (hp : A β€ |p.1| β¨ A β€ |p.2|) : | |
| planarPrimitiveX A f Ο p = 0 β§ planarPrimitiveY A f Ο p = 0 := by | |
| rcases hp with hp | hp | |
| Β· constructor | |
| Β· simp [planarPrimitiveX, hΟs _ hp] | |
| Β· apply interval_primitive_zero_outside hA | |
| ((hf.comp (continuous_id.prodMk continuous_const)).sub (hΟ.mul continuous_const)) | |
| (fun x hx => by | |
| change f (x,p.2) - Ο x * planarMarginal A f p.2 = 0 | |
| rw [hfs x p.2 (Or.inl hx),hΟs x hx]; ring) (hF p.2) hp | |
| Β· constructor | |
| Β· unfold planarPrimitiveX | |
| rw [interval_primitive_zero_outside hA hg hgt hf0 hp, mul_zero] | |
| Β· unfold planarPrimitiveY | |
| have he : (fun x => f (x,p.2) - Ο x * planarMarginal A f p.2) = fun _ => (0:β) := by | |
| funext x | |
| rw [hfs x p.2 (Or.inr hp), hgt p.2 hp] | |
| ring | |
| rw [he,intervalIntegral.integral_zero] | |
| exact hzero | |
| omit [NormedSpace β P] [FiniteDimensional β P] in | |
| theorem compactSupport_fiber {Q F : Type*} [TopologicalSpace Q] [T2Space Q] | |
| [Zero F] {f : P Γ Q β F} (hc : HasCompactSupport f) (y : P) : | |
| HasCompactSupport (fun x => f (y,x)) := by | |
| apply HasCompactSupport.intro (hc.image continuous_snd) | |
| intro x hx | |
| exact image_eq_zero_of_notMem_tsupport (fun h => hx β¨(y,x),h,rflβ©) | |
| theorem exists_parametric_compact_primitive {f : P Γ Plane β β} | |
| (hf : ContDiff β β f) (hfc : HasCompactSupport f) | |
| (hf0 : β y, (β« x, f (y,x)) = 0) : | |
| β U V : P Γ Plane β β, ContDiff β β U β§ ContDiff β β V β§ | |
| HasCompactSupport U β§ HasCompactSupport V β§ | |
| (β y p, deriv (fun x => V (y,(x,p.2))) p.1 - | |
| deriv (fun t => U (y,(p.1,t))) p.2 = f (y,p)) β§ | |
| β y, (β x, f (y,x) = 0) β β x, U (y,x) = 0 β§ V (y,x) = 0 := by | |
| obtain β¨A,hA,hboundβ© := hfc.isBounded.subset_ball_lt 1 (0 : P Γ Plane) | |
| have hA0 : 0 < A := lt_trans zero_lt_one hA | |
| have hzero (y : P) (x t : β) (ht : A β€ βyβ β¨ A β€ |x| β¨ A β€ |t|) : f (y,(x,t)) = 0 := by | |
| by_contra hn | |
| have hb := hbound (subset_tsupport f (show (y,(x,t)) β support f from hn)) | |
| simp only [Metric.mem_ball,dist_zero_right,Prod.norm_def,Real.norm_eq_abs,max_lt_iff] at hb | |
| rcases ht with ht | ht | ht | |
| Β· exact (not_lt_of_ge ht) hb.1 | |
| Β· exact (not_lt_of_ge ht) hb.2.1 | |
| Β· exact (not_lt_of_ge ht) hb.2.2 | |
| let b : ContDiffBump (0 : β) := β¨A/2,A,by positivity,by linarithβ© | |
| let Ο := b.normed volume | |
| have hΟ : ContDiff β β Ο := b.contDiff_normed | |
| have hΟs (x : β) (hx : A β€ |x|) : Ο x = 0 := by | |
| by_contra hn | |
| have hb : x β support (b.normed volume) := hn | |
| rw [b.support_normed_eq] at hb | |
| have hb' : |x| < A := by simpa only [Metric.mem_ball,dist_zero_right,Real.norm_eq_abs] using hb | |
| exact (not_lt_of_ge hx) hb' | |
| have hΟ1 : (β« x in -A..A, Ο x) = 1 := by | |
| rw [integral_eq_full_of_box_support hΟs] | |
| exact b.integral_normed | |
| have hfy (y : P) : ContDiff β β (fun x => f (y,x)) := | |
| hf.comp (contDiff_const.prodMk contDiff_id) | |
| have hg (y : P) : ContDiff β β (planarMarginal A (fun x => f (y,x))) := | |
| planarMarginal_smooth (hfy y) A | |
| have hgt (y : P) (t : β) (ht : A β€ |t|) : planarMarginal A (fun x => f (y,x)) t = 0 := by | |
| unfold planarMarginal | |
| have he : (fun x => f (y,(x,t))) = fun _ => (0:β) := funext fun x => hzero y x t (Or.inr (Or.inr ht)) | |
| rw [he,intervalIntegral.integral_zero] | |
| have hgm (y : P) (t : β) : planarMarginal A (fun x => f (y,x)) t = β« x, f (y,(x,t)) := | |
| integral_eq_full_of_box_support (fun x hx => hzero y x t (Or.inr (Or.inl hx))) | |
| have hgm0 (y : P) : (β« t in -A..A, planarMarginal A (fun x => f (y,x)) t) = 0 := by | |
| rw [integral_eq_full_of_box_support (hgt y)] | |
| simp_rw [hgm] | |
| rw [β integral_prod_symm (fun x => f (y,x))] | |
| Β· exact hf0 y | |
| Β· exact (hfy y).continuous.integrable_of_hasCompactSupport (compactSupport_fiber hfc y) | |
| let U : P Γ Plane β β := fun p => planarPrimitiveX A (fun x => f (p.1,x)) Ο p.2 | |
| let V : P Γ Plane β β := fun p => planarPrimitiveY A (fun x => f (p.1,x)) Ο p.2 | |
| have huv (p : P Γ Plane) (hp : p β Metric.closedBall 0 A) : U p = 0 β§ V p = 0 := by | |
| have hp' : A < max βp.1β (max |p.2.1| |p.2.2|) := by | |
| simpa only [Metric.mem_closedBall,dist_zero_right,Prod.norm_def,Real.norm_eq_abs,not_le] using hp | |
| rcases lt_max_iff.mp hp' with hp' | hp' | |
| Β· have he : (fun x => f (p.1,x)) = fun _ => (0:β) := by | |
| funext x | |
| exact hzero p.1 x.1 x.2 (Or.inl hp'.le) | |
| change planarPrimitiveX A (fun x => f (p.1,x)) Ο p.2 = 0 β§ | |
| planarPrimitiveY A (fun x => f (p.1,x)) Ο p.2 = 0 | |
| rw [he] | |
| simp [planarPrimitiveX,planarPrimitiveY,planarMarginal] | |
| Β· apply planarPrimitive_zero_outside hA0.le (hfy p.1).continuous hΟ.continuous | |
| (fun x t ht => hzero p.1 x t (Or.inr ht)) hΟs hΟ1 (hg p.1).continuous (hgm0 p.1) p.2 | |
| exact (lt_max_iff.mp hp').imp le_of_lt le_of_lt | |
| refine β¨U,V,(planarPrimitive_parameter_smooth hf hΟ A).1, | |
| (planarPrimitive_parameter_smooth hf hΟ A).2, | |
| HasCompactSupport.intro (isCompact_closedBall 0 A) (fun p hp => (huv p hp).1), | |
| HasCompactSupport.intro (isCompact_closedBall 0 A) (fun p hp => (huv p hp).2),?_,?_β© | |
| Β· intro y p | |
| exact planarPrimitive_curl (hfy y).continuous hΟ.continuous (hg y).continuous p | |
| Β· intro y hy x | |
| have he : (fun x => f (y,x)) = fun _ => (0:β) := funext hy | |
| change planarPrimitiveX A (fun x => f (y,x)) Ο x = 0 β§ | |
| planarPrimitiveY A (fun x => f (y,x)) Ο x = 0 | |
| rw [he] | |
| simp [planarPrimitiveX,planarPrimitiveY,planarMarginal] | |
| end | |
| section | |
| open scoped ContDiff | |
| open Set Function MeasureTheory | |
| variable {P : Type} [NormedAddCommGroup P] [NormedSpace β P] [FiniteDimensional β P] | |
| theorem fixed_spatial_planar_primitive {A : β} (hA : 0<A) | |
| {f : P Γ Plane β β} (hf : ContDiff β β f) | |
| (hzero : β y x t, A β€ |x| β¨ A β€ |t| β f (y,(x,t))=0) | |
| (hmass : β y, (β« x, f (y,x))=0) : | |
| β U V : P Γ Plane β β, ContDiff β β U β§ ContDiff β β V β§ | |
| (β y x t, A β€ |x| β¨ A β€ |t| β U (y,(x,t))=0 β§ V (y,(x,t))=0) β§ | |
| (β y p, deriv (fun x => V (y,(x,p.2))) p.1 - | |
| deriv (fun t => U (y,(p.1,t))) p.2 = f (y,p)) β§ | |
| β y, (β x, f (y,x)=0) β β x, U (y,x)=0 β§ V (y,x)=0 := by | |
| let b : ContDiffBump (0 : β) := β¨A/2,A,by positivity,by linarithβ© | |
| let Ο := b.normed volume | |
| have hΟ : ContDiff β β Ο := b.contDiff_normed | |
| have hΟs (x : β) (hx : A β€ |x|) : Ο x=0 := by | |
| by_contra hn | |
| have hb : x β support (b.normed volume) := hn | |
| rw [b.support_normed_eq] at hb | |
| have hh : |x|<A := by simpa only [Metric.mem_ball,dist_zero_right,Real.norm_eq_abs] using hb | |
| exact (not_lt_of_ge hx) hh | |
| have hΟ1 : (β« x in -A..A, Ο x)=1 := by | |
| rw [integral_eq_full_of_box_support hΟs] | |
| exact b.integral_normed | |
| have hfy (y : P) : ContDiff β β (fun x => f (y,x)) := | |
| hf.comp (contDiff_const.prodMk contDiff_id) | |
| have hfc (y : P) : HasCompactSupport (fun x => f (y,x)) := by | |
| apply HasCompactSupport.intro (isCompact_closedBall (0:Plane) A) | |
| intro p hp | |
| have hh : A < max |p.1| |p.2| := by | |
| simpa only [Metric.mem_closedBall,dist_zero_right,Prod.norm_def,Real.norm_eq_abs,not_le] using hp | |
| exact hzero y p.1 p.2 ((lt_max_iff.mp hh).imp le_of_lt le_of_lt) | |
| have hg (y : P) : ContDiff β β (planarMarginal A (fun x => f (y,x))) := | |
| planarMarginal_smooth (hfy y) A | |
| have hgt (y : P) (t : β) (ht : A β€ |t|) : planarMarginal A (fun x => f (y,x)) t=0 := by | |
| unfold planarMarginal | |
| have he : (fun x => f (y,(x,t))) = fun _ => (0:β) := funext fun x => hzero y x t (Or.inr ht) | |
| rw [he,intervalIntegral.integral_zero] | |
| have hgm (y : P) (t : β) : planarMarginal A (fun x => f (y,x)) t = β« x, f (y,(x,t)) := | |
| integral_eq_full_of_box_support (fun x hx => hzero y x t (Or.inl hx)) | |
| have hgm0 (y : P) : (β« t in -A..A, planarMarginal A (fun x => f (y,x)) t)=0 := by | |
| rw [integral_eq_full_of_box_support (hgt y)] | |
| simp_rw [hgm] | |
| rw [βintegral_prod_symm (fun x => f (y,x))] | |
| Β· exact hmass y | |
| Β· exact (hfy y).continuous.integrable_of_hasCompactSupport (hfc y) | |
| let U : P Γ Plane β β := fun p => planarPrimitiveX A (fun x => f (p.1,x)) Ο p.2 | |
| let V : P Γ Plane β β := fun p => planarPrimitiveY A (fun x => f (p.1,x)) Ο p.2 | |
| refine β¨U,V,(planarPrimitive_parameter_smooth hf hΟ A).1, | |
| (planarPrimitive_parameter_smooth hf hΟ A).2,?_,?_,?_β© | |
| Β· intro y x t ht | |
| exact planarPrimitive_zero_outside hA.le (hfy y).continuous hΟ.continuous | |
| (hzero y) hΟs hΟ1 (hg y).continuous (hgm0 y) (x,t) ht | |
| Β· intro y p | |
| exact planarPrimitive_curl (hfy y).continuous hΟ.continuous (hg y).continuous p | |
| Β· intro y hy x | |
| have he : (fun x => f (y,x)) = fun _ => (0:β) := funext hy | |
| change planarPrimitiveX A (fun x => f (y,x)) Ο x=0 β§ | |
| planarPrimitiveY A (fun x => f (y,x)) Ο x=0 | |
| rw [he] | |
| simp [planarPrimitiveX,planarPrimitiveY,planarMarginal] | |
| end | |
| open scoped ContDiff | |
| variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] | |
| def euclideanExteriorOneForm (Ξ± : E β E βL[β] β) (x : E) : E βL[β] E βL[β] β := | |
| fderiv β Ξ± x - (fderiv β Ξ± x).flip | |
| theorem fderiv_clm_eval {F : Type*} [NormedAddCommGroup F] [NormedSpace β F] | |
| {g : E β E βL[β] F} {x : E} (hg : DifferentiableAt β g x) (u v : E) : | |
| fderiv β (fun y => g y v) x u = fderiv β g x u v := by | |
| rw [(hg.hasFDerivAt.clm_apply (hasFDerivAt_const v x)).fderiv] | |
| simp | |
| theorem fderiv_bilinear_eval {g : E β E βL[β] E βL[β] β} {x : E} | |
| (hg : DifferentiableAt β g x) (u v w : E) : | |
| fderiv β (fun y => g y v w) x u = fderiv β g x u v w := by | |
| rw [fderiv_clm_eval (hg.clm_apply (differentiableAt_const v)),fderiv_clm_eval hg] | |
| theorem euclideanExteriorOneForm_smooth {Ξ± : E β E βL[β] β} | |
| (hΞ± : ContDiff β β Ξ±) : ContDiff β β (euclideanExteriorOneForm Ξ±) := by | |
| have hd : ContDiff β β (fun x => fderiv β Ξ± x) := hΞ±.fderiv_right (by simp) | |
| have hflip : ContDiff β β (fun L : E βL[β] E βL[β] β => L.flip) := | |
| LinearIsometryEquiv.contDiff (π := β) (n := β) (E := E βL[β] E βL[β] β) | |
| (F := E βL[β] E βL[β] β) (ContinuousLinearMap.flipβα΅’ β E E β) | |
| have hf : ContDiff β β (fun x => (fderiv β Ξ± x).flip) := hflip.comp hd | |
| exact hd.sub hf | |
| theorem euclideanExteriorOneForm_fderiv {Ξ± : E β E βL[β] β} | |
| (hΞ± : ContDiff β β Ξ±) (x u v w : E) : | |
| fderiv β (euclideanExteriorOneForm Ξ±) x u v w = | |
| fderiv β (fderiv β Ξ±) x u v w - fderiv β (fderiv β Ξ±) x u w v := by | |
| have hd : DifferentiableAt β (fderiv β Ξ±) x := | |
| (hΞ±.fderiv_right (m := β) (by simp)).contDiffAt.differentiableAt (by simp) | |
| rw [βfderiv_bilinear_eval ((euclideanExteriorOneForm_smooth hΞ±).contDiffAt.differentiableAt (by simp))] | |
| change fderiv β ((fun y => fderiv β Ξ± y v w) - (fun y => fderiv β Ξ± y w v)) x u = _ | |
| rw [fderiv_sub (hd.clm_apply (differentiableAt_const v) |>.clm_apply (differentiableAt_const w)) | |
| (hd.clm_apply (differentiableAt_const w) |>.clm_apply (differentiableAt_const v))] | |
| simp only [sub_apply,fderiv_bilinear_eval hd] | |
| theorem euclideanExteriorOneForm_closed {Ξ± : E β E βL[β] β} | |
| (hΞ± : ContDiff β β Ξ±) (x u v w : E) : | |
| fderiv β (euclideanExteriorOneForm Ξ±) x u v w - | |
| fderiv β (euclideanExteriorOneForm Ξ±) x v u w + | |
| fderiv β (euclideanExteriorOneForm Ξ±) x w u v = 0 := by | |
| have hs := (hΞ±.contDiffAt (x := x)).isSymmSndFDerivAt (by | |
| rw [minSmoothness_of_isRCLikeNormedField] | |
| change ((2 : ββ) : WithTop ββ) β€ β(β€ : ββ) | |
| exact WithTop.coe_le_coe.mpr le_top) | |
| simp only [euclideanExteriorOneForm_fderiv hΞ±] | |
| rw [hs.eq u v,hs.eq u w,hs.eq v w] | |
| ring | |
| end PackingSufficiencySupport.Hamiltonian | |
| end | |
| end OAI | |