import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Rigidity.Exponential.PullbackMetric import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Measure.Calibration.Calibration import Mathlib.Analysis.InnerProductSpace.NormDet /-! # The genuine pullback Jacobian The Gram determinant of the actual pulled-back metric gives the norm determinant of the actual differential. It is continuous for a C1 map, positive at noncritical points, and agrees with linear volume scaling. -/ set_option autoImplicit false open Set Filter MeasureTheory open scoped Manifold ContDiff Bundle Topology ENNReal universe u namespace PoincareMT.ReducedVolume variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] /-- The square-root Gram determinant of the genuine selected pullback metric. -/ noncomputable def pullbackJacobian (g : RiemannianMetric n M) (f : EuclideanSpace ℝ (Fin n) β†’ M) (x : EuclideanSpace ℝ (Fin n)) : ℝ := Real.sqrt (Matrix.det (fun i j : Fin n ↦ pullbackMetricForm g f x (EuclideanSpace.basisFun (Fin n) ℝ i) (EuclideanSpace.basisFun (Fin n) ℝ j))) set_option backward.isDefEq.respectTransparency false in /-- The Gram formula agrees with the norm determinant for the actual selected metric. -/ theorem pullbackJacobian_eq_normDet (g : RiemannianMetric n M) (f : EuclideanSpace ℝ (Fin n) β†’ M) (x : EuclideanSpace ℝ (Fin n)) : letI : Bundle.RiemannianBundle (TangentSpace (𝓑 n) : M β†’ Type _) := ⟨g.toRiemannianMetric⟩ pullbackJacobian g f x = LinearMap.normDet (U := EuclideanSpace ℝ (Fin n)) (V := TangentSpace (𝓑 n) (f x)) (mfderiv (𝓑 n) (𝓑 n) f x).toLinearMap := by let : Bundle.RiemannianBundle (TangentSpace (𝓑 n) : M β†’ Type _) := ⟨g.toRiemannianMetric⟩ let D : EuclideanSpace ℝ (Fin n) β†’β‚—[ℝ] TangentSpace (𝓑 n) (f x) := (mfderiv (𝓑 n) (𝓑 n) f x).toLinearMap have hsq := D.normDet_sq_eq_det_gram (EuclideanSpace.basisFun (Fin n) ℝ) rw [RCLike.ofReal_real_eq_id, id_eq] at hsq change Real.sqrt (Matrix.gram ℝ (fun i ↦ D (EuclideanSpace.basisFun (Fin n) ℝ i))).det = D.normDet rw [← hsq, Real.sqrt_sq D.normDet_nonneg] /-- The actual Jacobian is always nonnegative, including at critical points. -/ theorem pullbackJacobian_nonneg (g : RiemannianMetric n M) (f : EuclideanSpace ℝ (Fin n) β†’ M) (x : EuclideanSpace ℝ (Fin n)) : 0 ≀ pullbackJacobian g f x := Real.sqrt_nonneg _ set_option backward.isDefEq.respectTransparency false in /-- An injective actual differential gives a strictly positive Jacobian. -/ theorem pullbackJacobian_pos (g : RiemannianMetric n M) {f : EuclideanSpace ℝ (Fin n) β†’ M} {x : EuclideanSpace ℝ (Fin n)} (hD : Function.Injective (mfderiv (𝓑 n) (𝓑 n) f x)) : 0 < pullbackJacobian g f x := by let : Bundle.RiemannianBundle (TangentSpace (𝓑 n) : M β†’ Type _) := ⟨g.toRiemannianMetric⟩ rw [pullbackJacobian_eq_normDet] let D : EuclideanSpace ℝ (Fin n) β†’β‚—[ℝ] TangentSpace (𝓑 n) (f x) := (mfderiv (𝓑 n) (𝓑 n) f x).toLinearMap change 0 < D.normDet refine lt_of_le_of_ne D.normDet_nonneg ?_ exact Ne.symm (fun h ↦ LinearMap.normDet_eq_zero_iff_ker_ne_bot.mp h (LinearMap.ker_eq_bot.mpr hD)) /-- The actual Gram Jacobian is continuous at every C1 germ. -/ theorem pullbackJacobian_continuousAt (g : RiemannianMetric n M) {f : EuclideanSpace ℝ (Fin n) β†’ M} {x : EuclideanSpace ℝ (Fin n)} (hf : ContMDiffAt (𝓑 n) (𝓑 n) 1 f x) : ContinuousAt (pullbackJacobian g f) x := by have hB := pullbackMetricForm_continuousAt g hf have hmatrix : ContinuousAt (fun y ↦ (fun i j : Fin n ↦ pullbackMetricForm g f y (EuclideanSpace.basisFun (Fin n) ℝ i) (EuclideanSpace.basisFun (Fin n) ℝ j))) x := continuousAt_pi.mpr fun _ ↦ continuousAt_pi.mpr fun _ ↦ (hB.clm_apply continuousAt_const).clm_apply continuousAt_const exact Real.continuous_sqrt.continuousAt.comp (continuous_id.matrix_det.continuousAt.comp hmatrix) /-- A positive actual Jacobian varies by an arbitrarily small multiplicative factor locally. -/ theorem eventually_pullbackJacobian_comparison (g : RiemannianMetric n M) {f : EuclideanSpace ℝ (Fin n) β†’ M} {x : EuclideanSpace ℝ (Fin n)} (hf : ContMDiffAt (𝓑 n) (𝓑 n) 1 f x) (hD : Function.Injective (mfderiv (𝓑 n) (𝓑 n) f x)) {r : ℝ} (hr : 1 < r) : βˆ€αΆ  y in 𝓝 x, pullbackJacobian g f x / r ≀ pullbackJacobian g f y ∧ pullbackJacobian g f y ≀ r * pullbackJacobian g f x := by have hJ := pullbackJacobian_pos g hD have hlo : pullbackJacobian g f x / r < pullbackJacobian g f x := (div_lt_self hJ hr).trans_le le_rfl have hhi : pullbackJacobian g f x < r * pullbackJacobian g f x := by nlinarith have hcont := pullbackJacobian_continuousAt g hf filter_upwards [hcont (eventually_gt_nhds hlo), hcont (eventually_lt_nhds hhi)] with y hylo hyhi exact ⟨hylo.le, hyhi.le⟩ /-- Linear Euclidean volume scaling uses the same norm determinant and calibration. -/ theorem volume_linear_image_eq_normDet_mul (L : EuclideanSpace ℝ (Fin n) β†’β‚—[ℝ] EuclideanSpace ℝ (Fin n)) (A : Set (EuclideanSpace ℝ (Fin n))) : volume (L '' A) = ENNReal.ofReal L.normDet * volume A := by have hH := L.hausdorffMeasure_image A simp only [finrank_euclideanSpace, Fintype.card_fin] at hH rw [← euclideanVolumeCalibration_smul_hausdorff n, Measure.smul_apply, Measure.smul_apply, smul_eq_mul, smul_eq_mul, hH] exact mul_left_comm _ _ _ end PoincareMT.ReducedVolume