import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Plateau.Annulus.DensityCongruence import PoincareLib.Geometry.RicciFlow.Area.MinimalSphere.EnergyDensityCoordinates /-! # Actual annular energy density at a fixed positive modulus The weighted Gram density is expressed in genuine target coordinates. For smooth families it is jointly smooth at every derivative rank. These are the local calculus facts for modulus-weighted stationarity and moving-metric variation; no normalization to modulus one is made. Morgan--Tian context: Lemma 19.15 and its annular area-to-energy construction, printed pp. 447-449. -/ set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open Set Filter MeasureTheory open scoped Manifold ContDiff Topology universe u namespace PoincareMT variable {n : โ„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] /-- The actual half-energy density for a fixed cylinder modulus. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project derivation `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ noncomputable def m64ModulusEnergyDensity (g : RiemannianMetric n M) (r : โ„) (f : LoopPlane โ†’ M) (p : LoopPlane) : โ„ := (r * m60AreaGram g f p 0 0 + rโปยน * m60AreaGram g f p 1 1) / 2 /-- Equality of map germs identifies their genuine weighted energy densities at the base point. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project derivation `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ theorem m64ModulusEnergyDensity_congr_of_eventuallyEq (g : RiemannianMetric n M) (r : โ„) {f h : LoopPlane โ†’ M} {p : LoopPlane} (heq : f =แถ [๐“ p] h) : m64ModulusEnergyDensity g r f p = m64ModulusEnergyDensity g r h p := by have hi (v w : EuclideanSpace โ„ (Fin n)) : g.inner (f p) v w = g.inner (h p) v w := congrArg (fun q : M => g.inner q v w) heq.eq_of_nhds simp only [m64ModulusEnergyDensity, m60AreaGram, heq.mfderiv_eq, hi] rfl /-- Equality on the closed annulus rectangle identifies weighted densities almost everywhere through equality of interior germs. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project derivation `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ theorem m64ModulusEnergyDensity_ae_eq_of_eqOn (g : RiemannianMetric n M) (r : โ„) {f h : LoopPlane โ†’ M} (heq : EqOn f h m64AnnulusDomain) : m64ModulusEnergyDensity g r f =แต[volume.restrict m64AnnulusDomain] m64ModulusEnergyDensity g r h := by rw [m64Annulus_restrict_closed_eq_interior] filter_upwards [ae_restrict_mem isOpen_interior.measurableSet] with p hp apply m64ModulusEnergyDensity_congr_of_eventuallyEq g r filter_upwards [isOpen_interior.mem_nhds hp] with q hq exact heq (interior_subset hq) /-- Inside a genuine target chart, the actual manifold Gram coefficient equals the coordinate metric pairing of the differentiated map. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project derivation `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ theorem m64AreaGram_eq_chart (g : RiemannianMetric n M) (b : M) {f : LoopPlane โ†’ M} {p : LoopPlane} (hf : MDifferentiableAt (๐“ก 2) (๐“ก n) f p) (hp : f p โˆˆ (extChartAt (๐“ก n) b).source) (i j : Fin 2) : m60AreaGram g f p i j = g.pullbackCoefficients (extChartAt (๐“ก n) b).symm (extChartAt (๐“ก n) b (f p)) (fderiv โ„ ((extChartAt (๐“ก n) b) โˆ˜ f) p (EuclideanSpace.basisFun (Fin 2) โ„ i)) (fderiv โ„ ((extChartAt (๐“ก n) b) โˆ˜ f) p (EuclideanSpace.basisFun (Fin 2) โ„ j)) := by have hc : MDifferentiableAt (๐“ก n) (๐“ก n) (extChartAt (๐“ก n) b) (f p) := (contMDiffAt_extChartAt' (n := โˆž) (by simpa only [extChartAt_source] using hp)).mdifferentiableAt (by simp) have hd := mfderiv_comp p hc hf rw [mfderiv_eq_fderiv] at hd rw [hd] exact (ConjugateVariation.chartCoefficients_apply g b hp _ _).symm /-- The actual spatial Gram entries of a differentiable family equal the corresponding two coordinate-derivative columns. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project derivation `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ theorem m64AreaGram_family_eq_chart (g : RiemannianMetric n M) (b : M) {v : โ„ ร— LoopPlane โ†’ M} {p : โ„ ร— LoopPlane} (hv : MDifferentiableAt ๐“˜(โ„, โ„ ร— LoopPlane) (๐“ก n) v p) (hp : v p โˆˆ (extChartAt (๐“ก n) b).source) (i j : Fin 2) : m60AreaGram g (fun z => v (p.1, z)) p.2 i j = g.pullbackCoefficients (extChartAt (๐“ก n) b).symm (extChartAt (๐“ก n) b (v p)) (fderiv โ„ ((extChartAt (๐“ก n) b) โˆ˜ v) p (0, EuclideanSpace.basisFun (Fin 2) โ„ i)) (fderiv โ„ ((extChartAt (๐“ก n) b) โˆ˜ v) p (0, EuclideanSpace.basisFun (Fin 2) โ„ j)) := by have hi : MDifferentiableAt (๐“ก 2) ๐“˜(โ„, โ„ ร— LoopPlane) (fun z => (p.1, z)) p.2 := (hasFDerivAt_prodMk_right (๐•œ := โ„) p.1 p.2).differentiableAt.mdifferentiableAt have hslice : MDifferentiableAt (๐“ก 2) (๐“ก n) (fun z => v (p.1, z)) p.2 := hv.comp p.2 hi rw [m64AreaGram_eq_chart g b hslice hp] have hc : MDifferentiableAt (๐“ก n) (๐“ก n) (extChartAt (๐“ก n) b) (v p) := (contMDiffAt_extChartAt' (n := โˆž) (by simpa only [extChartAt_source] using hp)).mdifferentiableAt (by simp) have hu : DifferentiableAt โ„ ((extChartAt (๐“ก n) b) โˆ˜ v) p := (hc.comp p hv).differentiableAt have hd : HasFDerivAt (fun z => extChartAt (๐“ก n) b (v (p.1, z))) ((fderiv โ„ ((extChartAt (๐“ก n) b) โˆ˜ v) p).comp (ContinuousLinearMap.inr โ„ โ„ LoopPlane)) p.2 := HasFDerivAt.comp p.2 (f := fun z : LoopPlane => (p.1, z)) (g := (extChartAt (๐“ก n) b) โˆ˜ v) hu.hasFDerivAt (hasFDerivAt_prodMk_right (๐•œ := โ„) p.1 p.2) dsimp only [Function.comp_def] at hd โŠข rw [hd.fderiv] rfl /-- Every actual Gram entry of a smooth family is jointly smooth, including points of deficient rank. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project derivation `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ theorem m64AreaGram_family_contDiffAt (g : RiemannianMetric n M) {v : โ„ ร— LoopPlane โ†’ M} {p : โ„ ร— LoopPlane} (hv : ContMDiffAt ๐“˜(โ„, โ„ ร— LoopPlane) (๐“ก n) โˆž v p) (i j : Fin 2) : ContDiffAt โ„ โˆž (fun q : โ„ ร— LoopPlane => m60AreaGram g (fun z => v (q.1, z)) q.2 i j) p := by let b := v p let c := extChartAt (๐“ก n) b let u := c โˆ˜ v let B := g.pullbackCoefficients c.symm have hc : ContMDiffAt (๐“ก n) (๐“ก n) โˆž c (v p) := contMDiffAt_extChartAt have hu : ContDiffAt โ„ โˆž u p := contMDiffAt_iff_contDiffAt.mp (hc.comp p hv) have hB : ContDiffAt โ„ โˆž B (u p) := (g.contDiffOn_chartCoefficients b).contDiffAt ((isOpen_extChartAt_target b).mem_nhds (c.map_source (mem_extChartAt_source b))) have hdu (k : Fin 2) : ContDiffAt โ„ โˆž (fun q => fderiv โ„ u q (0, EuclideanSpace.basisFun (Fin 2) โ„ k)) p := (hu.fderiv_right (m := โˆž) (by simp)).clm_apply contDiffAt_const have hformula := ((hB.comp p hu).clm_apply (hdu i)).clm_apply (hdu j) apply hformula.congr_of_eventuallyEq have hchart : โˆ€แถ  q in ๐“ p, v q โˆˆ c.source := hv.continuousAt.preimage_mem_nhds ((isOpen_extChartAt_source b).mem_nhds (mem_extChartAt_source b)) have hnear : โˆ€แถ  q in ๐“ p, ContMDiffAt ๐“˜(โ„, โ„ ร— LoopPlane) (๐“ก n) 1 v q := (contMDiffAt_iff_contMDiffAt_nhds (by simp)).mp (hv.of_le (by simp)) filter_upwards [hchart, hnear] with q hq hvq exact m64AreaGram_family_eq_chart g b (hvq.mdifferentiableAt one_ne_zero) hq i j /-- The actual weighted Gram energy of a smooth family is jointly smooth for each fixed real modulus. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project derivation `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ theorem m64ModulusEnergyDensity_family_contDiffAt (g : RiemannianMetric n M) (r : โ„) {v : โ„ ร— LoopPlane โ†’ M} {p : โ„ ร— LoopPlane} (hv : ContMDiffAt ๐“˜(โ„, โ„ ร— LoopPlane) (๐“ก n) โˆž v p) : ContDiffAt โ„ โˆž (fun q : โ„ ร— LoopPlane => m64ModulusEnergyDensity g r (fun z => v (q.1, z)) q.2) p := by exact ((contDiffAt_const.mul (m64AreaGram_family_contDiffAt g hv 0 0)).add (contDiffAt_const.mul (m64AreaGram_family_contDiffAt g hv 1 1))).div_const 2 end PoincareMT