Download data/lean/OAI/Geometry/BallPacking/Layers/LayerAreaForm.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 29.1 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/BallPacking/Layers/LayerAreaForm.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/BallPacking/Layers/LayerAreaForm.lean
-
curl -L -o LayerAreaForm.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/BallPacking/Layers/LayerAreaForm.lean
29.1 kB
| import Mathlib | |
| import OAI.Geometry.BallPacking.Annuli.CylinderAnnularNormalization | |
| namespace OAI | |
| noncomputable section | |
| namespace PackingSufficiencySupport.Hamiltonian | |
| section | |
| open scoped ContDiff Topology | |
| open Set Function | |
| variable {ΞΉ : Type*} [Fintype ΞΉ] [DecidableEq ΞΉ] | |
| def layerHamiltonian (F H : (ΞΉ β β) β β) (Ο : β β β) (p : β Γ PlanePhase ΞΉ) : β := | |
| F (planeMoments p.2)+Ο p.1*H (planeMoments p.2) | |
| omit [DecidableEq ΞΉ] in | |
| @[fun_prop] theorem layerHamiltonian_smooth {F H : (ΞΉ β β) β β} {Ο : β β β} | |
| (hF : ContDiff β β F) (hH : ContDiff β β H) (hΟ : ContDiff β β Ο) : | |
| ContDiff β β (layerHamiltonian F H Ο) := | |
| (hF.comp (planeMoments_smooth.comp contDiff_snd)).add | |
| ((hΟ.comp contDiff_fst).mul (hH.comp (planeMoments_smooth.comp contDiff_snd))) | |
| omit [DecidableEq ΞΉ] in | |
| private theorem scalar_area_slice {L : Plane β β} {q : Plane} {c : β} | |
| (hL : DifferentiableAt β L q) (hc : HasDerivAt (fun s => L (s,q.2)) c q.1) : | |
| fderiv β L q (1,0)=c := by | |
| have hline := (hasDerivAt_id q.1).prodMk (hasDerivAt_const q.1 q.2) | |
| exact (hL.hasFDerivAt.comp_hasDerivAt q.1 hline).unique hc | |
| omit [DecidableEq ΞΉ] in | |
| theorem areaLayerForm_apply {I : Set β} (hI : IsOpen I) (hconv : Convex β I) | |
| {a : β} (ha : aβI) {β : Plane β β} | |
| (hβ : ContDiffOn β β β (I ΓΛ’ Ioo (0:β) 1)) | |
| {F H : (ΞΉ β β) β β} {Ο : β β β} | |
| (hF : ContDiff β β F) (hH : ContDiff β β H) (hΟ : ContDiff β β Ο) | |
| {p : Plane Γ PlanePhase ΞΉ} (hp : p.1βI ΓΛ’ Ioo (0:β) 1) (v w : Plane Γ PlanePhase ΞΉ) : | |
| layerForm F (areaLayerCoordinate β a Ο H) p v w=phaseArea v.2 w.2+ | |
| β p.1*(v.1.1*w.1.2-v.1.2*w.1.1)+ | |
| fderiv β (layerHamiltonian F H Ο) (p.1.1,p.2) (v.1.1,v.2)*w.1.2- | |
| v.1.2*fderiv β (layerHamiltonian F H Ο) (p.1.1,p.2) (w.1.1,w.2) := by | |
| let L := layerAreaIntegral β a | |
| let K : β Γ PlanePhase ΞΉ β β := fun q => Ο q.1*H (planeMoments q.2) | |
| have hL : DifferentiableAt β L p.1 := | |
| ((layerAreaIntegral_smooth hI hconv ha hβ).contDiffAt ((hI.prod isOpen_Ioo).mem_nhds hp)).differentiableAt (by simp) | |
| have hK : Differentiable β K := ((hΟ.comp contDiff_fst).mul | |
| (hH.comp (planeMoments_smooth.comp contDiff_snd))).differentiable (by simp) | |
| have hFs : Differentiable β (toricFunction F) := (hF.comp planeMoments_smooth).differentiable (by simp) | |
| have hpart : fderiv β L p.1 (1,0)=β p.1 := | |
| scalar_area_slice hL (layerAreaIntegral_hasDerivAt hI hconv ha hp.1 hp.2 hβ) | |
| have hfd (u : Plane Γ PlanePhase ΞΉ) : fderiv β (areaLayerCoordinate β a Ο H) p u= | |
| fderiv β L p.1 u.1+fderiv β K (p.1.1,p.2) (u.1.1,u.2) := by | |
| change fderiv β (baseCoefficient L+firstBaseCoefficient K) p u=_ | |
| have hLD : DifferentiableAt β (baseCoefficient L) p := hL.comp p differentiableAt_fst | |
| have hKD : DifferentiableAt β (firstBaseCoefficient K) p := | |
| (hK _).comp p ((differentiableAt_fst.fst).prodMk differentiableAt_snd) | |
| rw [fderiv_add hLD hKD] | |
| simp only [add_apply,baseCoefficient_fderiv_at hL,firstBaseCoefficient_fderiv_at (hK _)] | |
| have hgd (u : β Γ PlanePhase ΞΉ) : fderiv β (layerHamiltonian F H Ο) (p.1.1,p.2) u= | |
| fderiv β (toricFunction F) p.2 u.2+fderiv β K (p.1.1,p.2) u := by | |
| change fderiv β ((toricFunction F β Prod.snd)+K) (p.1.1,p.2) u=_ | |
| rw [fderiv_add ((hFs _).comp _ differentiableAt_snd) (hK _), | |
| fderiv_comp _ (hFs _) differentiableAt_snd] | |
| simp only [add_apply,ContinuousLinearMap.comp_apply,fderiv_snd] | |
| rfl | |
| rw [layerForm_apply,hfd,hfd,hgd,hgd,plane_covector_decomp (fderiv β L p.1) v.1, | |
| plane_covector_decomp (fderiv β L p.1) w.1,hpart] | |
| ring | |
| end | |
| section | |
| open scoped ContDiff Topology BigOperators | |
| open Set Function | |
| def areaHamiltonianForm {m : β} (β : Plane β β) (G : β Γ PlanePhase (Fin m) β β) | |
| (p : Plane Γ PlanePhase (Fin m)) : | |
| (Plane Γ PlanePhase (Fin m)) βL[β] (Plane Γ PlanePhase (Fin m)) βL[β] β := | |
| let ds := (ContinuousLinearMap.fst β β β).comp (ContinuousLinearMap.fst β Plane (PlanePhase (Fin m))) | |
| let dt := (ContinuousLinearMap.snd β β β).comp (ContinuousLinearMap.fst β Plane (PlanePhase (Fin m))) | |
| let c := ds.prod (ContinuousLinearMap.snd β Plane (PlanePhase (Fin m))) | |
| let Ξ² := (fderiv β G (p.1.1,p.2)).comp c | |
| phaseArea.bilinearComp (ContinuousLinearMap.snd β Plane (PlanePhase (Fin m))) | |
| (ContinuousLinearMap.snd β Plane (PlanePhase (Fin m)))+ | |
| β p.1 β’ (ds.smulRight dt-dt.smulRight ds)+Ξ².smulRight dt-dt.smulRight Ξ² | |
| @[simp] theorem areaHamiltonianForm_apply {m : β} (β : Plane β β) | |
| (G : β Γ PlanePhase (Fin m) β β) (p v w : Plane Γ PlanePhase (Fin m)) : | |
| areaHamiltonianForm β G p v w=phaseArea v.2 w.2+β p.1*(v.1.1*w.1.2-v.1.2*w.1.1)+ | |
| fderiv β G (p.1.1,p.2) (v.1.1,v.2)*w.1.2-v.1.2*fderiv β G (p.1.1,p.2) (w.1.1,w.2) := by | |
| simp [areaHamiltonianForm,ContinuousLinearMap.smulRight_apply,smul_eq_mul] | |
| theorem areaHamiltonianForm_layer {m : β} {I : Set β} (hI : IsOpen I) (hc : Convex β I) | |
| {a b : β} (ha : aβI) (hb : bβI) (hab : a<b) | |
| {β : Plane β β} (hβ : ContDiffOn β β β (I ΓΛ’ Ioo (0:β) 1)) | |
| {F H : (Fin m β β) β β} {Ο : β β β} | |
| (hF : ContDiff β β F) (hH : ContDiff β β H) (hΟ : ContDiff β β Ο) | |
| {V : Set (Fin m β β)} (hV : IsOpen (planeMoments β»ΒΉ' V)) | |
| {G : β Γ PlanePhase (Fin m) β β} | |
| (he : β sβIoo a b,β v,planeMoments vβVβG (s,v)=layerHamiltonian F H Ο (s,v)) | |
| {p : Plane Γ PlanePhase (Fin m)} | |
| (hp : pβ(Ioo a b ΓΛ’ Ioo (0:β) 1) ΓΛ’ (planeMoments β»ΒΉ' V)) : | |
| areaHamiltonianForm β G p=layerForm F (areaLayerCoordinate β a Ο H) p := by | |
| have hseg : Icc a bβI := by | |
| simpa only [segment_eq_uIcc,uIcc_of_le hab.le] using hc.segment_subset ha hb | |
| have hgerm : G =αΆ [nhds (p.1.1,p.2)] layerHamiltonian F H Ο := by | |
| filter_upwards [(isOpen_Ioo.prod hV).mem_nhds β¨hp.1.1,hp.2β©] with q hq | |
| exact he q.1 hq.1 q.2 hq.2 | |
| apply ContinuousLinearMap.ext | |
| intro v | |
| apply ContinuousLinearMap.ext | |
| intro w | |
| rw [areaHamiltonianForm_apply,areaLayerForm_apply hI hc ha hβ hF hH hΟ | |
| β¨hseg β¨hp.1.1.1.le,hp.1.1.2.leβ©,hp.1.2β©,hgerm.fderiv_eq] | |
| theorem finite_area_layer_packing {m : β} {ΞΉ : Type*} | |
| {I : Set β} (hI : IsOpen I) (hc : Convex β I) | |
| {β : Plane β β} (hβ : ContDiffOn β β β (I ΓΛ’ Ioo (0:β) 1)) | |
| (hpos : β qβI ΓΛ’ Ioo (0:β) 1,0<β q) | |
| (F H : ΞΉ β (Fin m β β) β β) (Ο : ΞΉ β β β β) | |
| (hF : β i,ContDiff β β (F i)) (hH : β i,ContDiff β β (H i)) | |
| (hΟ : β i,ContDiff β β (Ο i)) (hΟpos : β i s,0β€deriv (Ο i) s) | |
| {V : Set (Fin m β β)} (hV : IsOpen (planeMoments β»ΒΉ' V)) | |
| (hHp : β i p,pβVβ0β€H i p) | |
| (a b r r' : ΞΉ β β) (ha : β i,a iβI) (hb : β i,b iβI) (hab : β i,a i<b i) | |
| (hΟa : β i,Ο i (a i)=0) (hΟb : β i,Ο i (b i)=1) | |
| (hdis : Pairwise (fun i j => Disjoint (Ioo (a i) (b i)) (Ioo (a j) (b j)))) | |
| (hr' : β i,0β€r' i) (hrr : β i,r' i<r i) | |
| (hsimplex : β i,β p : Fin m β β,(β j,0β€p j)β(β j,p j)β€r' iβpβV) | |
| (hheight : β i,β p : Fin m β β,(β j,0β€p j) β pβV β r i - (β j,p j) β€ H i p) | |
| (G : β Γ PlanePhase (Fin m) β β) | |
| (he : β i,β sβIoo (a i) (b i),β v,planeMoments vβVβ | |
| G (s,v)=layerHamiltonian (F i) (H i) (Ο i) (s,v)) : | |
| β (U : ΞΉ β Set (Ambient (m+1))) (Ο : ΞΉ β Ambient (m+1) β Plane Γ PlanePhase (Fin m)), | |
| (β i,IsOpen (U i)) β§ (β i,closedBall (m+1) (r' i)βU i) β§ | |
| (β i,ContDiffOn β β (Ο i) (U i)) β§ | |
| (β i,Topology.IsEmbedding (fun z : U i => Ο i z)) β§ | |
| (β i,β zβU i,Ο i zβ(Ioo (a i) (b i) ΓΛ’ Ioo (0:β) 1) ΓΛ’ (planeMoments β»ΒΉ' V)) β§ | |
| (β i,β zβU i,β v w,areaHamiltonianForm β G (Ο i z) | |
| (fderiv β (Ο i) z v) (fderiv β (Ο i) z w)=standardForm v w) β§ | |
| Pairwise (fun i j => Disjoint (Ο i '' closedBall (m+1) (r' i)) | |
| (Ο j '' closedBall (m+1) (r' j))) := by | |
| have hd i := areaLayerCoordinate_data hI hc (ha i) (hb i) (hab i) hβ hpos | |
| (hΟ i) (hΟpos i) (hΟa i) (hΟb i) (hH i) (hHp i) | |
| exact finite_layer_packing_local F H (fun i => areaLayerCoordinate β (a i) (Ο i) (H i)) | |
| hF hV a b r r' hab (fun i => (hd i).1) hdis (fun i => (hd i).2.1) | |
| (fun i => (hd i).2.2.1) (fun i => (hd i).2.2.2) hr' hrr hsimplex hheight | |
| (areaHamiltonianForm β G) (fun i _ hp => areaHamiltonianForm_layer hI hc (ha i) (hb i) | |
| (hab i) hβ (hF i) (hH i) (hΟ i) hV (he i) hp) | |
| end | |
| section | |
| open scoped ContDiff Topology | |
| open Set Function | |
| theorem normalizedAreaDensity_smooth {I J : Set β} (hI : IsOpen I) (hJ : IsOpen J) | |
| {A B : Plane β β} (hA : ContDiffOn β β A (I ΓΛ’ J)) (hB : ContDiffOn β β B (I ΓΛ’ J)) | |
| {g : β β β} (hg : ContDiffOn β β g (Ioo (0:β) 1)) | |
| (hmap : MapsTo g (Ioo (0:β) 1) J) : | |
| ContDiffOn β β (normalizedAreaDensity A B g) (I ΓΛ’ Ioo (0:β) 1) := by | |
| have hq : ContDiffOn β β (fun q : Plane => (q.1,g q.2)) (I ΓΛ’ Ioo (0:β) 1) := | |
| contDiffOn_fst.prodMk (hg.comp contDiffOn_snd (fun _ h => h.2)) | |
| have hqm : MapsTo (fun q : Plane => (q.1,g q.2)) (I ΓΛ’ Ioo (0:β) 1) (I ΓΛ’ J) := | |
| fun _ h => β¨h.1,hmap h.2β© | |
| exact ((((hB.fderiv_of_isOpen (hI.prod hJ) (by simp)).comp hq hqm).clm_apply contDiffOn_const).sub | |
| (((hA.fderiv_of_isOpen (hI.prod hJ) (by simp)).comp hq hqm).clm_apply contDiffOn_const)).mul | |
| ((hg.deriv_of_isOpen isOpen_Ioo (by simp)).comp contDiffOn_snd (fun _ h => h.2)) | |
| theorem normalizedAreaDensity_pos {I J : Set β} {A B : Plane β β} {g : β β β} | |
| (hmap : MapsTo g (Ioo (0:β) 1) J) (hg : β TβIoo (0:β) 1,0<deriv g T) | |
| (hbase : β qβI ΓΛ’ J,0<fderiv β B q (1,0)-fderiv β A q (0,1)) | |
| {q : Plane} (hq : qβI ΓΛ’ Ioo (0:β) 1) : 0<normalizedAreaDensity A B g q := | |
| mul_pos (hbase _ β¨hq.1,hmap hq.2β©) (hg _ hq.2) | |
| theorem exists_normalized_positive_area {b : β} (hb : 0<b) (hsmall : b<1/2) | |
| {I : Set β} (hI : IsOpen I) {A B : Plane β β} | |
| (hA : ContDiffOn β β A (I ΓΛ’ Ioo (1/2-b) (1/2+b))) | |
| (hB : ContDiffOn β β B (I ΓΛ’ Ioo (1/2-b) (1/2+b))) | |
| (hbase : β qβI ΓΛ’ Ioo (1/2-b) (1/2+b),0<fderiv β B q (1,0)-fderiv β A q (0,1)) : | |
| β g : β β β,ContDiffOn β β g (Ioo (0:β) 1) β§ | |
| MapsTo g (Ioo (0:β) 1) (Ioo (1/2-b) (1/2+b)) β§ | |
| (β tβIoo (1/2-b) (1/2+b),g (intervalClock (-b) b (t-1/2))=t) β§ | |
| (β TβIoo (0:β) 1,intervalClock (-b) b (g T-1/2)=T) β§ | |
| (β TβIoo (0:β) 1,positiveCircleClock b (circleTurn (g T))*deriv g T=1) β§ | |
| ContDiffOn β β (normalizedAreaDensity A B g) (I ΓΛ’ Ioo (0:β) 1) β§ | |
| (β qβI ΓΛ’ Ioo (0:β) 1,0<normalizedAreaDensity A B g q) := by | |
| obtain β¨g,hg,hm,hl,hr,hdβ© := positiveCircleClock_inverse hb hsmall | |
| refine β¨g,hg,fun _ h => hm _ h,hl,hr,fun T hT => (hd T hT).2, | |
| normalizedAreaDensity_smooth hI isOpen_Ioo hA hB hg (fun _ h => hm _ h),?_β© | |
| intro q hq | |
| exact normalizedAreaDensity_pos (fun _ h => hm _ h) (fun T hT => (hd T hT).1) hbase hq | |
| end | |
| section | |
| open scoped ContDiff Topology | |
| open Set Function | |
| variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] | |
| theorem angularReparam_smoothOn {g : β β β} {J : Set β} (hg : ContDiffOn β β g J) | |
| {U : Set (Plane Γ E)} (hU : β pβU,p.1.2βJ) : ContDiffOn β β (angularReparam g) U := | |
| ((contDiff_fst.comp contDiff_fst).contDiffOn.prodMk | |
| (hg.comp (contDiff_snd.comp contDiff_fst).contDiffOn hU)).prodMk contDiff_snd.contDiffOn | |
| theorem angularReparam_isEmbedding {g C : β β β} {J : Set β} | |
| (hg : ContDiffOn β β g J) (hC : Continuous C) (hinv : β TβJ,C (g T)=T) | |
| {U : Set (Plane Γ E)} (hU : β pβU,p.1.2βJ) : | |
| Topology.IsEmbedding (fun p : U => angularReparam g p.val) := by | |
| have hs : Continuous (fun p : U => angularReparam g p.val) := | |
| (angularReparam_smoothOn hg hU).continuousOn.domRestrict | |
| have hCs : Continuous (angularReparam (E := E) C) := | |
| (continuous_fst.fst.prodMk (hC.comp continuous_fst.snd)).prodMk continuous_snd | |
| have he : angularReparam (E := E) C β (fun p : U => angularReparam g p.val)=Subtype.val := by | |
| funext p | |
| change ((p.val.1.1,C (g p.val.1.2)),p.val.2)=p.val | |
| rw [hinv _ (hU _ p.property)] | |
| apply Topology.IsEmbedding.of_comp hs hCs | |
| rw [he] | |
| exact Topology.IsEmbedding.subtypeVal | |
| omit [NormedAddCommGroup E] [NormedSpace β E] in | |
| theorem angularReparam_injOn {g C : β β β} {J : Set β} | |
| (hinv : β TβJ,C (g T)=T) {U : Set (Plane Γ E)} (hU : β pβU,p.1.2βJ) : | |
| InjOn (angularReparam g) U := by | |
| intro p hp q hq he | |
| have hh := congrArg (angularReparam (E := E) C) he | |
| change ((p.1.1,C (g p.1.2)),p.2)=((q.1.1,C (g q.1.2)),q.2) at hh | |
| simpa only [hinv _ (hU _ hp),hinv _ (hU _ hq)] using hh | |
| end | |
| section | |
| open scoped ContDiff Topology BigOperators | |
| open Set Function | |
| theorem angular_packing_transport {m : β} {ΞΉ : Type*} {I J : Set β} | |
| (hI : IsOpen I) (hJ : IsOpen J) {A B : Plane β β} | |
| (hA : ContDiffOn β β A (I ΓΛ’ J)) (hB : ContDiffOn β β B (I ΓΛ’ J)) | |
| {w g C : β β β} (hw : ContDiff β β w) (hg : ContDiffOn β β g (Ioo (0:β) 1)) | |
| (hmap : MapsTo g (Ioo (0:β) 1) J) (hC : Continuous C) | |
| (hinv : β TβIoo (0:β) 1,C (g T)=T) | |
| (hnorm : β TβIoo (0:β) 1,w (g T)*deriv g T=1) | |
| {G : β Γ PlanePhase (Fin m) β β} (hG : ContDiff β β G) | |
| (a b r : ΞΉ β β) (ha : β i,Ioo (a i) (b i)βI) {V : Set (Fin m β β)} | |
| (U : ΞΉ β Set (Ambient (m+1))) (Ο : ΞΉ β Ambient (m+1) β Plane Γ PlanePhase (Fin m)) | |
| (hU : β i,IsOpen (U i)) (hBU : β i,closedBall (m+1) (r i)βU i) | |
| (hΟ : β i,ContDiffOn β β (Ο i) (U i)) | |
| (hemb : β i,Topology.IsEmbedding (fun z : U i => Ο i z)) | |
| (him : β i,β zβU i,Ο i zβ(Ioo (a i) (b i) ΓΛ’ Ioo (0:β) 1) ΓΛ’ (planeMoments β»ΒΉ' V)) | |
| (hform : β i,β zβU i,β v u, | |
| areaHamiltonianForm (normalizedAreaDensity A B g) G (Ο i z) | |
| (fderiv β (Ο i) z v) (fderiv β (Ο i) z u)=standardForm v u) | |
| (hdis : Pairwise (fun i j => Disjoint (Ο i '' closedBall (m+1) (r i)) | |
| (Ο j '' closedBall (m+1) (r j)))) : | |
| β Ο : ΞΉ β Ambient (m+1) β Plane Γ PlanePhase (Fin m), | |
| (β i,ContDiffOn β β (Ο i) (U i)) β§ | |
| (β i,Topology.IsEmbedding (fun z : U i => Ο i z)) β§ | |
| (β i,β zβU i,Ο i zβ(Ioo (a i) (b i) ΓΛ’ J) ΓΛ’ (planeMoments β»ΒΉ' V)) β§ | |
| (β i,β zβU i,β v u, | |
| horizontalCoupling phaseArea (baseCoefficient A) (weightedSecondCoefficient B (fun q => w q.2) G) | |
| (Ο i z) (fderiv β (Ο i) z v) (fderiv β (Ο i) z u)=standardForm v u) β§ | |
| Pairwise (fun i j => Disjoint (Ο i '' closedBall (m+1) (r i)) | |
| (Ο j '' closedBall (m+1) (r j))) := by | |
| let S : Set (Plane Γ PlanePhase (Fin m)) := (I ΓΛ’ Ioo (0:β) 1) ΓΛ’ (Set.univ : Set (PlanePhase (Fin m))) | |
| have hS : IsOpen S := (hI.prod isOpen_Ioo).prod isOpen_univ | |
| have hmS : β i,MapsTo (Ο i) (U i) S := fun i z hz => | |
| β¨β¨ha i (him i z hz).1.1,(him i z hz).1.2β©,mem_univ _β© | |
| have hgs : ContDiffOn β β (angularReparam g) S := angularReparam_smoothOn hg (fun _ h => h.1.2) | |
| let Ο : ΞΉ β Ambient (m+1) β Plane Γ PlanePhase (Fin m) := fun i => angularReparam g β Ο i | |
| have hΟ : β i,ContDiffOn β β (Ο i) (U i) := fun i => hgs.comp (hΟ i) (hmS i) | |
| have hCs : Continuous (angularReparam (E := PlanePhase (Fin m)) C) := | |
| (continuous_fst.fst.prodMk (hC.comp continuous_fst.snd)).prodMk continuous_snd | |
| refine β¨Ο,hΟ,?_,?_,?_,?_β© | |
| Β· intro i | |
| have he : angularReparam (E := PlanePhase (Fin m)) C β (fun z : U i => Ο i z)= | |
| (fun z : U i => Ο i z) := by | |
| funext z | |
| change (((Ο i z).1.1,C (g (Ο i z).1.2)),(Ο i z).2)=Ο i z | |
| rw [hinv _ (him i z z.property).1.2] | |
| apply Topology.IsEmbedding.of_comp (hΟ i).continuousOn.domRestrict hCs | |
| change Topology.IsEmbedding (angularReparam C β (fun z : U i => Ο i z)) | |
| rw [he] | |
| exact hemb i | |
| Β· intro i z hz | |
| exact β¨β¨(him i z hz).1.1,hmap (him i z hz).1.2β©,(him i z hz).2β© | |
| Β· intro i z hz v u | |
| have hp := hmS i hz | |
| have hq : ((Ο i z).1.1,g (Ο i z).1.2)βI ΓΛ’ J := β¨hp.1.1,hmap hp.1.2β© | |
| have hgd := (hg.contDiffAt (isOpen_Ioo.mem_nhds hp.1.2)).differentiableAt (by simp) | |
| have hΟd : fderiv β (Ο i) z= | |
| (fderiv β (angularReparam g) (Ο i z)).comp (fderiv β (Ο i) z) := | |
| fderiv_comp z ((hgs.contDiffAt (hS.mem_nhds hp)).differentiableAt (by simp)) | |
| (((hΟ i).contDiffAt ((hU i).mem_nhds hz)).differentiableAt (by simp)) | |
| rw [hΟd] | |
| simp only [ContinuousLinearMap.comp_apply] | |
| dsimp only [Ο,Function.comp_apply] | |
| rw [angularReparam_weighted_pullback phaseArea | |
| ((hA.contDiffAt ((hI.prod hJ).mem_nhds hq)).differentiableAt (by simp)) | |
| ((hB.contDiffAt ((hI.prod hJ).mem_nhds hq)).differentiableAt (by simp)) | |
| (hw.differentiable (by simp) _) hgd (hG.differentiable (by simp) _) (hnorm _ hp.1.2)] | |
| simpa only [areaHamiltonianForm_apply] using hform i z hz v u | |
| Β· intro i j hij | |
| rw [show Ο i=angularReparam g β Ο i from rfl,show Ο j=angularReparam g β Ο j from rfl, | |
| Set.image_comp,Set.image_comp] | |
| apply (hdis hij).image (angularReparam_injOn hinv (fun _ hp => hp.1.2) (U := S)) | |
| Β· rintro _ β¨z,hz,rflβ© | |
| exact hmS i (hBU i hz) | |
| Β· rintro _ β¨z,hz,rflβ© | |
| exact hmS j (hBU j hz) | |
| theorem finite_weighted_layer_packing {m : β} {ΞΉ : Type*} | |
| {Ξ΄ : β} (hΞ΄ : 0<Ξ΄) (hsmall : Ξ΄<1/2) | |
| {I : Set β} (hI : IsOpen I) (hc : Convex β I) {A B : Plane β β} | |
| (hA : ContDiffOn β β A (I ΓΛ’ Ioo (1/2-Ξ΄) (1/2+Ξ΄))) | |
| (hB : ContDiffOn β β B (I ΓΛ’ Ioo (1/2-Ξ΄) (1/2+Ξ΄))) | |
| (hbase : β qβI ΓΛ’ Ioo (1/2-Ξ΄) (1/2+Ξ΄),0<fderiv β B q (1,0)-fderiv β A q (0,1)) | |
| (F H : ΞΉ β (Fin m β β) β β) (Ο : ΞΉ β β β β) | |
| (hF : β i,ContDiff β β (F i)) (hH : β i,ContDiff β β (H i)) | |
| (hΟ : β i,ContDiff β β (Ο i)) (hΟpos : β i s,0β€deriv (Ο i) s) | |
| {V : Set (Fin m β β)} (hV : IsOpen (planeMoments β»ΒΉ' V)) | |
| (hHp : β i p,pβVβ0β€H i p) | |
| (a b r r' : ΞΉ β β) (ha : β i,a iβI) (hb : β i,b iβI) (hab : β i,a i<b i) | |
| (hΟa : β i,Ο i (a i)=0) (hΟb : β i,Ο i (b i)=1) | |
| (hdis : Pairwise (fun i j => Disjoint (Ioo (a i) (b i)) (Ioo (a j) (b j)))) | |
| (hr' : β i,0β€r' i) (hrr : β i,r' i<r i) | |
| (hsimplex : β i,β p : Fin m β β,(β j,0β€p j) β (β j,p j)β€r' i β pβV) | |
| (hheight : β i,β p : Fin m β β,(β j,0β€p j) β pβV β r i - (β j,p j) β€ H i p) | |
| (G : β Γ PlanePhase (Fin m) β β) (hG : ContDiff β β G) | |
| (he : β i,β sβIoo (a i) (b i),β v,planeMoments vβV β | |
| G (s,v)=layerHamiltonian (F i) (H i) (Ο i) (s,v)) : | |
| β (U : ΞΉ β Set (Ambient (m+1))) (Ο : ΞΉ β Ambient (m+1) β Plane Γ PlanePhase (Fin m)), | |
| (β i,IsOpen (U i)) β§ (β i,closedBall (m+1) (r' i)βU i) β§ | |
| (β i,ContDiffOn β β (Ο i) (U i)) β§ | |
| (β i,Topology.IsEmbedding (fun z : U i => Ο i z)) β§ | |
| (β i,β zβU i,Ο i zβ(Ioo (a i) (b i) ΓΛ’ Ioo (1/2-Ξ΄) (1/2+Ξ΄)) ΓΛ’ (planeMoments β»ΒΉ' V)) β§ | |
| (β i,β zβU i,β v u, | |
| horizontalCoupling phaseArea (baseCoefficient A) | |
| (weightedSecondCoefficient B (fun q => positiveCircleClock Ξ΄ (circleTurn q.2)) G) | |
| (Ο i z) (fderiv β (Ο i) z v) (fderiv β (Ο i) z u)=standardForm v u) β§ | |
| Pairwise (fun i j => Disjoint (Ο i '' closedBall (m+1) (r' i)) | |
| (Ο j '' closedBall (m+1) (r' j))) := by | |
| obtain β¨g,hg,hm,_,hinv,hnorm,hβ,hposβ© := exists_normalized_positive_area hΞ΄ hsmall hI hA hB hbase | |
| obtain β¨U,Ο,hU,hBU,hΟ,hemb,him,hform,hdiβ© := finite_area_layer_packing hI hc hβ hpos F H Ο | |
| hF hH hΟ hΟpos hV hHp a b r r' ha hb hab hΟa hΟb hdis hr' hrr hsimplex hheight G he | |
| have hw : ContDiff β β (fun t => positiveCircleClock Ξ΄ (circleTurn t)) := | |
| ((positiveCircleClock_smooth hΞ΄ hsmall).comp circleTurn_smooth).contDiff | |
| have hC : Continuous (fun t => intervalClock (-Ξ΄) Ξ΄ (t-1/2)) := | |
| (intervalClock_smooth (-Ξ΄) Ξ΄).continuous.comp (continuous_id.sub continuous_const) | |
| have hasub : β i,Ioo (a i) (b i)βI := by | |
| intro i | |
| have hseg : Icc (a i) (b i)βI := by | |
| simpa only [segment_eq_uIcc,uIcc_of_le (hab i).le] using hc.segment_subset (ha i) (hb i) | |
| exact Ioo_subset_Icc_self.trans hseg | |
| obtain β¨Ο,hΟ,heΟ,hiΟ,hfΟ,hdΟβ© := angular_packing_transport hI isOpen_Ioo hA hB hw hg hm hC | |
| hinv hnorm hG a b r' hasub U Ο hU hBU hΟ hemb him hform hdi | |
| exact β¨U,Ο,hU,hBU,hΟ,heΟ,hiΟ,hfΟ,hdΟβ© | |
| end | |
| section | |
| open scoped ContDiff | |
| open Set Function | |
| variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] | |
| variable {ΞΉ : Type*} [Fintype ΞΉ] | |
| def surfaceRemainder (K H : E β β) (h : ΞΉ β E β β) (Ο : E β E) (v : E) : β := | |
| K (Ο v)-K v+H v-β i, h i v | |
| @[fun_prop] theorem surfaceRemainder_smooth {K H : E β β} {h : ΞΉ β E β β} {Ο : E β E} | |
| (hK : ContDiff β β K) (hH : ContDiff β β H) (hh : β i, ContDiff β β (h i)) | |
| (hΟ : ContDiff β β Ο) : ContDiff β β (surfaceRemainder K H h Ο) := by | |
| exact ((hK.comp hΟ).sub hK |>.add hH).sub (ContDiff.sum (fun i _ => hh i)) | |
| omit [NormedAddCommGroup E] [NormedSpace β E] in | |
| theorem surfaceRemainder_gap {K H Hβ C : E β β} {h : ΞΉ β E β β} {Ο : E β E} | |
| {g Ξ΅ : β} {v : E} (hgap : g β€ K (Ο v)-K v+Hβ v-C v) | |
| (harea : |H v-Hβ v| < 2*Ξ΅) (hcap : (β i, h i v)-C v < Ξ΅) : | |
| g-3*Ξ΅ < surfaceRemainder K H h Ο v := by | |
| have ha := (abs_lt.mp harea).1 | |
| dsimp [surfaceRemainder] | |
| linarith | |
| def surfaceFirstLayer (S : β β β) (H : E β β) (Ο : E β E) (p : β Γ E) : β := | |
| S p.1*H (Ο p.2) | |
| def surfaceFinalLayer (J : E β β) (h : ΞΉ β E β β) (R : E β β) | |
| (Ο : ΞΉ β β β β) (Οβ : β β β) (p : β Γ E) : β := | |
| J p.2+(β i, Ο i p.1*h i p.2)+Οβ p.1*R p.2 | |
| @[fun_prop] theorem surfaceFirstLayer_smooth {S : β β β} {H : E β β} {Ο : E β E} | |
| (hS : ContDiff β β S) (hH : ContDiff β β H) (hΟ : ContDiff β β Ο) : | |
| ContDiff β β (surfaceFirstLayer S H Ο) := | |
| (hS.comp contDiff_fst).mul ((hH.comp hΟ).comp contDiff_snd) | |
| @[fun_prop] theorem surfaceFinalLayer_smooth {J R : E β β} {h : ΞΉ β E β β} | |
| {Ο : ΞΉ β β β β} {Οβ : β β β} (hJ : ContDiff β β J) (hR : ContDiff β β R) | |
| (hh : β i, ContDiff β β (h i)) (hΟ : β i, ContDiff β β (Ο i)) | |
| (hΟβ : ContDiff β β Οβ) : ContDiff β β (surfaceFinalLayer J h R Ο Οβ) := | |
| ((hJ.comp contDiff_snd).add (ContDiff.sum (fun i _ => | |
| (hΟ i |>.comp contDiff_fst).mul (hh i |>.comp contDiff_snd)))).add | |
| ((hΟβ.comp contDiff_fst).mul (hR.comp contDiff_snd)) | |
| theorem first_partial_eq_deriv {F : β Γ E β β} {p : β Γ E} | |
| (hF : DifferentiableAt β F p) : | |
| fderiv β F p (1,0)=deriv (fun s => F (s,p.2)) p.1 := by | |
| exact (hF.hasFDerivAt.comp_hasDerivAt p.1 | |
| ((hasDerivAt_id p.1).prodMk (hasDerivAt_const p.1 p.2))).deriv.symm | |
| theorem surfaceFirstLayer_firstDerivative {S : β β β} {H : E β β} {Ο : E β E} | |
| (hS : ContDiff β β S) (hH : ContDiff β β H) (hΟ : ContDiff β β Ο) (p : β Γ E) : | |
| fderiv β (surfaceFirstLayer S H Ο) p (1,0)=deriv S p.1*H (Ο p.2) := by | |
| rw [first_partial_eq_deriv ((surfaceFirstLayer_smooth hS hH hΟ).differentiable (by simp) p)] | |
| simpa only [surfaceFirstLayer] using ((hS.differentiable (by simp) p.1).hasDerivAt.mul_const (H (Ο p.2))).deriv | |
| theorem surfaceFinalLayer_firstDerivative {J R : E β β} {h : ΞΉ β E β β} | |
| {Ο : ΞΉ β β β β} {Οβ : β β β} (hJ : ContDiff β β J) (hR : ContDiff β β R) | |
| (hh : β i, ContDiff β β (h i)) (hΟ : β i, ContDiff β β (Ο i)) | |
| (hΟβ : ContDiff β β Οβ) (p : β Γ E) : | |
| fderiv β (surfaceFinalLayer J h R Ο Οβ) p (1,0)= | |
| (β i, deriv (Ο i) p.1*h i p.2)+deriv Οβ p.1*R p.2 := by | |
| rw [first_partial_eq_deriv ((surfaceFinalLayer_smooth hJ hR hh hΟ hΟβ).differentiable (by simp) p)] | |
| have hd := ((hasDerivAt_const p.1 (J p.2)).add | |
| (HasDerivAt.sum (u := Finset.univ) (fun i _ => (hΟ i |>.differentiable (by simp) p.1).hasDerivAt.mul_const (h i p.2)))).add | |
| ((hΟβ.differentiable (by simp) p.1).hasDerivAt.mul_const (R p.2)) | |
| have he : (((fun _ : β => J p.2) + β i, fun s => Ο i s*h i p.2) + | |
| fun s => Οβ s*R p.2) = fun s => surfaceFinalLayer J h R Ο Οβ (s,p.2) := by | |
| funext s | |
| simp [surfaceFinalLayer] | |
| rw [he] at hd | |
| simpa only [zero_add] using hd.deriv | |
| theorem surfaceFinalLayer_firstDerivative_nonneg {J R : E β β} {h : ΞΉ β E β β} | |
| {Ο : ΞΉ β β β β} {Οβ : β β β} (hJ : ContDiff β β J) (hR : ContDiff β β R) | |
| (hh : β i, ContDiff β β (h i)) (hΟ : β i, ContDiff β β (Ο i)) | |
| (hΟβ : ContDiff β β Οβ) (hm : β i, Monotone (Ο i)) (hmβ : Monotone Οβ) | |
| (p : β Γ E) (hpos : β i, 0 β€ h i p.2) (hRpos : 0 β€ R p.2) : | |
| 0 β€ fderiv β (surfaceFinalLayer J h R Ο Οβ) p (1,0) := by | |
| rw [surfaceFinalLayer_firstDerivative hJ hR hh hΟ hΟβ] | |
| exact add_nonneg (Finset.sum_nonneg (fun i _ => mul_nonneg (hm i |>.deriv_nonneg) (hpos i))) | |
| (mul_nonneg hmβ.deriv_nonneg hRpos) | |
| omit [NormedAddCommGroup E] [NormedSpace β E] in | |
| theorem surfaceFinalLayer_lower {J R : E β β} {h : ΞΉ β E β β} | |
| {Ο : ΞΉ β β β β} {Οβ : β β β} {s : β} (hz : β i, Ο i s=0) (hzβ : Οβ s=0) (v : E) : | |
| surfaceFinalLayer J h R Ο Οβ (s,v)=J v := by simp [surfaceFinalLayer,hz,hzβ] | |
| omit [NormedAddCommGroup E] [NormedSpace β E] in | |
| theorem surfaceFinalLayer_upper {K H : E β β} {h : ΞΉ β E β β} {Ο : E β E} | |
| {Ο : ΞΉ β β β β} {Οβ : β β β} {s : β} (ho : β i, Ο i s=1) (hoβ : Οβ s=1) (v : E) : | |
| surfaceFinalLayer (K-H) h (surfaceRemainder K H h Ο) Ο Οβ (s,v)=K (Ο v) := by | |
| simp only [surfaceFinalLayer,surfaceRemainder,ho,hoβ,Pi.sub_apply,one_mul] | |
| ring | |
| end | |
| open scoped ContDiff | |
| open Set Function | |
| theorem surfaceFinalLayer_on_ordered_interval {N : β} {E : Type*} | |
| (J R : E β β) (h : Fin N β E β β) | |
| {lo hi : Fin (N+1) β β} {Ο : Fin (N+1) β β β β} | |
| (hord : β i j, i < j β hi i < lo j) | |
| (hends : β i, (β s, s β€ lo i β Ο i s=0) β§ (β s, hi i β€ s β Ο i s=1)) | |
| (i : Fin N) {s : β} (hs : s β Icc (lo i.castSucc) (hi i.castSucc)) (v : E) : | |
| surfaceFinalLayer J h R (fun j => Ο j.castSucc) (Ο (Fin.last N)) (s,v)= | |
| J v+(β j β Finset.univ.filter (fun j : Fin N => j < i), h j v)+Ο i.castSucc s*h i v := by | |
| classical | |
| have hlast : Ο (Fin.last N) s=0 := (hends _).1 s (hs.2.trans (hord _ _ (by simp)).le) | |
| have he (j : Fin N) : Ο j.castSucc s*h j v = | |
| (if j < i then h j v else 0)+(if j=i then Ο i.castSucc s*h i v else 0) := by | |
| rcases lt_trichotomy j i with hj | hj | hj | |
| Β· have hr : Ο j.castSucc s=1 := (hends _).2 s ((hord _ _ (by simpa using hj)).le.trans hs.1) | |
| simp [hj,ne_of_lt hj,hr] | |
| Β· subst j | |
| simp | |
| Β· have hr : Ο j.castSucc s=0 := (hends _).1 s (hs.2.trans (hord _ _ (by simpa using hj)).le) | |
| simp [not_lt.mpr hj.le,ne_of_gt hj,hr] | |
| unfold surfaceFinalLayer | |
| rw [hlast,zero_mul,add_zero] | |
| rw [Finset.sum_congr rfl (fun j (_ : j β (Finset.univ : Finset (Fin N))) => he j)] | |
| simp only [Finset.sum_add_distrib] | |
| rw [β Finset.sum_filter] | |
| simp | |
| ring | |
| theorem exists_surface_layer_clocks (N : β) {a b : β} (hab : a < b) : | |
| β lo hi : Fin (N+1) β β, β Ο : Fin (N+1) β β β β, | |
| (β i, a<lo i β§ lo i<hi i β§ hi i<b) β§ | |
| (β i j, i < j β hi i < lo j) β§ | |
| (β i, ContDiff β β (Ο i) β§ Monotone (Ο i)) β§ | |
| (β i s, 0 β€ Ο i s β§ Ο i s β€ 1 β§ 0 β€ deriv (Ο i) s) β§ | |
| (β i, β Ξ΄ : β, 0<Ξ΄ β§ | |
| (β s, s β€ lo i+Ξ΄ β Ο i s=0) β§ (β s, hi i-Ξ΄ β€ s β Ο i s=1)) β§ | |
| (β (E : Type) (J R : E β β) (h : Fin N β E β β) (i : Fin N) s, | |
| s β Icc (lo i.castSucc) (hi i.castSucc) β β v, | |
| surfaceFinalLayer J h R (fun j => Ο j.castSucc) (Ο (Fin.last N)) (s,v)= | |
| J v+(β j β Finset.univ.filter (fun j : Fin N => j < i), h j v)+Ο i.castSucc s*h i v) := by | |
| obtain β¨lo,hi,Ο,hbd,hord,hsm,hpos,hcolβ© := exists_ordered_smooth_clocks (N+1) hab | |
| refine β¨lo,hi,Ο,hbd,hord,hsm,hpos,hcol,?_β© | |
| intro E J R h i s hs v | |
| apply surfaceFinalLayer_on_ordered_interval J R h hord _ i hs v | |
| intro j | |
| obtain β¨Ξ΄,hΞ΄,hz,hoβ© := hcol j | |
| exact β¨fun s hs => hz s (by linarith),fun s hs => ho s (by linarith)β© | |
| end PackingSufficiencySupport.Hamiltonian | |
| end | |
| end OAI | |