import OAI.AlgebraicGeometry.AbelianVariety.Averaging import OAI.AlgebraicGeometry.AbelianVariety.CompactIntegral import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap /-! # Averaging Derivative -/ namespace OAI.AlgebraicGeometry.AbelianVariety.AveragingDerivative.Constructions.ExteriorCohomology noncomputable section /-! # Averaging and the de Rham differential for ExteriorCohomology The invariant-coefficient average is the pointwise integral of translated forms. Joint chart smoothness and compact integral differentiation show that averaging commutes with the exterior derivative. Thus an invariant exact form on a compact commutative Lie group must be zero. -/ open scoped _root_.Manifold ContDiff _root_.Topology open Set Filter _root_.MeasureTheory variable {E G : Type*} [NormedAddCommGroup E] [NormedSpace โ„ E] [Group G] [TopologicalSpace G] [ChartedSpace E G] [LieGroup ๐“˜(โ„, E) โˆž G] {n : โ„•} def translatedValue (form : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G n) (g x : G) : E [โ‹€^Fin n]โ†’L[โ„] โ„‚ := ((form : Analysis.DifferentialForms.Manifold.Algebra.RawManifoldForm E G n).pullback (fun h : G => g * h)) x theorem leftCoefficient_comp_inverse (form : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G n) (g x : G) : (Averaging.Constructions.ExteriorCohomology.leftCoefficient form g).compContinuousLinearMap (mfderiv ๐“˜(โ„, E) ๐“˜(โ„, E) (fun h : G => xโปยน * h) x) = translatedValue form (g * xโปยน) x := by have he : (fun h : G => g * h) โˆ˜ (fun h : G => xโปยน * h) = (fun h : G => (g * xโปยน) * h) := by funext h; exact (mul_assoc g xโปยน h).symm have hp := (form : Analysis.DifferentialForms.Manifold.Algebra.RawManifoldForm E G n).pullback_comp (fun h : G => xโปยน * h) ((contMDiff_mul_left (I := ๐“˜(โ„, E)) (n := โˆž)).mdifferentiable (by simp)) (fun h : G => g * h) ((contMDiff_mul_left (I := ๐“˜(โ„, E)) (n := โˆž)).mdifferentiable (by simp)) rw [he] at hp have hv := congrFun hp.symm x rw [Analysis.DifferentialForms.Manifold.Algebra.RawManifoldForm.pullback_apply, inv_mul_cancel] at hv exact hv theorem translatedValue_eq_coefficient (form : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G n) (g x : G) : translatedValue form g x = (Averaging.Constructions.ExteriorCohomology.leftCoefficient form (g * x)).compContinuousLinearMap (mfderiv ๐“˜(โ„, E) ๐“˜(โ„, E) (fun h : G => xโปยน * h) x) := by have h := leftCoefficient_comp_inverse form (g * x) x rw [mul_inv_cancel_right] at h exact h.symm theorem translatedValue_continuous (form : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G n) (x : G) : Continuous (fun g => translatedValue form g x) := by let : IsTopologicalGroup G := topologicalGroup_of_lieGroup (I := ๐“˜(โ„, E)) (n := โˆž) let T : E โ†’L[โ„] E := mfderiv ๐“˜(โ„, E) ๐“˜(โ„, E) (fun h : G => xโปยน * h) x let L : (E [โ‹€^Fin n]โ†’L[โ„] โ„‚) โ†’L[โ„] (E [โ‹€^Fin n]โ†’L[โ„] โ„‚) := ContinuousAlternatingMap.compContinuousLinearMapCLM T have hc := (Averaging.Constructions.ExteriorCohomology.leftCoefficient_contMDiff form).continuous.comp (continuous_mul_const x) exact (L.continuous.comp hc).congr (fun g => (translatedValue_eq_coefficient form g x).symm) def translatedInChart (form : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G n) (c : OpenPartialHomeomorph G E) (g : G) (y : E) : E [โ‹€^Fin n]โ†’L[โ„] โ„‚ := ((form : Analysis.DifferentialForms.Manifold.Algebra.RawManifoldForm E G n).pullback (fun h : G => g * h)).inChart c y theorem translatedInChart_continuous (form : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G n) (c : OpenPartialHomeomorph G E) (y : E) : Continuous (fun g => translatedInChart form c g y) := by let T : E โ†’L[โ„] E := Analysis.DifferentialForms.Manifold.Charts.chartInverseTangentMap c y let L : (E [โ‹€^Fin n]โ†’L[โ„] โ„‚) โ†’L[โ„] (E [โ‹€^Fin n]โ†’L[โ„] โ„‚) := ContinuousAlternatingMap.compContinuousLinearMapCLM T exact L.continuous.comp (translatedValue_continuous form (c.symm y)) theorem translatedInChart_joint_contDiffAt (form : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G n) (c e : OpenPartialHomeomorph G E) (hc : c โˆˆ atlas E G) (he : e โˆˆ atlas E G) {y z : E} (hy : y โˆˆ c.target) (hz : z โˆˆ e.target) : ContDiffAt โ„ โˆž (fun p : E ร— E => translatedInChart form c (e.symm p.2) p.1) (y, z) := by let d := chartAt E (e.symm z * c.symm y) have hd : d โˆˆ atlas E G := chart_mem_atlas E _ have htarget : e.symm z * c.symm y โˆˆ d.source := mem_chart_source E _ have hcinv : ContMDiffAt ๐“˜(โ„, E) ๐“˜(โ„, E) โˆž c.symm y := contMDiffAt_symm_of_mem_maximalAtlas (IsManifold.subset_maximalAtlas hc) hy have heinv : ContMDiffAt ๐“˜(โ„, E) ๐“˜(โ„, E) โˆž e.symm z := contMDiffAt_symm_of_mem_maximalAtlas (IsManifold.subset_maximalAtlas he) hz have hm : ContMDiffAt ๐“˜(โ„, E ร— E) ๐“˜(โ„, E) โˆž (fun p : E ร— E => e.symm p.2 * c.symm p.1) (y, z) := (heinv.comp (y, z) contDiffAt_snd.contMDiffAt).mul (hcinv.comp (y, z) contDiffAt_fst.contMDiffAt) have hd' : ContMDiffAt ๐“˜(โ„, E) ๐“˜(โ„, E) โˆž d (e.symm z * c.symm y) := contMDiffAt_of_mem_maximalAtlas (IsManifold.subset_maximalAtlas hd) htarget have ht : ContDiffAt โ„ โˆž (fun p : E ร— E => d (e.symm p.2 * c.symm p.1)) (y, z) := (hd'.comp (y, z) hm).contDiffAt have ht3 : ContDiffAt โ„ โˆž (fun p : (E ร— E) ร— E => d (e.symm p.1.2 * c.symm p.2)) ((y, z), y) := by have hp : ContDiffAt โ„ โˆž (fun p : (E ร— E) ร— E => (p.2, p.1.2)) ((y, z), y) := contDiffAt_snd.prodMk contDiffAt_fst.snd exact ht.comp (f := fun p : (E ร— E) ร— E => (p.2, p.1.2)) ((y, z), y) hp have hder : ContDiffAt โ„ โˆž (fun p : E ร— E => fderiv โ„ (fun w => d (e.symm p.2 * c.symm w)) p.1) (y, z) := ht3.fderiv contDiffAt_fst (by simp) have hform := (Analysis.DifferentialForms.Manifold.Derivative.smoothForm_contDiffAt_inChart form.smooth d hd (d.map_source htarget)).comp (y, z) ht have hs := Analysis.DifferentialForms.Manifold.Alternatization.contDiffAt_alternating_compContinuousLinearMap hform hder apply hs.congr_of_eventuallyEq filter_upwards [continuousAt_fst.preimage_mem_nhds (c.open_target.mem_nhds hy), hm.continuousAt.preimage_mem_nhds (d.open_source.mem_nhds htarget)] with p hp hdp have hpb := (form : Analysis.DifferentialForms.Manifold.Algebra.RawManifoldForm E G n).pullback_inChart (fun h : G => e.symm p.2 * h) c d hc hd hp hdp ((contMDiff_mul_left (I := ๐“˜(โ„, E)) (n := โˆž)).mdifferentiableAt (by simp)) exact hpb theorem translatedInChart_fderiv_continuousAt (form : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G n) (c : OpenPartialHomeomorph G E) (hc : c โˆˆ atlas E G) {y : E} (hy : y โˆˆ c.target) (g : G) : ContinuousAt (fun p : E ร— G => fderiv โ„ (translatedInChart form c p.2) p.1) (y, g) := by let e := chartAt E g have he : e โˆˆ atlas E G := chart_mem_atlas E g have hg : g โˆˆ e.source := mem_chart_source E g have ht := translatedInChart_joint_contDiffAt form c e hc he hy (e.map_source hg) have ht3 : ContDiffAt โ„ โˆž (fun p : (E ร— E) ร— E => translatedInChart form c (e.symm p.1.2) p.2) ((y, e g), y) := by have hp : ContDiffAt โ„ โˆž (fun p : (E ร— E) ร— E => (p.2, p.1.2)) ((y, e g), y) := contDiffAt_snd.prodMk contDiffAt_fst.snd exact ht.comp ((y, e g), y) hp have hder : ContDiffAt โ„ โˆž (fun p : E ร— E => fderiv โ„ (translatedInChart form c (e.symm p.2)) p.1) (y, e g) := ht3.fderiv contDiffAt_fst (by simp) have hcoord : ContinuousAt (fun p : E ร— G => (p.1, e p.2)) (y, g) := continuousAt_fst.prodMk ((e.continuousAt hg).comp continuousAt_snd) apply (hder.continuousAt.comp (x := (y, g)) (f := fun p : E ร— G => (p.1, e p.2)) hcoord).congr_of_eventuallyEq filter_upwards [continuousAt_snd.preimage_mem_nhds (e.open_source.mem_nhds hg)] with p hp change fderiv โ„ (translatedInChart form c p.2) p.1 = fderiv โ„ (translatedInChart form c (e.symm (e p.2))) p.1 rw [e.left_inv hp] theorem translatedInChart_hasFDerivAt (form : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G n) (c : OpenPartialHomeomorph G E) (hc : c โˆˆ atlas E G) {y : E} (hy : y โˆˆ c.target) (g : G) : HasFDerivAt (translatedInChart form c g) (fderiv โ„ (translatedInChart form c g) y) y := by exact (Analysis.DifferentialForms.Manifold.Derivative.smoothForm_contDiffAt_inChart ((form : Analysis.DifferentialForms.Manifold.Algebra.RawManifoldForm E G n).pullback_smooth form.smooth (fun x : G => g * x) (contMDiff_mul_left (I := ๐“˜(โ„, E)) (n := โˆž))) c hc hy).differentiableAt (by simp) |>.hasFDerivAt variable [MeasurableSpace G] [BorelSpace G] [CompactSpace G] (ฮผ : Measure G) [IsFiniteMeasure ฮผ] theorem averageForms_eq_integral_pullback [Measure.IsMulRightInvariant ฮผ] (form : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G n) (x : G) : (Averaging.Constructions.ExteriorCohomology.averageForms ฮผ form) x = โˆซ g, translatedValue form g x โˆ‚ฮผ := by let : IsTopologicalGroup G := topologicalGroup_of_lieGroup (I := ๐“˜(โ„, E)) (n := โˆž) let T : E โ†’L[โ„] E := mfderiv ๐“˜(โ„, E) ๐“˜(โ„, E) (fun h : G => xโปยน * h) x let L : (E [โ‹€^Fin n]โ†’L[โ„] โ„‚) โ†’L[โ„] (E [โ‹€^Fin n]โ†’L[โ„] โ„‚) := ContinuousAlternatingMap.compContinuousLinearMapCLM T change L (โˆซ g, Averaging.Constructions.ExteriorCohomology.leftCoefficient form g โˆ‚ฮผ) = _ rw [โ† L.integral_comp_comm (Averaging.Constructions.ExteriorCohomology.leftCoefficient_integrable ฮผ form)] change (โˆซ g, (Averaging.Constructions.ExteriorCohomology.leftCoefficient form g).compContinuousLinearMap T โˆ‚ฮผ) = _ calc _ = โˆซ g, translatedValue form (g * xโปยน) x โˆ‚ฮผ := integral_congr_ae (ae_of_all _ (fun g => leftCoefficient_comp_inverse form g x)) _ = _ := integral_mul_right_eq_self (ฮผ := ฮผ) (fun g => translatedValue form g x) xโปยน theorem averageForms_inChart_eq_integral [Measure.IsMulRightInvariant ฮผ] (form : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G n) (c : OpenPartialHomeomorph G E) (y : E) : (Averaging.Constructions.ExteriorCohomology.averageForms ฮผ form : Analysis.DifferentialForms.Manifold.Algebra.RawManifoldForm E G n).inChart c y = โˆซ g, translatedInChart form c g y โˆ‚ฮผ := by let T : E โ†’L[โ„] E := Analysis.DifferentialForms.Manifold.Charts.chartInverseTangentMap c y let L : (E [โ‹€^Fin n]โ†’L[โ„] โ„‚) โ†’L[โ„] (E [โ‹€^Fin n]โ†’L[โ„] โ„‚) := ContinuousAlternatingMap.compContinuousLinearMapCLM T change L ((Averaging.Constructions.ExteriorCohomology.averageForms ฮผ form) (c.symm y)) = โˆซ g, L (translatedValue form g (c.symm y)) โˆ‚ฮผ rw [averageForms_eq_integral_pullback] exact (L.integral_comp_comm ((translatedValue_continuous form (c.symm y)).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _))).symm theorem averageForms_inChart_hasFDerivAt [Measure.IsMulRightInvariant ฮผ] (form : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G n) (c : OpenPartialHomeomorph G E) (hc : c โˆˆ atlas E G) {y : E} (hy : y โˆˆ c.target) : HasFDerivAt ((Averaging.Constructions.ExteriorCohomology.averageForms ฮผ form : Analysis.DifferentialForms.Manifold.Algebra.RawManifoldForm E G n).inChart c) (โˆซ g, fderiv โ„ (translatedInChart form c g) y โˆ‚ฮผ) y := by have hi := CompactIntegral.Constructions.ExteriorCohomology.hasFDerivAt_integral_compact (ฮผ := ฮผ) c.open_target hy (F := fun y g => translatedInChart form c g y) (F' := fun y g => fderiv โ„ (translatedInChart form c g) y) (fun z _ => translatedInChart_continuous form c z) (fun z hz g => translatedInChart_fderiv_continuousAt form c hc hz g) (fun z hz g => translatedInChart_hasFDerivAt form c hc hz g) exact hi.congr_of_eventuallyEq (Eventually.of_forall (fun z => averageForms_inChart_eq_integral ฮผ form c z)) theorem d_averageForms [Measure.IsMulRightInvariant ฮผ] (form : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G n) : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm.d (Averaging.Constructions.ExteriorCohomology.averageForms ฮผ form) = Averaging.Constructions.ExteriorCohomology.averageForms ฮผ (Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm.d form) := by apply Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm.ext intro x let c := chartAt E x have hc : c โˆˆ atlas E G := chart_mem_atlas E x have hx : x โˆˆ c.source := mem_chart_source E x have hy : c x โˆˆ c.target := c.map_source hx have hchart : (Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm.d (Averaging.Constructions.ExteriorCohomology.averageForms ฮผ form) : Analysis.DifferentialForms.Manifold.Algebra.RawManifoldForm E G (n + 1)).inChart c (c x) = (Averaging.Constructions.ExteriorCohomology.averageForms ฮผ (Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm.d form) : Analysis.DifferentialForms.Manifold.Algebra.RawManifoldForm E G (n + 1)).inChart c (c x) := by rw [Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm.d_inChart _ c hc hy, averageForms_inChart_eq_integral] rw [extDeriv, (averageForms_inChart_hasFDerivAt ฮผ form c hc hy).fderiv] let L : (E โ†’L[โ„] (E [โ‹€^Fin n]โ†’L[โ„] โ„‚)) โ†’L[โ„] (E [โ‹€^Fin (n + 1)]โ†’L[โ„] โ„‚) := ContinuousAlternatingMap.alternatizeUncurryFinCLM (n := n) โ„ E โ„‚ let : ContinuousENorm (E โ†’L[โ„] (E [โ‹€^Fin n]โ†’L[โ„] โ„‚)) := @SeminormedAddGroup.toContinuousENorm (E โ†’L[โ„] (E [โ‹€^Fin n]โ†’L[โ„] โ„‚)) inferInstance have hcont : Continuous (fun g => fderiv โ„ (translatedInChart form c g) (c x)) := by rw [continuous_iff_continuousAt] intro g exact (translatedInChart_fderiv_continuousAt form c hc hy g).comp (f := fun h : G => (c x, h)) (continuousAt_const.prodMk continuousAt_id) change L (โˆซ g, fderiv โ„ (translatedInChart form c g) (c x) โˆ‚ฮผ) = _ have hint : Integrable (fun g => fderiv โ„ (translatedInChart form c g) (c x)) ฮผ := by exact Continuous.integrable_of_hasCompactSupport (E := E โ†’L[โ„] (E [โ‹€^Fin n]โ†’L[โ„] โ„‚)) hcont (HasCompactSupport.of_compactSpace _) have hi := ContinuousLinearMap.integral_comp_comm (ฮผ := ฮผ) (๐•œ := โ„) (E := E โ†’L[โ„] (E [โ‹€^Fin n]โ†’L[โ„] โ„‚)) (Fโ‚— := E [โ‹€^Fin (n + 1)]โ†’L[โ„] โ„‚) L hint refine hi.symm.trans ?_ apply integral_congr_ae apply ae_of_all intro g have hd := Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm.d_inChart (Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm.pullback (fun h : G => g * h) (contMDiff_mul_left (I := ๐“˜(โ„, E)) (n := โˆž)) form) c hc hy rw [Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm.d_pullback] at hd exact hd.symm have hcov := congrArg (fun ฮฑ : E [โ‹€^Fin (n + 1)]โ†’L[โ„] โ„‚ => ฮฑ.compContinuousLinearMap (Analysis.DifferentialForms.Manifold.Charts.chartTangentMap c x)) hchart rw [Analysis.DifferentialForms.Manifold.Algebra.RawManifoldForm.inChart_comp_chartTangentMap _ c hc hx, Analysis.DifferentialForms.Manifold.Algebra.RawManifoldForm.inChart_comp_chartTangentMap _ c hc hx] at hcov exact hcov theorem averageForms_d_eq_zero [Measure.IsMulRightInvariant ฮผ] [IsMulCommutative G] (form : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G n) : Averaging.Constructions.ExteriorCohomology.averageForms ฮผ (Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm.d form) = 0 := by rw [โ† d_averageForms, Averaging.Constructions.ExteriorCohomology.averageForms_closed] theorem invariant_exact_eq_zero [Measure.IsMulRightInvariant ฮผ] [IsProbabilityMeasure ฮผ] [IsMulCommutative G] (form : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G (n + 1)) (hf : form โˆˆ InvariantClosed.Constructions.ExteriorCohomology.invariantForms (E := E) (G := G) (n + 1)) (other : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm E G n) (he : Analysis.DifferentialForms.Manifold.Algebra.SmoothManifoldForm.d other = form) : form = 0 := by rw [โ† Averaging.Constructions.ExteriorCohomology.averageForms_of_invariant ฮผ form hf, โ† he, averageForms_d_eq_zero] end end OAI.AlgebraicGeometry.AbelianVariety.AveragingDerivative.Constructions.ExteriorCohomology