import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Regularity.Lipschitz.ChartLipschitz import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Measure.Calibration.NullTransport import Mathlib.Analysis.Calculus.Rademacher import Mathlib.MeasureTheory.Function.Jacobian /-! # Local exceptional sets for Corollary 6.67 Morgan--Tian Corollary 6.67 and Claims 6.68-6.69, printed pp. 139-140, as used in Proposition 16.1, p. 394. Calibrated Rademacher nullity needs local regularity only on the comparison region; calibrated Sard nullity needs differentiability only on the survival domain. These are the local forms of the chart arguments in the lower M10 library. -/ set_option autoImplicit false -- The calibrated-volume chart transport uses the selected metric instances. set_option backward.isDefEq.respectTransparency false open MeasureTheory Set Filter open scoped Manifold ContDiff Bundle Topology NNReal ENNReal universe u namespace PoincareMT.M10 export PoincareMT.ReducedVolume (inverseChart_local_lipschitz) end PoincareMT.M10 namespace PoincareMT.M10 export PoincareMT.ReducedVolume (calibratedMetricVolume_image_eq_zero_of_lipschitz) end PoincareMT.M10 namespace PoincareMT.Proofs.M46 variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] [T3Space M] [SecondCountableTopology M] [MeasurableSpace M] [BorelSpace M] /-- Local chart Lipschitz regularity makes the nondifferentiability set null within the selected comparison region, Corollary 6.67, p. 140. -/ theorem comparison_nondifferentiability_null (g : RiemannianMetric n M) {f : M β†’ ℝ} (A : Set M) (hf : βˆ€ q ∈ A, βˆƒ S : Set (EuclideanSpace ℝ (Fin n)), IsOpen S ∧ extChartAt (𝓑 n) q q ∈ S ∧ S βŠ† (extChartAt (𝓑 n) q).target ∧ βˆƒ K : ℝβ‰₯0, LipschitzOnWith K (f ∘ (extChartAt (𝓑 n) q).symm) S) : calibratedMetricVolume g {q | q ∈ A ∧ Β¬ MDifferentiableAt (𝓑 n) (π“˜(ℝ, ℝ)) f q} = 0 := by apply measure_null_of_locally_null intro q hq obtain ⟨S, hSopen, hqS, _, K, hLip⟩ := hf q hq.1 obtain ⟨r, hr, _, C, hchart⟩ := M10.inverseChart_local_lipschitz g q let e := extChartAt (𝓑 n) q let U := S ∩ Metric.ball (e q) r have hUopen : IsOpen U := hSopen.inter Metric.isOpen_ball have hqU : e q ∈ U := ⟨hqS, Metric.mem_ball_self hr⟩ let B := {y | y ∈ U ∧ Β¬ DifferentiableAt ℝ (f ∘ e.symm) y} have hBnull : volume B = 0 := by have hgood : βˆ€α΅ y βˆ‚volume, y ∈ U β†’ DifferentiableAt ℝ (f ∘ e.symm) y := by filter_upwards [LipschitzOnWith.ae_differentiableWithinAt_of_mem (ΞΌ := volume) (hLip.mono (show U βŠ† S from inter_subset_left))] with y hy hyU exact (hy hyU).differentiableAt (hUopen.mem_nhds hyU) simpa only [Classical.not_imp] using ae_iff.mp hgood have himage : calibratedMetricVolume g (e.symm '' B) = 0 := M10.calibratedMetricVolume_image_eq_zero_of_lipschitz g (fun _ hy => hy.1.2) hBnull hchart let V := e.source ∩ e ⁻¹' U have hV : V ∈ 𝓝 q := inter_mem (extChartAt_source_mem_nhds (I := 𝓑 n) q) ((continuousAt_extChartAt (I := 𝓑 n) q).preimage_mem_nhds (hUopen.mem_nhds hqU)) refine ⟨V ∩ {x | x ∈ A ∧ Β¬ MDifferentiableAt (𝓑 n) (π“˜(ℝ, ℝ)) f x}, inter_mem (mem_nhdsWithin_of_mem_nhds hV) self_mem_nhdsWithin, ?_⟩ apply measure_mono_null _ himage intro x hx refine ⟨e x, ⟨hx.1.2, ?_⟩, e.left_inv hx.1.1⟩ intro hdiff apply hx.2.2 apply (mdifferentiableAt_iff_source_of_mem_source (I := 𝓑 n) (I' := π“˜(ℝ, ℝ)) (f := f) (x := q) (by simpa only [← extChartAt_source (𝓑 n)] using hx.1.1)).mpr simpa only [modelWithCornersSelf_coe, range_id, mdifferentiableWithinAt_univ] using hdiff.mdifferentiableAt /-- Critical values coming from a specified differentiability domain are null for the selected slice metric, Corollary 6.67, p. 140. -/ theorem survival_criticalValues_null (g : RiemannianMetric n M) {f : EuclideanSpace ℝ (Fin n) β†’ M} (D : Set (EuclideanSpace ℝ (Fin n))) (hf : βˆ€ x ∈ D, MDifferentiableAt (𝓑 n) (𝓑 n) f x) : calibratedMetricVolume g (f '' {x | x ∈ D ∧ Β¬ Function.Bijective (mfderiv (𝓑 n) (𝓑 n) f x)}) = 0 := by apply measure_null_of_locally_null intro q _ obtain ⟨r, hr, _, C, hchart⟩ := M10.inverseChart_local_lipschitz g q let e := extChartAt (𝓑 n) q let U := Metric.ball (e q) r let V := e.source ∩ e ⁻¹' U have hV : V ∈ 𝓝 q := inter_mem (extChartAt_source_mem_nhds (I := 𝓑 n) q) ((continuousAt_extChartAt (I := 𝓑 n) q).preimage_mem_nhds (Metric.ball_mem_nhds _ hr)) let A := {x | (x ∈ D ∧ Β¬ Function.Bijective (mfderiv (𝓑 n) (𝓑 n) f x)) ∧ f x ∈ V} have hcoord : βˆ€ x ∈ A, DifferentiableAt ℝ (e ∘ f) x := by intro x hx have he : MDifferentiableAt (𝓑 n) (𝓑 n) e (f x) := mdifferentiableAt_extChartAt (by simpa only [← extChartAt_source (𝓑 n)] using hx.2.1) exact (he.comp x (hf x hx.1.1)).differentiableAt have hdet : βˆ€ x ∈ A, (fderiv ℝ (e ∘ f) x).det = 0 := by intro x hx let : FiniteDimensional ℝ (TangentSpace (𝓑 n) x) := inferInstanceAs (FiniteDimensional ℝ (EuclideanSpace ℝ (Fin n))) apply LinearMap.det_eq_zero_iff_ker_ne_bot.mpr intro hker have hinj : Function.Injective (fderiv ℝ (e ∘ f) x) := LinearMap.ker_eq_bot.mp hker have he : MDifferentiableAt (𝓑 n) (𝓑 n) e (f x) := mdifferentiableAt_extChartAt (by simpa only [← extChartAt_source (𝓑 n)] using hx.2.1) have hchain := mfderiv_comp x he (hf x hx.1.1) rw [mfderiv_eq_fderiv] at hchain have hdf : Function.Injective (mfderiv (𝓑 n) (𝓑 n) f x) := by intro v w hvw apply hinj rw [hchain] exact congrArg (mfderiv (𝓑 n) (𝓑 n) e (f x)) hvw exact hx.1.2 ⟨hdf, LinearMap.injective_iff_surjective.mp hdf⟩ have hnull : volume ((e ∘ f) '' A) = 0 := addHaar_image_eq_zero_of_det_fderivWithin_eq_zero volume (fun x hx => (hcoord x hx).hasFDerivAt.hasFDerivWithinAt) hdet have himage : calibratedMetricVolume g (e.symm '' ((e ∘ f) '' A)) = 0 := M10.calibratedMetricVolume_image_eq_zero_of_lipschitz g (by rintro _ ⟨x, hx, rfl⟩; exact hx.2.2) hnull hchart refine ⟨V ∩ f '' {x | x ∈ D ∧ Β¬ Function.Bijective (mfderiv (𝓑 n) (𝓑 n) f x)}, inter_mem (mem_nhdsWithin_of_mem_nhds hV) self_mem_nhdsWithin, ?_⟩ apply measure_mono_null _ himage rintro y ⟨hyV, x, hx, rfl⟩ exact ⟨e (f x), ⟨x, ⟨hx, hyV⟩, rfl⟩, e.left_inv hyV.1⟩ end PoincareMT.Proofs.M46