import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Metric.Hessian.LaplacianLinearity import Mathlib.Geometry.Manifold.PartitionOfUnity import Mathlib.MeasureTheory.Integral.Bochner.Basic /-! # Finite assembly of local weak scalar comparisons Morgan-Tian Theorem 7.13, pp. 162-164. Nonnegative smooth partitions of unity split a compact test into finitely many subordinate tests. Linearity of the literal Laplacian assembles both the integrability and the sign without any local finiteness assumption on the measure. -/ set_option autoImplicit false open Set MeasureTheory open scoped Manifold ContDiff BigOperators universe u namespace PoincareMT.ReducedVolume variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] [T3Space M] [SecondCountableTopology M] [MeasurableSpace M] {g : RiemannianMetric n M} /-- Locally established weak comparisons give the full compact-test comparison. -/ theorem weak_comparison_of_local (D : LeviCivitaData g) (ΞΌ : Measure M) (u H : M β†’ ℝ) (hlocal : βˆ€ q : M, βˆƒ U : Set M, IsOpen U ∧ q ∈ U ∧ βˆ€ ψ : M β†’ ℝ, ContMDiff (𝓑 n) (π“˜(ℝ, ℝ)) ∞ ψ β†’ HasCompactSupport ψ β†’ tsupport ψ βŠ† U β†’ (βˆ€ x, 0 ≀ ψ x) β†’ Integrable (fun x ↦ ψ x * H x - u x * D.laplacian ψ x) ΞΌ ∧ 0 ≀ ∫ x, ψ x * H x - u x * D.laplacian ψ x βˆ‚ΞΌ) (Ο† : M β†’ ℝ) (hΟ† : ContMDiff (𝓑 n) (π“˜(ℝ, ℝ)) ∞ Ο†) (hc : HasCompactSupport Ο†) (hpos : βˆ€ x, 0 ≀ Ο† x) : Integrable (fun x ↦ Ο† x * H x - u x * D.laplacian Ο† x) ΞΌ ∧ 0 ≀ ∫ x, Ο† x * H x - u x * D.laplacian Ο† x βˆ‚ΞΌ := by classical let : LocallyCompactSpace M := Manifold.locallyCompact_of_finiteDimensional (𝓑 n) choose U hU hq hweak using hlocal obtain ⟨s, hs⟩ := hc.elim_finite_subcover U hU (fun q _ ↦ mem_iUnion.mpr ⟨q, hq q⟩) obtain ⟨θ, hθ⟩ := SmoothPartitionOfUnity.exists_isSubordinate (𝓑 n) (isClosed_tsupport Ο†) (fun i : s ↦ U i) (fun i ↦ hU i) (by intro q hq obtain ⟨i, hi, hqi⟩ := mem_iUnionβ‚‚.mp (hs hq) exact mem_iUnion.mpr ⟨⟨i, hi⟩, hqi⟩) let ψ : s β†’ M β†’ ℝ := fun i x ↦ ΞΈ i x * Ο† x have hψ (i : s) : ContMDiff (𝓑 n) (π“˜(ℝ, ℝ)) ∞ (ψ i) := (ΞΈ i).contMDiff.mul hΟ† have htest (i : s) := hweak i (ψ i) (hψ i) (show HasCompactSupport (ψ i) from hc.mul_left) (tsupport_mul_subset_left.trans (hΞΈ i)) (fun x ↦ mul_nonneg (ΞΈ.nonneg i x) (hpos x)) have hsum (x : M) : (βˆ‘ i : s, ψ i x) = Ο† x := by by_cases hx : x ∈ tsupport Ο† Β· simp only [ψ, ← Finset.sum_mul, ← finsum_eq_sum_of_fintype, ΞΈ.sum_eq_one hx, one_mul] Β· simp only [ψ, image_eq_zero_of_notMem_tsupport hx, mul_zero, Finset.sum_const_zero] have hfun : (fun x ↦ βˆ‘ i : s, ψ i x) = Ο† := funext hsum have hlap (x : M) : D.laplacian Ο† x = βˆ‘ i : s, D.laplacian (ψ i) x := by rw [← hfun] exact laplacian_finsetSum_scalar D Finset.univ ψ (fun i _ ↦ (hψ i).of_le (by decide : (2 : β„•βˆžΟ‰) ≀ ∞)) x have heq (x : M) : Ο† x * H x - u x * D.laplacian Ο† x = βˆ‘ i : s, (ψ i x * H x - u x * D.laplacian (ψ i) x) := by rw [Finset.sum_sub_distrib, ← Finset.sum_mul, ← Finset.mul_sum, hsum, hlap] constructor Β· simpa only [← heq] using integrable_finsetSum Finset.univ (fun i _ ↦ (htest i).1) Β· simp_rw [heq] rw [integral_finsetSum Finset.univ (fun i _ ↦ (htest i).1)] exact Finset.sum_nonneg (fun i _ ↦ (htest i).2) end PoincareMT.ReducedVolume