import Mathlib import OAI.Geometry.BallPacking.Moments.ConvexWeights namespace OAI noncomputable section namespace PackingSufficiencySupport.Hamiltonian open Set Function Manifold MeasureTheory Classical open scoped ContDiff Manifold Topology ENNReal section variable {M : Type*} [TopologicalSpace M] [ChartedSpace Plane M] [IsManifold π“˜(ℝ,Plane) ∞ M] [T2Space M] {I J : Type*} [Fintype I] [Fintype J] {K : Set M} omit [T2Space M] in theorem partitionFormMass_independent (hpos : PositivePlaneTransitions M) (hK : IsCompact K) (B : I β†’ SurfaceCoordinateBox M) (C : J β†’ SurfaceCoordinateBox M) (ρ : SmoothPartitionOfUnity I π“˜(ℝ,Plane) M K) (Ξ½ : SmoothPartitionOfUnity J π“˜(ℝ,Plane) M K) (hρ : ρ.IsSubordinate (fun i => (B i).carrier)) (hΞ½ : Ξ½.IsSubordinate (fun j => (C j).carrier)) {Ξ© : ManifoldTwoForm Plane M} (hΞ© : SmoothTwoForm Ξ©) (hskew : βˆ€ x u v, Ξ© x u v = -Ξ© x v u) (hz : βˆ€ x, x βˆ‰ K β†’ Ξ© x=0) : partitionFormMass B ρ Ξ© = partitionFormMass C Ξ½ Ξ© := by classical let : MulActionWithZero ℝ (Plane β†’L[ℝ] Plane β†’L[ℝ] ℝ) := @Module.toMulActionWithZero ℝ (Plane β†’L[ℝ] Plane β†’L[ℝ] ℝ) inferInstance inferInstance inferInstance let D : I β†’ J β†’ ManifoldTwoForm Plane M := fun i j x => ρ i x β€’ (Ξ½ j x β€’ Ξ© x) let L : I β†’ J β†’ Set M := fun i j => K ∩ tsupport (ρ i) ∩ tsupport (Ξ½ j) have hL (i : I) (j : J) : IsCompact (L i j) := (hK.inter_right (isClosed_tsupport (ρ i))).inter_right (isClosed_tsupport (Ξ½ j)) have hLB (i : I) (j : J) : L i j βŠ† (extChartAt π“˜(ℝ,Plane) (B i).center).source := fun _ hx => (hρ i hx.1.2).1 have hLC (i : I) (j : J) : L i j βŠ† (extChartAt π“˜(ℝ,Plane) (C j).center).source := fun _ hx => (hΞ½ j hx.2).1 have hDz (i : I) (j : J) (x : M) (hx : x βˆ‰ L i j) : D i j x=0 := by by_cases hk : x ∈ K Β· by_cases hi : x ∈ tsupport (ρ i) Β· have hj : x βˆ‰ tsupport (Ξ½ j) := fun hj => hx ⟨⟨hk,hi⟩,hj⟩ simp only [D,image_eq_zero_of_notMem_tsupport hj,zero_smul,smul_zero] Β· simp only [D,image_eq_zero_of_notMem_tsupport hi,zero_smul] Β· simp only [D,hz x hk,smul_zero] have hDs (i : I) (j : J) : SmoothTwoForm (D i j) := (((SmoothTwoFormFamily.const (P := ℝ) hΞ©).spatial_smul (Ξ½ j).contMDiff).spatial_smul (ρ i).contMDiff).eval 0 have hDa (i : I) (j : J) (x : M) (u v : Plane) : D i j x u v = -D i j x v u := by change ρ i x * (Ξ½ j x * Ξ© x u v) = -(ρ i x * (Ξ½ j x * Ξ© x v u)) rw [hskew x u v]; ring have hsumJ (i : I) : (βˆ‘ j, D i j) = fun x => ρ i x β€’ Ξ© x := by funext x apply ContinuousLinearMap.ext intro firstVector apply ContinuousLinearMap.ext intro secondVector simp only [Finset.sum_apply,D,sum_apply,smul_apply,smul_eq_mul] rw [← Finset.mul_sum,← Finset.sum_mul] by_cases hx : x ∈ K Β· have hh : (βˆ‘ j, Ξ½ j x)=1 := by simpa only [finsum_eq_sum_of_fintype] using Ξ½.sum_eq_one hx rw [hh,one_mul] Β· simp only [hz x hx,zero_apply,mul_zero] have hsumI (j : J) : (βˆ‘ i, D i j) = fun x => Ξ½ j x β€’ Ξ© x := by funext x apply ContinuousLinearMap.ext intro firstVector apply ContinuousLinearMap.ext intro secondVector simp only [Finset.sum_apply,D,sum_apply,smul_apply,smul_eq_mul] rw [← Finset.sum_mul] by_cases hx : x ∈ K Β· have hh : (βˆ‘ i, ρ i x)=1 := by simpa only [finsum_eq_sum_of_fintype] using ρ.sum_eq_one hx rw [hh,one_mul] Β· simp only [hz x hx,zero_apply,mul_zero] have hchange (i : I) (j : J) : chartMass (B i).center (D i j)=chartMass (C j).center (D i j) := by apply chartMass_change (hDa i j) (hL i j) (hLB i j) (hLC i j) (hDz i j) rintro y ⟨x,hx,rfl⟩ apply hpos (B i).center (C j).center _ ((extChartAt π“˜(ℝ,Plane) (B i).center).map_source (hLB i j hx)) simpa only [(extChartAt π“˜(ℝ,Plane) (B i).center).left_inv (hLB i j hx)] using hLC i j hx unfold partitionFormMass calc (βˆ‘ i, chartMass (B i).center (fun x => ρ i x β€’ Ξ© x)) = βˆ‘ i, βˆ‘ j, chartMass (B i).center (D i j) := by apply Finset.sum_congr rfl intro i _ rw [← hsumJ i] exact chartMass_sum Finset.univ (B i).center (D i) (fun j _ => (hDs i j).coefficient_integrable _ (hL i j) (hLB i j) (hDz i j)) _ = βˆ‘ i, βˆ‘ j, chartMass (C j).center (D i j) := by apply Finset.sum_congr rfl intro i _ exact Finset.sum_congr rfl (fun j _ => hchange i j) _ = βˆ‘ j, βˆ‘ i, chartMass (C j).center (D i j) := Finset.sum_comm _ = βˆ‘ j, chartMass (C j).center (fun x => Ξ½ j x β€’ Ξ© x) := by apply Finset.sum_congr rfl intro j _ rw [← hsumI j] exact (chartMass_sum Finset.univ (C j).center (fun i => D i j) (fun i _ => (hDs i j).coefficient_integrable _ (hL i j) (hLC i j) (hDz i j))).symm end section variable {M : Type*} [TopologicalSpace M] [ChartedSpace Plane M] [MeasurableSpace M] [BorelSpace M] def chartInverseExtension (c : M) (y : Plane) : M := if y ∈ (extChartAt π“˜(ℝ,Plane) c).target then (extChartAt π“˜(ℝ,Plane) c).symm y else c theorem chartInverseExtension_measurable (c : M) : Measurable (chartInverseExtension c) := by classical exact (continuousOn_extChartAt_symm (I := π“˜(ℝ,Plane)) c).measurable_piecewise continuousOn_const (isOpen_extChartAt_target c).measurableSet omit [MeasurableSpace M] [BorelSpace M] in theorem chartInverseExtension_eq {c : M} {y : Plane} (hy : y∈(extChartAt π“˜(ℝ,Plane) c).target) : chartInverseExtension c y=(extChartAt π“˜(ℝ,Plane) c).symm y := ite_eq_left hy def chartAreaMeasure (c : M) (w : Plane β†’ ℝ) : Measure M := Measure.map (chartInverseExtension c) (volume.withDensity (fun y => ENNReal.ofReal (w y))) omit [BorelSpace M] in theorem chartAreaMeasure_finite (c : M) {w : Plane β†’ ℝ} (hw : Integrable w) : IsFiniteMeasure (chartAreaMeasure c w) := by have hl : (∫⁻ y, ENNReal.ofReal (w y)) < (⊀ : ℝβ‰₯0∞) := by apply lt_of_le_of_lt (lintegral_mono (fun y => ENNReal.ofReal_le_ofReal (le_abs_self (w y)))) simpa only [Real.norm_eq_abs] using (hasFiniteIntegral_iff_norm w).mp hw.hasFiniteIntegral let := isFiniteMeasure_withDensity hl.ne exact inferInstanceAs (IsFiniteMeasure (Measure.map _ _)) theorem integral_chartAreaMeasure (c : M) {w : Plane β†’ ℝ} (hw : Measurable w) (hpos : βˆ€ y,0≀w y) (hz : βˆ€ y,yβˆ‰(extChartAt π“˜(ℝ,Plane) c).targetβ†’w y=0) {f : M β†’ ℝ} (hf : Measurable f) : (∫ x, f x βˆ‚chartAreaMeasure c w)= ∫ y, w y*f ((extChartAt π“˜(ℝ,Plane) c).symm y) := by rw [chartAreaMeasure,integral_map (chartInverseExtension_measurable c).aemeasurable hf.aestronglyMeasurable] rw [integral_withDensity_eq_integral_toReal_smul (hw.ennreal_ofReal) (Filter.Eventually.of_forall (fun _ => ENNReal.ofReal_lt_top))] apply integral_congr_ae filter_upwards [] with y rw [ENNReal.toReal_ofReal (hpos y)] change w y*f (chartInverseExtension c y)=_ by_cases hy : y∈(extChartAt π“˜(ℝ,Plane) c).target Β· rw [chartInverseExtension_eq hy] Β· rw [hz y hy,zero_mul,zero_mul] theorem integrable_chartAreaMeasure (c : M) {w : Plane β†’ ℝ} (hw : Measurable w) (hpos : βˆ€ y,0≀w y) (hz : βˆ€ y,yβˆ‰(extChartAt π“˜(ℝ,Plane) c).targetβ†’w y=0) {f : M β†’ ℝ} (hf : Measurable f) : Integrable f (chartAreaMeasure c w) ↔ Integrable (fun y => w y*f ((extChartAt π“˜(ℝ,Plane) c).symm y)) := by rw [chartAreaMeasure,integrable_map_measure hf.aestronglyMeasurable (chartInverseExtension_measurable c).aemeasurable, integrable_withDensity_iff_integrable_smul' hw.ennreal_ofReal (Filter.Eventually.of_forall (fun _ => ENNReal.ofReal_lt_top))] apply integrable_congr filter_upwards [] with y rw [ENNReal.toReal_ofReal (hpos y)] change w y*f (chartInverseExtension c y)=_ by_cases hy : y∈(extChartAt π“˜(ℝ,Plane) c).target Β· rw [chartInverseExtension_eq hy] Β· rw [hz y hy,zero_mul,zero_mul] theorem chartAreaMeasure_null (c : M) {w : Plane β†’ ℝ} (hz : βˆ€ y,yβˆ‰(extChartAt π“˜(ℝ,Plane) c).targetβ†’w y=0) {C : Set M} (hC : MeasurableSet C) (hnull : volume ((extChartAt π“˜(ℝ,Plane) c).target ∩ (extChartAt π“˜(ℝ,Plane) c).symm ⁻¹' C)=0) : chartAreaMeasure c w C=0 := by rw [chartAreaMeasure,Measure.map_apply (chartInverseExtension_measurable c) hC, withDensity_apply _ ((chartInverseExtension_measurable c) hC)] apply lintegral_eq_zero_of_ae_eq_zero filter_upwards [ae_restrict_mem ((chartInverseExtension_measurable c) hC), (ae_restrict_of_ae (measure_eq_zero_iff_ae_notMem.mp hnull))] with y hy hn have hyt : yβˆ‰(extChartAt π“˜(ℝ,Plane) c).target := by intro ht apply hn refine ⟨ht,?_⟩ simpa only [mem_preimage,chartInverseExtension_eq ht] using hy rw [hz y hyt,ENNReal.ofReal_zero] rfl end section variable {M : Type*} [TopologicalSpace M] [ChartedSpace Plane M] {I : Type*} {K : Set M} def partitionChartDensity (B : I β†’ SurfaceCoordinateBox M) (ρ : SmoothPartitionOfUnity I π“˜(ℝ,Plane) M K) (Ξ› : ManifoldTwoForm Plane M) (i : I) (y : Plane) : ℝ := extendedChartCoefficient (B i).center (fun _ : ℝ => fun x => ρ i x β€’ Ξ› x) (0,y) theorem partitionChartDensity_off_target (B : I β†’ SurfaceCoordinateBox M) (ρ : SmoothPartitionOfUnity I π“˜(ℝ,Plane) M K) (Ξ› : ManifoldTwoForm Plane M) (i : I) {y : Plane} (hy : yβˆ‰(extChartAt π“˜(ℝ,Plane) (B i).center).target) : partitionChartDensity B ρ Ξ› i y=0 := ite_eq_right hy theorem partitionChartDensity_nonneg (B : I β†’ SurfaceCoordinateBox M) (ρ : SmoothPartitionOfUnity I π“˜(ℝ,Plane) M K) {Ξ› : ManifoldTwoForm Plane M} (hΞ› : βˆ€ c y,y∈(extChartAt π“˜(ℝ,Plane) c).targetβ†’ 0≀chartTwoForm Ξ› c y (1,0) (0,1)) (i : I) (y : Plane) : 0≀partitionChartDensity B ρ Ξ› i y := by by_cases hy : y∈(extChartAt π“˜(ℝ,Plane) (B i).center).target Β· unfold partitionChartDensity extendedChartCoefficient spatialZeroExtension rw [ite_eq_left hy] change 0 ≀ chartTwoForm (fun x => ρ i x β€’ Ξ› x) (B i).center y (1,0) (0,1) rw [chartTwoForm_spatial_smul] exact mul_nonneg (ρ.nonneg i _) (hΞ› _ _ hy) Β· rw [partitionChartDensity_off_target B ρ Ξ› i hy] theorem partitionChartDensity_spatial_smul (B : I β†’ SurfaceCoordinateBox M) (ρ : SmoothPartitionOfUnity I π“˜(ℝ,Plane) M K) (Ξ› : ManifoldTwoForm Plane M) (f : M β†’ ℝ) (i : I) (y : Plane) : partitionChartDensity B ρ (fun x => f x β€’ Ξ› x) i y= partitionChartDensity B ρ Ξ› i y * f ((extChartAt π“˜(ℝ,Plane) (B i).center).symm y) := by unfold partitionChartDensity extendedChartCoefficient spatialZeroExtension split_ifs Β· change chartTwoForm (fun x => ρ i x β€’ (f x β€’ Ξ› x)) (B i).center y (1,0) (0,1) = chartTwoForm (fun x => ρ i x β€’ Ξ› x) (B i).center y (1,0) (0,1) * _ rw [chartTwoForm_spatial_smul,chartTwoForm_spatial_smul,chartTwoForm_spatial_smul] simp only [smul_apply, smul_eq_mul] ring Β· exact (zero_mul _).symm variable [IsManifold π“˜(ℝ,Plane) ∞ M] theorem partitionChartDensity_properties (B : I β†’ SurfaceCoordinateBox M) (ρ : SmoothPartitionOfUnity I π“˜(ℝ,Plane) M K) (hρ : ρ.IsSubordinate (fun i => (B i).carrier)) {Ξ› : ManifoldTwoForm Plane M} (hΞ› : SmoothTwoForm Ξ›) (i : I) : ContDiff ℝ ∞ (partitionChartDensity B ρ Ξ› i) ∧ HasCompactSupport (partitionChartDensity B ρ Ξ› i) ∧ Integrable (partitionChartDensity B ρ Ξ› i) := by let L := tsupport (ρ i) have hL : IsCompact L := (B i).isCompact_compactCarrier.of_isClosed_subset (isClosed_tsupport _) ((hρ i).trans (B i).carrier_subset_compactCarrier) have hLc : LβŠ†(extChartAt π“˜(ℝ,Plane) (B i).center).source := fun _ hx => (hρ i hx).1 have hs : SmoothTwoFormFamily (fun _ : ℝ => fun x => ρ i x β€’ Ξ› x) := (SmoothTwoFormFamily.const hΞ›).spatial_smul (ρ i).contMDiff have hz : βˆ€ (p : ℝ) x,xβˆ‰L→ρ i x β€’ Ξ› x=0 := by intro _ x hx rw [image_eq_zero_of_notMem_tsupport hx] apply ContinuousLinearMap.ext intro u apply ContinuousLinearMap.ext intro v change (0:ℝ) * _ = 0 exact zero_mul _ have hfull : ContDiff ℝ ∞ (extendedChartCoefficient (B i).center (fun _ : ℝ => fun x => ρ i x β€’ Ξ› x)) := extendedChartCoefficient_smooth (Ξ© := fun _ : ℝ => fun x => ρ i x β€’ Ξ› x) (c := (B i).center) (hs (B i).center) hL hLc hz have hsm : ContDiff ℝ ∞ (partitionChartDensity B ρ Ξ› i) := hfull.comp (f := fun y : Plane => ((0 : ℝ),y)) (contDiff_const.prodMk contDiff_id) have hc : HasCompactSupport (partitionChartDensity B ρ Ξ› i) := by apply HasCompactSupport.intro (hL.image_of_continuousOn ((continuousOn_extChartAt (I := π“˜(ℝ,Plane)) (B i).center).mono hLc)) exact fun _ hy => extendedChartCoefficient_zero hz 0 hy exact ⟨hsm,hc,hsm.continuous.integrable_of_hasCompactSupport hc⟩ variable [Fintype I] [MeasurableSpace M] [BorelSpace M] def partitionAreaMeasure (B : I β†’ SurfaceCoordinateBox M) (ρ : SmoothPartitionOfUnity I π“˜(ℝ,Plane) M K) (Ξ› : ManifoldTwoForm Plane M) : Measure M := βˆ‘ i, chartAreaMeasure (B i).center (partitionChartDensity B ρ Ξ› i) omit [BorelSpace M] in theorem partitionAreaMeasure_finite (B : I β†’ SurfaceCoordinateBox M) (ρ : SmoothPartitionOfUnity I π“˜(ℝ,Plane) M K) (hρ : ρ.IsSubordinate (fun i => (B i).carrier)) {Ξ› : ManifoldTwoForm Plane M} (hΞ› : SmoothTwoForm Ξ›) : IsFiniteMeasure (partitionAreaMeasure B ρ Ξ›) := by have (i : I) : IsFiniteMeasure (chartAreaMeasure (B i).center (partitionChartDensity B ρ Ξ› i)) := chartAreaMeasure_finite _ (partitionChartDensity_properties B ρ hρ hΞ› i).2.2 exact inferInstanceAs (IsFiniteMeasure (βˆ‘ i, chartAreaMeasure (B i).center (partitionChartDensity B ρ Ξ› i))) theorem integral_partitionAreaMeasure (B : I β†’ SurfaceCoordinateBox M) (ρ : SmoothPartitionOfUnity I π“˜(ℝ,Plane) M K) (hρ : ρ.IsSubordinate (fun i => (B i).carrier)) {Ξ› : ManifoldTwoForm Plane M} (hΞ› : SmoothTwoForm Ξ›) (hpos : βˆ€ c y,y∈(extChartAt π“˜(ℝ,Plane) c).targetβ†’ 0≀chartTwoForm Ξ› c y (1,0) (0,1)) {f : M β†’ ℝ} (hf : ContMDiff π“˜(ℝ,Plane) π“˜(ℝ,ℝ) ∞ f) : (∫ x, f x βˆ‚partitionAreaMeasure B ρ Ξ›)= partitionFormMass B ρ (fun x => f x β€’ Ξ› x) := by have hfp : SmoothTwoForm (fun x => f x β€’ Ξ› x) := ((SmoothTwoFormFamily.const (P := ℝ) hΞ›).spatial_smul hf).eval 0 have hmeas (i : I) : Measurable (partitionChartDensity B ρ Ξ› i) := (partitionChartDensity_properties B ρ hρ hΞ› i).1.continuous.measurable have hint (i : I) : Integrable f (chartAreaMeasure (B i).center (partitionChartDensity B ρ Ξ› i)) := by rw [integrable_chartAreaMeasure _ (hmeas i) (partitionChartDensity_nonneg B ρ hpos i) (fun _ hy => partitionChartDensity_off_target B ρ Ξ› i hy) hf.continuous.measurable] simpa only [← partitionChartDensity_spatial_smul] using (partitionChartDensity_properties B ρ hρ hfp i).2.2 rw [partitionAreaMeasure,integral_finsetSum_measure (fun i _ => hint i)] unfold partitionFormMass chartMass apply Finset.sum_congr rfl intro i _ rw [integral_chartAreaMeasure _ (hmeas i) (partitionChartDensity_nonneg B ρ hpos i) (fun _ hy => partitionChartDensity_off_target B ρ Ξ› i hy) hf.continuous.measurable] apply integral_congr_ae exact Filter.Eventually.of_forall (fun y => (partitionChartDensity_spatial_smul B ρ Ξ› f i y).symm) end section variable {M : Type*} [TopologicalSpace M] [ChartedSpace Plane M] [MeasurableSpace M] [BorelSpace M] theorem integral_chartAreaMeasure_restrict (c : M) {w : Plane β†’ ℝ} (hw : Measurable w) (hpos : βˆ€ y,0≀w y) (hz : βˆ€ y,yβˆ‰(extChartAt π“˜(ℝ,Plane) c).targetβ†’w y=0) {C : Set M} (hC : MeasurableSet C) {f : M β†’ ℝ} (hf : Measurable f) : (∫ x in C, f x βˆ‚chartAreaMeasure c w)= ∫ y in (extChartAt π“˜(ℝ,Plane) c).target ∩ (extChartAt π“˜(ℝ,Plane) c).symm ⁻¹' C, w y*f ((extChartAt π“˜(ℝ,Plane) c).symm y) := by rw [← integral_indicator hC, integral_chartAreaMeasure c hw hpos hz (hf.indicator hC)] have hD : MeasurableSet ((extChartAt π“˜(ℝ,Plane) c).target ∩ (extChartAt π“˜(ℝ,Plane) c).symm ⁻¹' C) := by have he : (extChartAt π“˜(ℝ,Plane) c).target ∩ (extChartAt π“˜(ℝ,Plane) c).symm ⁻¹' C = (extChartAt π“˜(ℝ,Plane) c).target ∩ chartInverseExtension c ⁻¹' C := by ext y by_cases hy : y∈(extChartAt π“˜(ℝ,Plane) c).target Β· simp only [mem_inter_iff,mem_preimage,hy,true_and,chartInverseExtension_eq hy] Β· simp only [mem_inter_iff,hy,false_and] rw [he] exact (isOpen_extChartAt_target c).measurableSet.inter (chartInverseExtension_measurable c hC) rw [← integral_indicator hD] apply integral_congr_ae filter_upwards [] with y by_cases hy : y∈(extChartAt π“˜(ℝ,Plane) c).target Β· by_cases hc : (extChartAt π“˜(ℝ,Plane) c).symm y∈C Β· simp only [Set.indicator,mem_inter_iff,mem_preimage,hy,hc,and_self,↓reduceIte] Β· simp only [Set.indicator,mem_inter_iff,mem_preimage,hy,hc,and_false,↓reduceIte,mul_zero] Β· simp only [Set.indicator,mem_inter_iff,mem_preimage,hy,false_and,↓reduceIte,hz y hy,zero_mul] variable {I : Type*} [Fintype I] {K : Set M} def restrictedPartitionFormMass (B : I β†’ SurfaceCoordinateBox M) (ρ : SmoothPartitionOfUnity I π“˜(ℝ,Plane) M K) (C : Set M) (Ξ© : ManifoldTwoForm Plane M) : ℝ := βˆ‘ i, ∫ y in (extChartAt π“˜(ℝ,Plane) (B i).center).target ∩ (extChartAt π“˜(ℝ,Plane) (B i).center).symm ⁻¹' C, partitionChartDensity B ρ Ξ© i y variable [IsManifold π“˜(ℝ,Plane) ∞ M] theorem smooth_integrable_partitionAreaMeasure (B : I β†’ SurfaceCoordinateBox M) (ρ : SmoothPartitionOfUnity I π“˜(ℝ,Plane) M K) (hρ : ρ.IsSubordinate (fun i => (B i).carrier)) {Ξ› : ManifoldTwoForm Plane M} (hΞ› : SmoothTwoForm Ξ›) (hpos : βˆ€ c y,y∈(extChartAt π“˜(ℝ,Plane) c).targetβ†’ 0≀chartTwoForm Ξ› c y (1,0) (0,1)) {f : M β†’ ℝ} (hf : ContMDiff π“˜(ℝ,Plane) π“˜(ℝ,ℝ) ∞ f) : Integrable f (partitionAreaMeasure B ρ Ξ›) := by have hfp : SmoothTwoForm (fun x => f x β€’ Ξ› x) := ((SmoothTwoFormFamily.const (P := ℝ) hΞ›).spatial_smul hf).eval 0 apply integrable_finsetSum_measure.mpr intro i _ rw [integrable_chartAreaMeasure _ (partitionChartDensity_properties B ρ hρ hΞ› i).1.continuous.measurable (partitionChartDensity_nonneg B ρ hpos i) (fun _ hy => partitionChartDensity_off_target B ρ Ξ› i hy) hf.continuous.measurable] simpa only [← partitionChartDensity_spatial_smul] using (partitionChartDensity_properties B ρ hρ hfp i).2.2 theorem integral_partitionAreaMeasure_restrict (B : I β†’ SurfaceCoordinateBox M) (ρ : SmoothPartitionOfUnity I π“˜(ℝ,Plane) M K) (hρ : ρ.IsSubordinate (fun i => (B i).carrier)) {Ξ› : ManifoldTwoForm Plane M} (hΞ› : SmoothTwoForm Ξ›) (hpos : βˆ€ c y,y∈(extChartAt π“˜(ℝ,Plane) c).targetβ†’ 0≀chartTwoForm Ξ› c y (1,0) (0,1)) {C : Set M} (hC : MeasurableSet C) {f : M β†’ ℝ} (hf : ContMDiff π“˜(ℝ,Plane) π“˜(ℝ,ℝ) ∞ f) : (∫ x in C, f x βˆ‚partitionAreaMeasure B ρ Ξ›)= restrictedPartitionFormMass B ρ C (fun x => f x β€’ Ξ› x) := by have hh := (smooth_integrable_partitionAreaMeasure B ρ hρ hΞ› hpos hf).indicator hC have hint : βˆ€ i ∈ (Finset.univ : Finset I), Integrable (C.indicator f) (chartAreaMeasure (B i).center (partitionChartDensity B ρ Ξ› i)) := integrable_finsetSum_measure.mp hh rw [← integral_indicator hC,partitionAreaMeasure, integral_finsetSum_measure hint] unfold restrictedPartitionFormMass apply Finset.sum_congr rfl intro i _ rw [integral_indicator hC, integral_chartAreaMeasure_restrict _ (partitionChartDensity_properties B ρ hρ hΞ› i).1.continuous.measurable (partitionChartDensity_nonneg B ρ hpos i) (fun _ hy => partitionChartDensity_off_target B ρ Ξ› i hy) hC hf.continuous.measurable] apply integral_congr_ae exact Filter.Eventually.of_forall (fun y => (partitionChartDensity_spatial_smul B ρ Ξ› f i y).symm) omit [IsManifold π“˜(ℝ,Plane) ∞ M] in theorem partitionAreaMeasure_null (B : I β†’ SurfaceCoordinateBox M) (ρ : SmoothPartitionOfUnity I π“˜(ℝ,Plane) M K) (Ξ› : ManifoldTwoForm Plane M) {C : Set M} (hC : MeasurableSet C) (hnull : βˆ€ i,volume ((extChartAt π“˜(ℝ,Plane) (B i).center).target ∩ (extChartAt π“˜(ℝ,Plane) (B i).center).symm ⁻¹' C)=0) : partitionAreaMeasure B ρ Ξ› C=0 := by rw [partitionAreaMeasure,Measure.finsetSum_apply] apply Finset.sum_eq_zero intro i _ exact chartAreaMeasure_null _ (fun _ hy => partitionChartDensity_off_target B ρ Ξ› i hy) hC (hnull i) omit [IsManifold π“˜(ℝ,Plane) ∞ M] theorem chartRegion_measurable (c : M) {C : Set M} (hC : MeasurableSet C) : MeasurableSet ((extChartAt π“˜(ℝ,Plane) c).target ∩ (extChartAt π“˜(ℝ,Plane) c).symm ⁻¹' C) := by have he : (extChartAt π“˜(ℝ,Plane) c).target ∩ (extChartAt π“˜(ℝ,Plane) c).symm ⁻¹' C = (extChartAt π“˜(ℝ,Plane) c).target ∩ chartInverseExtension c ⁻¹' C := by ext y by_cases hy : y∈(extChartAt π“˜(ℝ,Plane) c).target Β· simp only [mem_inter_iff,mem_preimage,hy,true_and,chartInverseExtension_eq hy] Β· simp only [mem_inter_iff,hy,false_and] rw [he] exact (isOpen_extChartAt_target c).measurableSet.inter (chartInverseExtension_measurable c hC) omit [MeasurableSpace M] [BorelSpace M] in theorem extendedChartCoefficient_indicator (c : M) (C : Set M) (Ξ© : ManifoldTwoForm Plane M) (y : Plane) : extendedChartCoefficient c (fun _ : ℝ => C.indicator Ξ©) (0,y)= ((extChartAt π“˜(ℝ,Plane) c).target ∩ (extChartAt π“˜(ℝ,Plane) c).symm ⁻¹' C).indicator (fun y => extendedChartCoefficient c (fun _ : ℝ => Ξ©) (0,y)) y := by classical unfold extendedChartCoefficient spatialZeroExtension chartTwoForm by_cases hy : y∈(extChartAt π“˜(ℝ,Plane) c).target Β· by_cases hc : (extChartAt π“˜(ℝ,Plane) c).symm y∈C Β· simp only [Set.indicator,hy,hc,mem_inter_iff,mem_preimage,and_self,↓reduceIte] Β· simp only [Set.indicator,hy,hc,mem_inter_iff,mem_preimage,and_false,↓reduceIte] simp only [ContinuousLinearMap.bilinearComp_apply,zero_apply] Β· simp only [Set.indicator,hy,mem_inter_iff,false_and,↓reduceIte] theorem extendedChartCoefficient_indicator_integrable (c : M) {C : Set M} (hC : MeasurableSet C) {Ξ© : ManifoldTwoForm Plane M} (hΞ© : Integrable (fun y => extendedChartCoefficient c (fun _ : ℝ => Ξ©) (0,y))) : Integrable (fun y => extendedChartCoefficient c (fun _ : ℝ => C.indicator Ξ©) (0,y)) := by simpa only [extendedChartCoefficient_indicator] using hΞ©.indicator (chartRegion_measurable c hC) theorem restrictedPartitionFormMass_eq_indicator {I : Type*} [Fintype I] {K : Set M} (B : I β†’ SurfaceCoordinateBox M) (ρ : SmoothPartitionOfUnity I π“˜(ℝ,Plane) M K) {C : Set M} (hC : MeasurableSet C) (Ξ© : ManifoldTwoForm Plane M) : restrictedPartitionFormMass B ρ C Ξ©=partitionFormMass B ρ (C.indicator Ξ©) := by classical let : MulActionWithZero ℝ (Plane β†’L[ℝ] Plane β†’L[ℝ] ℝ) := @Module.toMulActionWithZero ℝ (Plane β†’L[ℝ] Plane β†’L[ℝ] ℝ) inferInstance inferInstance inferInstance unfold restrictedPartitionFormMass partitionFormMass chartMass apply Finset.sum_congr rfl intro i _ have he : (fun x => ρ i x β€’ C.indicator Ξ© x)=C.indicator (fun x => ρ i x β€’ Ξ© x) := by funext x by_cases hx : x∈C <;> simp only [Set.indicator,hx,↓reduceIte,smul_zero] rw [he] simp_rw [extendedChartCoefficient_indicator] rw [integral_indicator (chartRegion_measurable (B i).center hC)] rfl end variable {M : Type*} [TopologicalSpace M] [ChartedSpace Plane M] [IsManifold π“˜(ℝ,Plane) ∞ M] [T2Space M] {I J : Type*} [Fintype I] [Fintype J] {K : Set M} omit [T2Space M] in theorem partitionFormMass_independent_integrable (hpos : PositivePlaneTransitions M) (hK : IsCompact K) (B : I β†’ SurfaceCoordinateBox M) (C : J β†’ SurfaceCoordinateBox M) (ρ : SmoothPartitionOfUnity I π“˜(ℝ,Plane) M K) (Ξ½ : SmoothPartitionOfUnity J π“˜(ℝ,Plane) M K) (hρ : ρ.IsSubordinate (fun i => (B i).carrier)) (hΞ½ : Ξ½.IsSubordinate (fun j => (C j).carrier)) {Ξ© : ManifoldTwoForm Plane M} (hskew : βˆ€ x u v, Ξ© x u v = -Ξ© x v u) (hz : βˆ€ x, x βˆ‰ K β†’ Ξ© x=0) (hB : βˆ€ i j,Integrable (fun y => extendedChartCoefficient (B i).center (fun _ : ℝ => fun x => ρ i x β€’ (Ξ½ j x β€’ Ξ© x)) (0,y))) (hC : βˆ€ i j,Integrable (fun y => extendedChartCoefficient (C j).center (fun _ : ℝ => fun x => ρ i x β€’ (Ξ½ j x β€’ Ξ© x)) (0,y))) : partitionFormMass B ρ Ξ© = partitionFormMass C Ξ½ Ξ© := by classical let : MulActionWithZero ℝ (Plane β†’L[ℝ] Plane β†’L[ℝ] ℝ) := @Module.toMulActionWithZero ℝ (Plane β†’L[ℝ] Plane β†’L[ℝ] ℝ) inferInstance inferInstance inferInstance let D : I β†’ J β†’ ManifoldTwoForm Plane M := fun i j x => ρ i x β€’ (Ξ½ j x β€’ Ξ© x) let L : I β†’ J β†’ Set M := fun i j => K ∩ tsupport (ρ i) ∩ tsupport (Ξ½ j) have hL (i : I) (j : J) : IsCompact (L i j) := (hK.inter_right (isClosed_tsupport (ρ i))).inter_right (isClosed_tsupport (Ξ½ j)) have hLB (i : I) (j : J) : L i j βŠ† (extChartAt π“˜(ℝ,Plane) (B i).center).source := fun _ hx => (hρ i hx.1.2).1 have hLC (i : I) (j : J) : L i j βŠ† (extChartAt π“˜(ℝ,Plane) (C j).center).source := fun _ hx => (hΞ½ j hx.2).1 have hDz (i : I) (j : J) (x : M) (hx : x βˆ‰ L i j) : D i j x=0 := by by_cases hk : x ∈ K Β· by_cases hi : x ∈ tsupport (ρ i) Β· have hj : x βˆ‰ tsupport (Ξ½ j) := fun hj => hx ⟨⟨hk,hi⟩,hj⟩ simp only [D,image_eq_zero_of_notMem_tsupport hj,zero_smul,smul_zero] Β· simp only [D,image_eq_zero_of_notMem_tsupport hi,zero_smul] Β· simp only [D,hz x hk,smul_zero] have hDa (i : I) (j : J) (x : M) (u v : Plane) : D i j x u v = -D i j x v u := by change ρ i x * (Ξ½ j x * Ξ© x u v) = -(ρ i x * (Ξ½ j x * Ξ© x v u)) rw [hskew x u v]; ring have hsumJ (i : I) : (βˆ‘ j, D i j) = fun x => ρ i x β€’ Ξ© x := by funext x apply ContinuousLinearMap.ext intro firstVector apply ContinuousLinearMap.ext intro secondVector simp only [Finset.sum_apply,D,sum_apply,smul_apply,smul_eq_mul] rw [← Finset.mul_sum,← Finset.sum_mul] by_cases hx : x ∈ K Β· have hh : (βˆ‘ j, Ξ½ j x)=1 := by simpa only [finsum_eq_sum_of_fintype] using Ξ½.sum_eq_one hx rw [hh,one_mul] Β· simp only [hz x hx,zero_apply,mul_zero] have hsumI (j : J) : (βˆ‘ i, D i j) = fun x => Ξ½ j x β€’ Ξ© x := by funext x apply ContinuousLinearMap.ext intro firstVector apply ContinuousLinearMap.ext intro secondVector simp only [Finset.sum_apply,D,sum_apply,smul_apply,smul_eq_mul] rw [← Finset.sum_mul] by_cases hx : x ∈ K Β· have hh : (βˆ‘ i, ρ i x)=1 := by simpa only [finsum_eq_sum_of_fintype] using ρ.sum_eq_one hx rw [hh,one_mul] Β· simp only [hz x hx,zero_apply,mul_zero] have hchange (i : I) (j : J) : chartMass (B i).center (D i j)=chartMass (C j).center (D i j) := by apply chartMass_change (hDa i j) (hL i j) (hLB i j) (hLC i j) (hDz i j) rintro y ⟨x,hx,rfl⟩ apply hpos (B i).center (C j).center _ ((extChartAt π“˜(ℝ,Plane) (B i).center).map_source (hLB i j hx)) simpa only [(extChartAt π“˜(ℝ,Plane) (B i).center).left_inv (hLB i j hx)] using hLC i j hx unfold partitionFormMass calc (βˆ‘ i, chartMass (B i).center (fun x => ρ i x β€’ Ξ© x)) = βˆ‘ i, βˆ‘ j, chartMass (B i).center (D i j) := by apply Finset.sum_congr rfl intro i _ rw [← hsumJ i] exact chartMass_sum Finset.univ (B i).center (D i) (fun j _ => hB i j) _ = βˆ‘ i, βˆ‘ j, chartMass (C j).center (D i j) := by apply Finset.sum_congr rfl intro i _ exact Finset.sum_congr rfl (fun j _ => hchange i j) _ = βˆ‘ j, βˆ‘ i, chartMass (C j).center (D i j) := Finset.sum_comm _ = βˆ‘ j, chartMass (C j).center (fun x => Ξ½ j x β€’ Ξ© x) := by apply Finset.sum_congr rfl intro j _ rw [← hsumI j] exact (chartMass_sum Finset.univ (C j).center (fun i => D i j) (fun i _ => hC i j)).symm end PackingSufficiencySupport.Hamiltonian end end OAI